Lines Matching defs:spv

38 using ValidateCFG = spvtest::ValidateBase<spv::Capability>;
59 spv::Op type_;
67 explicit Block(std::string label, spv::Op type = spv::Op::OpBranch)
90 case spv::Op::OpBranchConditional:
96 case spv::Op::OpSwitch: {
104 case spv::Op::OpLoopMerge: {
110 case spv::Op::OpReturn:
114 case spv::Op::OpUnreachable:
118 case spv::Op::OpBranch:
122 case spv::Op::OpKill:
139 if (lhs.type_ == spv::Op::OpBranchConditional) {
141 } else if (lhs.type_ == spv::Op::OpSwitch) {
150 assert(lhs.type_ == spv::Op::OpBranch);
155 const std::string& GetDefaultHeader(spv::Capability cap) {
166 return (cap == spv::Capability::Shader) ? shader_header : kernel_header;
182 ::testing::Values(spv::Capability::Shader,
183 spv::Capability::Kernel));
269 bool is_shader = GetParam() == spv::Capability::Shader;
271 Block loop("loop", spv::Op::OpBranchConditional);
273 Block merge("merge", spv::Op::OpReturn);
299 Block exit("exit", spv::Op::OpReturn);
318 Block exit("exit", spv::Op::OpReturn);
340 bool is_shader = GetParam() == spv::Capability::Shader;
342 Block loop("loop", spv::Op::OpBranchConditional);
343 Block merge("merge", spv::Op::OpReturn);
364 bool is_shader = GetParam() == spv::Capability::Shader;
367 Block branch("branch", spv::Op::OpBranchConditional);
368 Block merge("merge", spv::Op::OpReturn);
393 bool is_shader = GetParam() == spv::Capability::Shader;
396 Block selection("selection", spv::Op::OpBranchConditional);
397 Block merge("merge", spv::Op::OpReturn);
429 bool is_shader = GetParam() == spv::Capability::Shader;
431 Block loop("loop", spv::Op::OpBranchConditional);
432 Block selection("selection", spv::Op::OpBranchConditional);
433 Block merge("merge", spv::Op::OpReturn);
467 Block end("end", spv::Op::OpReturn);
490 Block end("end", spv::Op::OpReturn);
512 Block bad("bad", spv::Op::OpBranchConditional);
513 Block exit("exit", spv::Op::OpReturn);
539 Block bad("bad", spv::Op::OpBranchConditional);
542 Block end("end", spv::Op::OpReturn);
569 Block bad("bad", spv::Op::OpSwitch);
575 Block end("end", spv::Op::OpReturn);
606 Block middle("middle", spv::Op::OpBranchConditional);
607 Block end("end", spv::Op::OpReturn);
614 Block end2("end2", spv::Op::OpReturn);
644 bool is_shader = GetParam() == spv::Capability::Shader;
645 Block head("head", spv::Op::OpBranchConditional);
646 Block exit("exit", spv::Op::OpReturn);
676 std::string GetUnreachableMergeNoMergeInst(spv::Capability cap) {
679 Block branch("branch", spv::Op::OpBranchConditional);
680 Block t("t", spv::Op::OpReturn);
681 Block f("f", spv::Op::OpReturn);
682 Block merge("merge", spv::Op::OpReturn);
685 if (cap == spv::Capability::Shader)
706 std::string GetUnreachableMergeTerminatedBy(spv::Capability cap, spv::Op op) {
710 Block branch("branch", spv::Op::OpBranchConditional);
711 Block t("t", spv::Op::OpReturn);
712 Block f("f", spv::Op::OpReturn);
717 if (cap == spv::Capability::Shader)
735 GetUnreachableMergeTerminatedBy(GetParam(), spv::Op::OpUnreachable));
740 CompileSuccessfully(GetUnreachableMergeTerminatedBy(spv::Capability::Shader,
741 spv::Op::OpKill));
747 GetUnreachableMergeTerminatedBy(GetParam(), spv::Op::OpReturn));
751 std::string GetUnreachableContinueTerminatedBy(spv::Capability cap,
752 spv::Op op) {
756 Block branch("branch", spv::Op::OpBranch);
757 Block merge("merge", spv::Op::OpReturn);
760 if (op == spv::Op::OpBranch) target >> branch;
763 if (cap == spv::Capability::Shader)
780 GetUnreachableContinueTerminatedBy(GetParam(), spv::Op::OpUnreachable));
781 if (GetParam() == spv::Capability::Shader) {
792 spv::Capability::Shader, spv::Op::OpKill));
800 GetUnreachableContinueTerminatedBy(GetParam(), spv::Op::OpReturn));
801 if (GetParam() == spv::Capability::Shader) {
812 GetUnreachableContinueTerminatedBy(GetParam(), spv::Op::OpBranch));
816 std::string GetUnreachableMergeUnreachableMergeInst(spv::Capability cap) {
819 Block body("body", spv::Op::OpReturn);
821 Block branch("branch", spv::Op::OpBranchConditional);
822 Block t("t", spv::Op::OpReturn);
823 Block f("f", spv::Op::OpReturn);
824 Block merge("merge", spv::Op::OpUnreachable);
828 if (cap == spv::Capability::Shader)
850 std::string GetUnreachableContinueUnreachableLoopInst(spv::Capability cap) {
853 Block body("body", spv::Op::OpReturn);
855 Block branch("branch", spv::Op::OpBranch);
856 Block merge("merge", spv::Op::OpReturn);
857 Block target("target", spv::Op::OpBranch);
862 if (cap == spv::Capability::Shader)
883 std::string GetUnreachableMergeWithComplexBody(spv::Capability cap) {
887 Block branch("branch", spv::Op::OpBranchConditional);
888 Block t("t", spv::Op::OpReturn);
889 Block f("f", spv::Op::OpReturn);
890 Block merge("merge", spv::Op::OpUnreachable);
897 if (cap == spv::Capability::Shader)
919 std::string GetUnreachableContinueWithComplexBody(spv::Capability cap) {
923 Block branch("branch", spv::Op::OpBranch);
924 Block merge("merge", spv::Op::OpReturn);
925 Block target("target", spv::Op::OpBranch);
933 if (cap == spv::Capability::Shader)
954 std::string GetUnreachableMergeWithBranchUse(spv::Capability cap) {
958 Block branch("branch", spv::Op::OpBranchConditional);
959 Block t("t", spv::Op::OpBranch);
960 Block f("f", spv::Op::OpReturn);
961 Block merge("merge", spv::Op::OpUnreachable);
966 if (cap == spv::Capability::Shader)
987 std::string GetUnreachableMergeWithMultipleUses(spv::Capability cap) {
991 Block branch("branch", spv::Op::OpBranchConditional);
992 Block t("t", spv::Op::OpReturn);
993 Block f("f", spv::Op::OpReturn);
994 Block merge("merge", spv::Op::OpUnreachable);
995 Block duplicate("duplicate", spv::Op::OpBranchConditional);
1000 if (cap == spv::Capability::Shader) {
1021 if (GetParam() == spv::Capability::Shader) {
1030 std::string GetUnreachableContinueWithBranchUse(spv::Capability cap) {
1034 Block branch("branch", spv::Op::OpBranch);
1035 Block merge("merge", spv::Op::OpReturn);
1036 Block target("target", spv::Op::OpBranch);
1043 if (cap == spv::Capability::Shader)
1064 std::string GetReachableMergeAndContinue(spv::Capability cap) {
1068 Block branch("branch", spv::Op::OpBranch);
1069 Block merge("merge", spv::Op::OpReturn);
1070 Block target("target", spv::Op::OpBranch);
1071 Block body("body", spv::Op::OpBranchConditional);
1072 Block t("t", spv::Op::OpBranch);
1073 Block f("f", spv::Op::OpBranch);
1081 if (cap == spv::Capability::Shader) {
1107 std::string GetUnreachableMergeAndContinue(spv::Capability cap) {
1111 Block branch("branch", spv::Op::OpBranch);
1112 Block merge("merge", spv::Op::OpReturn);
1113 Block target("target", spv::Op::OpBranch);
1114 Block body("body", spv::Op::OpBranchConditional);
1115 Block t("t", spv::Op::OpReturn);
1116 Block f("f", spv::Op::OpReturn);
1117 Block pre_target("pre_target", spv::Op::OpBranch);
1123 if (cap == spv::Capability::Shader) {
1150 std::string GetUnreachableBlock(spv::Capability cap) {
1155 Block exit("exit", spv::Op::OpReturn);
1174 std::string GetUnreachableBranch(spv::Capability cap) {
1178 Block unreachable("unreachable", spv::Op::OpBranchConditional);
1182 Block exit("exit", spv::Op::OpReturn);
1185 if (cap == spv::Capability::Shader)
1222 bool is_shader = GetParam() == spv::Capability::Shader;
1224 Block loop("loop", spv::Op::OpBranchConditional);
1225 Block exit("exit", spv::Op::OpReturn);
1243 bool is_shader = GetParam() == spv::Capability::Shader;
1247 spv::Op::OpBranchConditional);
1248 Block loop2("loop2", spv::Op::OpBranchConditional);
1251 Block exit("exit", spv::Op::OpReturn);
1278 bool is_shader = GetParam() == spv::Capability::Shader;
1287 if_blocks.emplace_back("if0", spv::Op::OpBranchConditional);
1290 merge_blocks.emplace_back("if_merge0", spv::Op::OpReturn);
1295 if_blocks.emplace_back("if" + ss.str(), spv::Op::OpBranchConditional);
1298 merge_blocks.emplace_back("if_merge" + ss.str(), spv::Op::OpBranch);
1321 bool is_shader = GetParam() == spv::Capability::Shader;
1323 Block loop1("loop1", spv::Op::OpBranchConditional);
1324 Block loop2("loop2", spv::Op::OpBranchConditional);
1326 Block loop1_cont("loop1_cont", spv::Op::OpBranchConditional);
1328 Block exit("exit", spv::Op::OpReturn);
1351 if (GetParam() == spv::Capability::Shader) {
1366 bool is_shader = GetParam() == spv::Capability::Shader;
1368 Block split("split", spv::Op::OpBranchConditional);
1371 Block exit("exit", spv::Op::OpReturn);
1401 bool is_shader = GetParam() == spv::Capability::Shader;
1403 Block split("split", spv::Op::OpBranchConditional);
1404 Block exit("exit", spv::Op::OpReturn);
1432 bool is_shader = GetParam() == spv::Capability::Shader;
1434 Block loop("loop", spv::Op::OpBranchConditional);
1437 Block merge("merge", spv::Op::OpReturn);
1468 bool is_shader = GetParam() == spv::Capability::Shader;
1470 Block loop("loop", spv::Op::OpBranchConditional);
1471 Block cheader("cheader", spv::Op::OpBranchConditional);
1473 Block merge("merge", spv::Op::OpReturn);
1474 Block exit("exit", spv::Op::OpReturn);
1507 bool is_shader = GetParam() == spv::Capability::Shader;
1509 Block loop("loop", spv::Op::OpBranchConditional);
1510 Block cont("cont", spv::Op::OpBranchConditional);
1511 Block merge("merge", spv::Op::OpReturn);
1542 bool is_shader = GetParam() == spv::Capability::Shader;
1544 Block loop("loop", spv::Op::OpBranchConditional);
1545 Block cont("cont", spv::Op::OpBranchConditional);
1547 Block exit("exit", spv::Op::OpReturn);
1578 Block entry("entry", spv::Op::OpSwitch);
1582 Block def("default", spv::Op::OpUnreachable);
1583 Block phi("phi", spv::Op::OpReturn);
1690 bool is_shader = GetParam() == spv::Capability::Shader;
1691 Block entry("entry", spv::Op::OpBranchConditional);
1692 Block inner_head("inner_head", spv::Op::OpBranchConditional);
1693 Block inner_true("inner_true", spv::Op::OpReturn);
1694 Block inner_false("inner_false", spv::Op::OpReturn);
1696 Block exit("exit", spv::Op::OpReturn);
1724 bool is_shader = GetParam() == spv::Capability::Shader;
1727 Block if_head("if_head", spv::Op::OpBranchConditional);
1729 Block if_merge("if_merge", spv::Op::OpBranchConditional);
1730 Block merge("merge", spv::Op::OpReturn);
1768 bool is_shader = GetParam() == spv::Capability::Shader;
1770 Block loop("loop", spv::Op::OpBranchConditional);
1771 Block latch("latch", spv::Op::OpBranchConditional);
1772 Block merge("merge", spv::Op::OpReturn);