[llvm] [AMDGPU] Calc IsVALU correctly during UADDO/USUBO selection (PR #159814)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 22 08:15:37 PDT 2025


================
@@ -5961,9 +5963,12 @@ SITargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
         .add(Src1);
     // clang-format on
 
-    BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_CSELECT_B64), Dest1.getReg())
-        .addImm(1)
-        .addImm(0);
+    const TargetRegisterClass *Dest1RC = MRI.getRegClass(Dest1.getReg());
+    unsigned Dest1Size = TRI->getRegSizeInBits(*Dest1RC);
+    assert(Dest1Size == 64 || Dest1Size == 32);
+    unsigned SelOpc =
+        (Dest1Size == 64) ? AMDGPU::S_CSELECT_B64 : AMDGPU::S_CSELECT_B32;
----------------
LU-JOHN wrote:

Changed.

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


More information about the llvm-commits mailing list