[llvm] LAA: improve code in getStrideFromPointer (NFC) (PR #124780)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 03:26:34 PST 2025


================
@@ -2859,26 +2859,23 @@ static Value *stripGetElementPtr(Value *Ptr, ScalarEvolution *SE, Loop *Lp) {
 /// strides "a[i*stride]". Returns the symbolic stride, or null otherwise.
 static const SCEV *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE, Loop *Lp) {
   auto *PtrTy = dyn_cast<PointerType>(Ptr->getType());
-  if (!PtrTy || PtrTy->isAggregateType())
+  if (!PtrTy)
----------------
fhahn wrote:

I think it definitely should be an assert; I checked on a large test set and it doesn't trigger, but we don't want the code to silently do the wrong thing in the future when new users are added.

https://github.com/llvm/llvm-project/pull/124780


More information about the llvm-commits mailing list