[llvm] [SPIRV] Audit `select` Result in SPIRVInstructionSelector (PR #115193)

Sarah Spall via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 14:52:02 PST 2024


================
@@ -1205,21 +1219,22 @@ bool SPIRVInstructionSelector::selectOverflowArith(Register ResVReg,
             .addUse(GR.getSPIRVTypeID(ResType))
             .addUse(StructVReg)
             .addImm(i);
-    Status &= MIB.constrainAllUses(TII, TRI, RBI);
+    Result &= MIB.constrainAllUses(TII, TRI, RBI);
   }
   // Build boolean value from the higher part.
-  Status &= BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpINotEqual))
+  Result &= BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpINotEqual))
----------------
spall wrote:

I would do 'return Result && BuildMI', instead of returning later.

https://github.com/llvm/llvm-project/pull/115193


More information about the llvm-commits mailing list