[llvm] [ValueTracking] Suport GEPs in matchSimpleRecurrence. (PR #123518)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 09:40:19 PST 2025
================
@@ -1571,12 +1572,21 @@ static void computeKnownBitsFromOperator(const Operator *I,
// We need to take the minimum number of known bits
KnownBits Known3(BitWidth);
+ if (BitWidth != getBitWidth(L->getType(), Q.DL)) {
+ assert(isa<GetElementPtrInst>(BO) &&
+ "Bitwidth should only be different for GEPs.");
+ break;
+ }
RecQ.CxtI = LInst;
computeKnownBits(L, DemandedElts, Known3, Depth + 1, RecQ);
Known.Zero.setLowBits(std::min(Known2.countMinTrailingZeros(),
Known3.countMinTrailingZeros()));
+ // Don't apply logic below for GEPs.
+ if (isa<GetElementPtrInst>(BO))
+ break;
----------------
goldsteinn wrote:
Is there an inherent reason for this? Or just signbit of GEP isn't what your interested in here?
Also the `OverflowingBinaryOperator` check should be sufficient, don't really see why you need this check here.
https://github.com/llvm/llvm-project/pull/123518
More information about the llvm-commits
mailing list