[llvm] [AMDGPU] Delete redundant s_or_b32 (PR #165261)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 08:50:58 PST 2025


================
@@ -10689,6 +10689,25 @@ bool SIInstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
     if (!optimizeSCC(Def, &CmpInstr, RI))
       return false;
 
+    // If s_or_b32 result is unused (i.e. it is effectively a 64-bit s_cmp_lg of
+    // a register pair) and the input is a 64-bit foldableSelect then transform:
+    //
+    //   (s_or_b32 (S_CSELECT_B64 (non-zero imm), 0), 0 => (S_CSELECT_B64
+    //   (non-zero
----------------
LU-JOHN wrote:

Updated comment.

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


More information about the llvm-commits mailing list