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

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 08:13:04 PST 2025


================
@@ -832,7 +838,8 @@ 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;
----------------
antoniofrighetto wrote:

Added, thanks!

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


More information about the llvm-commits mailing list