Skip to content

Commit 501a1cf

Browse files
Use isPassSubstitutedOrOverridden to check if the pass was disabled
Signed-off-by: Mikhail R. Gadelha <[email protected]>
1 parent 756e1a5 commit 501a1cf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/CodeGen/TargetPassConfig.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,6 @@ void TargetPassConfig::addPass(Pass *P) {
707707
// and shouldn't reference it.
708708
AnalysisID PassID = P->getPassID();
709709

710-
IdentifyingPassPtr TargetID = getPassSubstitution(PassID);
711-
if (!overridePass(PassID, TargetID).isValid())
712-
return;
713-
714710
if (StartBefore == PassID && StartBeforeCount++ == StartBeforeInstanceNum)
715711
Started = true;
716712
if (StopBefore == PassID && StopBeforeCount++ == StopBeforeInstanceNum)
@@ -1518,8 +1514,9 @@ void TargetPassConfig::addMachineLateOptimization() {
15181514
addPass(&MachineLateInstrsCleanupID);
15191515

15201516
// Branch folding must be run after regalloc and prolog/epilog insertion.
1521-
addPass(createBranchFolderPass(!TM->requiresStructuredCFG() &&
1522-
getEnableTailMerge()));
1517+
if(!isPassSubstitutedOrOverridden(&BranchFolderPassID))
1518+
addPass(createBranchFolderPass(!TM->requiresStructuredCFG() &&
1519+
getEnableTailMerge()));
15231520

15241521
// Tail duplication.
15251522
// Note that duplicating tail just increases code size and degrades

0 commit comments

Comments
 (0)