[llvm] [X86] checkSignTestSetCCCombine - remove early return in CMP(X,0) case (PR #178710)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 30 04:10:59 PST 2026
================
@@ -48975,12 +48975,15 @@ static SDValue checkSignTestSetCCCombine(SDValue Cmp, X86::CondCode &CC,
if (!isNullConstant(Cmp.getOperand(1)))
return SDValue();
Src = Cmp.getOperand(0);
- // Peek through a SRA node as we just need the signbit.
// TODO: Remove one use limit once sdiv-fix regressions are fixed.
- // TODO: Use SimplifyDemandedBits instead of just SRA?
- if (Src.getOpcode() != ISD::SRA || !Src.hasOneUse())
+ if (!Src.hasOneUse())
+ return SDValue();
+ // Peek through a SRA node as we just need the signbit.
+ // TODO: Use SimplifyMultipleUseDemandedBits instead of just SRA?
+ if (Src.getOpcode() == ISD::SRA)
+ Src = Src.getOperand(0);
+ else if (Src.getOpcode() != ISD::SHL && Src.getOpcode() != ISD::SIGN_EXTEND_INREG)
----------------
RKSimon wrote:
clang-format
https://github.com/llvm/llvm-project/pull/178710
More information about the llvm-commits
mailing list