[llvm] [InstCombine] Prepare to support trunc nuw condition in foldAndOrOfICmps (NFC) (PR #221555)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 11:45:59 PDT 2026
================
@@ -3560,7 +3595,8 @@ Value *InstCombinerImpl::foldAndOrOfICmps(ICmpInst *LHS, ICmpInst *RHS,
// where CMAX is the all ones value for the truncated type,
// iff the lower bits of C2 and CA are zero.
if (PredL == (IsAnd ? ICmpInst::ICMP_EQ : ICmpInst::ICMP_NE) &&
- PredL == PredR && LHS->hasOneUse() && RHS->hasOneUse()) {
+ PredL.dropSameSign() == PredR.dropSameSign() && LHS->hasOneUse() &&
----------------
dtcxzyw wrote:
LHSOneUse && RHSOneUse
https://github.com/llvm/llvm-project/pull/221555
More information about the llvm-commits
mailing list