diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -2432,7 +2432,9 @@ DebugLogging)) return Err; // Add the nested pass manager with the appropriate adaptor. - bool UseMemorySSA = (Name == "loop-mssa"); + // Check EnableMSSALoopDependency as well for compatibility with legacy PM + // tests. + bool UseMemorySSA = (Name == "loop-mssa") || EnableMSSALoopDependency; bool UseBFI = std::any_of(InnerPipeline.begin(), InnerPipeline.end(), [](auto Pipeline) { return Pipeline.Name == "licm"; }); @@ -2491,8 +2493,8 @@ // The risk is that it may become obsolete if we're not careful. #define LOOP_PASS(NAME, CREATE_PASS) \ if (Name == NAME) { \ - FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false, false, \ - DebugLogging)); \ + FPM.addPass(createFunctionToLoopPassAdaptor( \ + CREATE_PASS, EnableMSSALoopDependency, false, DebugLogging)); \ return Error::success(); \ } #define LOOP_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER) \ diff --git a/llvm/test/Analysis/BasicAA/store-promote.ll b/llvm/test/Analysis/BasicAA/store-promote.ll --- a/llvm/test/Analysis/BasicAA/store-promote.ll +++ b/llvm/test/Analysis/BasicAA/store-promote.ll @@ -3,7 +3,8 @@ ; two pointers, then the load should be hoisted, and the store sunk. ; RUN: opt < %s -basic-aa -licm -enable-mssa-loop-dependency=false -S | FileCheck %s -check-prefixes=CHECK,AST -; RUN: opt < %s -basic-aa -licm -enable-mssa-loop-dependency=true -S | FileCheck %s -check-prefixes=CHECK,MSSA +; RUN: opt < %s -basic-aa -licm -enable-mssa-loop-dependency=true -enable-new-pm=0 -S | FileCheck %s -check-prefixes=CHECK,MSSA +; RUN: opt < %s -basic-aa -licm -enable-mssa-loop-dependency=true -enable-new-pm=1 -S | FileCheck %s -check-prefixes=CHECK,MSSA target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @A = global i32 7 ; [#uses=3]