================
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register 
ResVReg,
     }
     return MIB.constrainAllUses(TII, TRI, RBI);
   }
-  case Intrinsic::spv_loop_merge:
-  case Intrinsic::spv_selection_merge: {
-    const auto Opcode = IID == Intrinsic::spv_selection_merge
-                            ? SPIRV::OpSelectionMerge
-                            : SPIRV::OpLoopMerge;
-    auto MIB = BuildMI(BB, I, I.getDebugLoc(), TII.get(Opcode));
+  case Intrinsic::spv_loop_merge: {
+    auto MIB = BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpLoopMerge));
     for (unsigned i = 1; i < I.getNumExplicitOperands(); ++i) {
       assert(I.getOperand(i).isMBB());
       MIB.addMBB(I.getOperand(i).getMBB());
     }
     MIB.addImm(SPIRV::SelectionControl::None);
     return MIB.constrainAllUses(TII, TRI, RBI);
   }
+  case Intrinsic::spv_selection_merge: {
+
+    auto SelectionControl = SPIRV::SelectionControl::None;
+    auto LastOp = I.getOperand(I.getNumExplicitOperands() - 1);
----------------
joaosaffran wrote:

@llvm-beanz @Keenuts SPIRV Structurizer pass is not register in `opt` CLI. 
Also, I don't see any tests, only calling the structurizer. That being said, 
there is currently [this 
test](https://github.com/llvm/llvm-project/pull/116331/files#diff-b48f32fed30eadb1a750bf5cd542c92d33824c63df80bbc86eafc16b175a316e),
 which follow the same pattern as other structurizer tests. 

Is such test enough? If any more tests are needed, can you give me an example 
on how to do it, please?  

https://github.com/llvm/llvm-project/pull/116331
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to