Skip to content

Commit fd8275e

Browse files
author
Quentin Colombet
committed
[GlobalISel] Add missing pass dependencies for IRTranslator
The IRTranslator depends on the branch probability info pass when the optimization level is different than None and it depends all the time on the StackProtector pass. We have to explicitly call out pass dependencies otherwise the pass manager may not be able to schedule the IRTranslator. Before this patch, we were lucky because previous passes depend on the branch probability info pass (like the Global Variable Optimization) and the stack protector pass is initialized in initializeCodeGen. However, if the target has a custom pipeline without any passes like Global Variable Optimization, the pipeline creation will fail, at least because of the branch probability info pass dependency (it is unlikely that initializeCodeGen is not called). This patch adds the missing dependencies to the IRTranslator. Differential Revision: https://reviews.llvm.org/D89063
1 parent f60686f commit fd8275e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ INITIALIZE_PASS_BEGIN(IRTranslator, DEBUG_TYPE, "IRTranslator LLVM IR -> MI",
9595
false, false)
9696
INITIALIZE_PASS_DEPENDENCY(TargetPassConfig)
9797
INITIALIZE_PASS_DEPENDENCY(GISelCSEAnalysisWrapperPass)
98+
INITIALIZE_PASS_DEPENDENCY(BlockFrequencyInfoWrapperPass)
99+
INITIALIZE_PASS_DEPENDENCY(StackProtector)
98100
INITIALIZE_PASS_END(IRTranslator, DEBUG_TYPE, "IRTranslator LLVM IR -> MI",
99101
false, false)
100102

0 commit comments

Comments
 (0)