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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 01:48:27 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)
----------------
david-arm wrote:

It's not obvious to me why this is NFC. Even if it's not possible to get here with aggregate types currently it still feels wrong to mark it as NFC since technically this function now permits aggregates. Can you document the reasoning behind this change in the commit message. Not sure what @fhahn thinks, but I'd prefer removing NFC from the title too. Assuming this change is safe, it would be good to add an assert here that the pointer type is not an aggregate type.

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


More information about the llvm-commits mailing list