aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorSnehasish Kumar <snehasishk@google.com>2021-02-09 19:14:47 -0800
committerSnehasish Kumar <snehasishk@google.com>2021-02-11 11:14:10 -0800
commitd079dbc591899159925a1fe10b081fa0f6bb61bd (patch)
treefe5af3426347aecb5e37ed4528dd94552b69de0a /llvm/lib/CodeGen/TargetPassConfig.cpp
parent4dc87d1010351170d73ebd23869751fe1bd6ac26 (diff)
downloadllvm-d079dbc591899159925a1fe10b081fa0f6bb61bd.zip
llvm-d079dbc591899159925a1fe10b081fa0f6bb61bd.tar.gz
llvm-d079dbc591899159925a1fe10b081fa0f6bb61bd.tar.bz2
[CodeGen] Basic block sections should take precendence over splitting.
The use of basic block sections should take precedence over the machine function splitting pass. Since they use the same underlying mechanism they are kept exclusive. Updated the tests to check that split machine functions is overridden by all flavours of basic block sections. Differential Revision: https://reviews.llvm.org/D96392
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index e844d03..30b58e6 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -1187,12 +1187,14 @@ void TargetPassConfig::addMachinePasses() {
}
// Machine function splitter uses the basic block sections feature. Both
- // cannot be enabled at the same time.
- if (TM->Options.EnableMachineFunctionSplitter ||
- EnableMachineFunctionSplitter) {
- addPass(createMachineFunctionSplitterPass());
- } else if (TM->getBBSectionsType() != llvm::BasicBlockSection::None) {
+ // cannot be enabled at the same time. Basic block sections takes precedence.
+ // FIXME: In principle, BasicBlockSection::Labels and splitting can used
+ // together. Update this check once we have addressed any issues.
+ if (TM->getBBSectionsType() != llvm::BasicBlockSection::None) {
addPass(llvm::createBasicBlockSectionsPass(TM->getBBSectionsFuncListBuf()));
+ } else if (TM->Options.EnableMachineFunctionSplitter ||
+ EnableMachineFunctionSplitter) {
+ addPass(createMachineFunctionSplitterPass());
}
// Add passes that directly emit MI after all other MI passes.