[llvm] [LAA] Keep pointer checks on partial analysis (PR #139719)

John Brawn via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 09:34:53 PDT 2025


================
@@ -2978,12 +2988,15 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const {
   PSE->print(OS, Depth);
 }
 
-const LoopAccessInfo &LoopAccessInfoManager::getInfo(Loop &L) {
+const LoopAccessInfo &LoopAccessInfoManager::getInfo(Loop &L,
+                                                     bool AllowPartial) {
   const auto &[It, Inserted] = LoopAccessInfoMap.try_emplace(&L);
 
-  if (Inserted)
-    It->second =
-        std::make_unique<LoopAccessInfo>(&L, &SE, TTI, TLI, &AA, &DT, &LI);
+  // We need to create the LoopAccessInfo if either we don't already have one,
+  // or if it was created with a different value of AllowPartial.
----------------
john-brawn-arm wrote:

Yes, though potentially there could be some transform pass added in the future that uses LoopAccessAnalysis without setting AllowPartial but which behaves differently when there's existing results results with it set.

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


More information about the llvm-commits mailing list