summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-04-04 23:44:46 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-04-04 23:44:46 +0000
commit7b0d947404cf4e5faba84de0a2e29da5127a3a83 (patch)
tree69c13c7ae5afbd981062f1323fa24bc1200263ad /llvm/lib/CodeGen/TargetPassConfig.cpp
parente33bc31df448c21ad0728b9aec46f9355acc9926 (diff)
downloadbcm5719-llvm-7b0d947404cf4e5faba84de0a2e29da5127a3a83.tar.gz
bcm5719-llvm-7b0d947404cf4e5faba84de0a2e29da5127a3a83.zip
Allow targets to opt-in to codegen in SCC order
Decouple this setting from EnableIRPA. To support function calls on AMDGPU, it is necessary to report the global register usage throughout the kernel's call graph, so callees need to be handled first. llvm-svn: 299487
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 09ca1de21a8..150195f5f85 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -264,7 +264,8 @@ TargetPassConfig::~TargetPassConfig() {
TargetPassConfig::TargetPassConfig(TargetMachine *tm, PassManagerBase &pm)
: ImmutablePass(ID), PM(&pm), Started(true), Stopped(false),
AddingMachinePasses(false), TM(tm), Impl(nullptr), Initialized(false),
- DisableVerify(false), EnableTailMerge(true) {
+ DisableVerify(false), EnableTailMerge(true),
+ RequireCodeGenSCCOrder(false) {
Impl = new PassConfigImpl();
@@ -282,6 +283,9 @@ TargetPassConfig::TargetPassConfig(TargetMachine *tm, PassManagerBase &pm)
if (StringRef(PrintMachineInstrs.getValue()).equals(""))
TM->Options.PrintMachineCode = true;
+
+ if (TM->Options.EnableIPRA)
+ setRequiresCodeGenSCCOrder();
}
CodeGenOpt::Level TargetPassConfig::getOptLevel() const {
@@ -534,7 +538,7 @@ void TargetPassConfig::addISelPrepare() {
addPreISel();
// Force codegen to run according to the callgraph.
- if (TM->Options.EnableIPRA)
+ if (requiresCodeGenSCCOrder())
addPass(new DummyCGSCCPass);
// Add both the safe stack and the stack protection passes: each of them will
OpenPOWER on IntegriCloud