Skip to content

Commit fdc9e6d

Browse files
committed
[AMDGPU] honor enable-new-pm and run-pass while enabling NPM for llc
1 parent eb7b0f6 commit fdc9e6d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

llvm/tools/llc/llc.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,15 @@ static int compileModule(char **argv, LLVMContext &Context) {
655655
else if (VerifyEach)
656656
VK = VerifierKind::EachPass;
657657

658-
if (EnableNewPassManager || !PassPipeline.empty() ||
659-
Target->EnableNewPMForBackend()) {
658+
bool RunNewPM = false;
659+
if (EnableNewPassManager || !PassPipeline.empty())
660+
RunNewPM = true;
661+
else if (RunPass.getNumOccurrences())
662+
RunNewPM = false;
663+
else if (Target->EnableNewPMForBackend() && !EnableNewPassManager.getNumOccurrences())
664+
RunNewPM = true;
665+
666+
if (RunNewPM) {
660667
return compileModuleWithNewPM(argv[0], std::move(M), std::move(MIR),
661668
std::move(Target), std::move(Out),
662669
std::move(DwoOut), Context, TLII, VK,

0 commit comments

Comments
 (0)