[llvm] [InstCombine] Handle trunc i1 pattern in eq-of-parts fold (PR #112704)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 18:53:51 PDT 2024
================
@@ -3538,6 +3546,9 @@ Value *InstCombinerImpl::foldBooleanAndOr(Value *LHS, Value *RHS,
if (Value *Res = foldLogicOfFCmps(LHSCmp, RHSCmp, IsAnd, IsLogical))
return Res;
+ if (Value *Res = foldEqOfParts(LHS, RHS, IsAnd))
----------------
dtcxzyw wrote:
Agree that we shouldn't maintain an ordering of folds. But it is ok to move folds between these early exit points.
Currently we place the fold after this early exit point, causing `trunc(lshr Y, Shift)` pattern on RHS of icmp cannot be captured by `matchIntPart`.
https://github.com/llvm/llvm-project/pull/112704
More information about the llvm-commits
mailing list