================
@@ -808,6 +835,20 @@ bool SPIRVInstructionSelector::selectExtInst(Register 
ResVReg,
   return false;
 }
 
+bool SPIRVInstructionSelector::selectNAryOpWithSrcs(Register ResVReg,
+                                                    const SPIRVType *ResType,
+                                                    MachineInstr &I,
+                                                    std::vector<Register> Srcs,
+                                                    unsigned Opcode) const {
+  auto MIB = BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(Opcode))
+                 .addDef(ResVReg)
+                 .addUse(GR.getSPIRVTypeID(ResType));
+  for (Register SReg : Srcs) {
+    MIB.addUse(SReg);
----------------
farzonl wrote:

I'm pretty sure this function could just replace `selectUnOpWithSrc` because 
unary wone just be one iteration of the loop. Maybe it would be better to do an 
NFC change that unifies to one function called `selectOpWithSrcs`?

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

Reply via email to