[llvm] [GVN] MemorySSA for GVN: add optional `AllowMemorySSA` (PR #120982)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 03:58:35 PST 2025


================
@@ -832,7 +838,10 @@ PreservedAnalyses GVNPass::run(Function &F, FunctionAnalysisManager &AM) {
   auto *MemDep =
       isMemDepEnabled() ? &AM.getResult<MemoryDependenceAnalysis>(F) : nullptr;
   auto &LI = AM.getResult<LoopAnalysis>(F);
-  auto *MSSA = AM.getCachedResult<MemorySSAAnalysis>(F);
+  auto *MSSA =
+      isMemorySSAEnabled() ? &AM.getResult<MemorySSAAnalysis>(F) : nullptr;
----------------
nikic wrote:

The change here means that we no longer try to update and preserve an already computed MSSA instance. I've reverted this patch for now.

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


More information about the llvm-commits mailing list