[llvm] [AMDGPU][ISel] `setcc` peephole for comparisons with upper 32 bits of a 64-bit register pair (PR #177662)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 11 07:53:48 PST 2026


================
@@ -17148,21 +17181,15 @@ SDValue SITargetLowering::performSetCCCombine(SDNode *N,
       const uint64_t Mask32 = maskTrailingOnes<uint64_t>(32);
       const uint64_t CRHSInt = CRHSVal.getZExtValue();
 
-      ISD::CondCode NewCC = ISD::SETCC_INVALID;
-
-      if ((CRHSInt & Mask32) == 0 && (CC == ISD::SETULT || CC == ISD::SETUGE ||
-                                      CC == ISD::SETLT || CC == ISD::SETGE)) {
-        NewCC = CC;
-      } else if ((CRHSInt & Mask32) == Mask32 &&
-                 (CC == ISD::SETULE || CC == ISD::SETUGT || CC == ISD::SETLE ||
-                  CC == ISD::SETGT)) {
-        NewCC = CC;
-      }
-
-      if (NewCC != ISD::SETCC_INVALID)
+      if (/* setcc v.64, 0xXXXX'XXXX'0000'0000, lt/ge */
----------------
jayfoad wrote:

Use // comments please

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


More information about the llvm-commits mailing list