[llvm] [VPlan] Recognize lshr in getSCEVExprForVPValue. (PR #203496)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 14 20:43:51 PDT 2026
================
@@ -228,6 +228,14 @@ const SCEV *vputils::getSCEVExprForVPValue(const VPValue *V,
return SE.getMulExpr(Ops[0],
SE.getPowerOfTwo(Ops[0]->getType(), ShiftAmt));
});
+ if (match(V, m_LShr(m_VPValue(LHSVal), m_ConstantInt(ShiftAmt)))) {
+ Type *Ty = V->getScalarType();
+ if (ShiftAmt < SE.getTypeSizeInBits(Ty))
----------------
lukel97 wrote:
Just checking, the ShiftAmt < type size check isn't needed for correctness because the result will be poison, but just to prevent hitting the `assert(Power < getTypeSizeInBits(Ty) && "Power out of range");` assert in `getPowerOfTwo`? We don't have the same check in the m_Shl pattern above
https://github.com/llvm/llvm-project/pull/203496
More information about the llvm-commits
mailing list