[llvm] [SCEV] Try to push op into ZExt: C * zext (A + B) -> zext (A*C + B*C) (PR #155300)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 01:27:45 PDT 2025
================
@@ -1818,7 +1818,7 @@ const SCEV *ScalarEvolution::getZeroExtendExprImpl(const SCEV *Op, Type *Ty,
if (auto *SM = dyn_cast<SCEVMulExpr>(Op)) {
// zext((A * B * ...)<nuw>) --> (zext(A) * zext(B) * ...)<nuw>
- if (SM->hasNoUnsignedWrap()) {
+ if (SM->hasNoUnsignedWrap() /*|| getUnsignedRange(SM->getOperand(0)).unsignedMulMayOverflow(getUnsignedRange()) ==ConstantRange::OverflowResult::NeverOverflows*/) {
----------------
nikic wrote:
Leftover?
https://github.com/llvm/llvm-project/pull/155300
More information about the llvm-commits
mailing list