[llvm] LAA: drop unnecessary args, clarifying APIs (PR #127479)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 04:26:42 PST 2025


================
@@ -793,14 +793,15 @@ class AccessAnalysis {
 
 } // end anonymous namespace
 
-/// Try to compute the stride for \p AR. Used by getPtrStride.
+/// Try to compute a constant stride for \p AR. Used by getPtrStride and
+/// isNoWrap.
 static std::optional<int64_t>
 getStrideFromAddRec(const SCEVAddRecExpr *AR, const Loop *Lp, Type *AccessTy,
-                    Value *Ptr, PredicatedScalarEvolution &PSE) {
+                    PredicatedScalarEvolution &PSE) {
   // The access function must stride over the innermost loop.
   if (Lp != AR->getLoop()) {
     LLVM_DEBUG(dbgs() << "LAA: Bad stride - Not striding over innermost loop "
-                      << *Ptr << " SCEV: " << *AR << "\n");
+                      << "SCEV: " << *AR << "\n");
----------------
fhahn wrote:

I think we should retain the debug output, there are other places that use `getPtrStride`, where having the IR value printed can be helpful, even though we may end up only passing it for debug messages.

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


More information about the llvm-commits mailing list