[PATCH] D146958: [SCEV] Do not plant SCEV checks unnecessarily

Paul Osmialowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 07:07:58 PDT 2023


pawosm01 marked an inline comment as done.
pawosm01 added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:2566
+  // sense to add it here.
+  if (TheLoop->isLoopInvariant(Ptr))
+    return;
----------------
fhahn wrote:
> Better use a more powerful SCEV based check that the AddRec for the ptr is for `TheLoop` ( check `TheLoop  != AR->getLoop()` in `getStrideFromPointer`)
> 
Indeed it worked. And the other test case that you'd suggested is also passing too.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146958/new/

https://reviews.llvm.org/D146958



More information about the llvm-commits mailing list