[llvm] [X86] Try to shrink signed i64 compares if the input has enough one bits (PR #149719)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 26 22:02:32 PDT 2025


================
@@ -23489,6 +23508,16 @@ static SDValue EmitCmp(SDValue Op0, SDValue Op1, X86::CondCode X86CC,
     Op1 = DAG.getNode(ISD::TRUNCATE, dl, CmpVT, Op1);
   }
 
+  // Try to shrink signed i64 compares if the inputs are representable as signed
+  // i32.
+  if (CmpVT == MVT::i64 && !isX86CCUnsigned(X86CC) &&
----------------
topperc wrote:

This might work for unsigned comparisons too.

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


More information about the llvm-commits mailing list