[llvm] [X86] ICMP EQ/NE MIN_SIGNED_INT - avoid immediate argument by using NEG + SETO/SETNO (PR #94948)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 07:30:49 PDT 2024
================
@@ -23816,6 +23816,20 @@ SDValue X86TargetLowering::emitFlagsForSetcc(SDValue Op0, SDValue Op1,
}
}
+ // Look for X == INT_MIN or X != INT_MIN. We can use NEG and test for
+ // overflow.
+ if (isMinSignedConstant(Op1)) {
+ EVT VT = Op0.getValueType();
+ if ((VT == MVT::i32 || VT == MVT::i64) || Op0->hasOneUse()) {
----------------
phoebewang wrote:
The parentheses of `(VT == MVT::i32 || VT == MVT::i64)` isn't necessary.
https://github.com/llvm/llvm-project/pull/94948
More information about the llvm-commits
mailing list