[llvm] [InstCombine] Fold converted urem to 0 if there's no overlapping bits (PR #71528)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 7 05:14:55 PST 2023
================
@@ -2662,6 +2662,16 @@ Instruction *InstCombinerImpl::visitAnd(BinaryOperator &I) {
if (sinkNotIntoOtherHandOfLogicalOp(I))
return &I;
+ // (x << N) & (add (x << M), -1) --> 0, where x is known to be a non-zero
----------------
dtcxzyw wrote:
Please move it into `simplifyAndInst`.
https://github.com/llvm/llvm-project/pull/71528
More information about the llvm-commits
mailing list