summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-03-28 18:23:24 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-03-28 18:23:24 +0000
commit9053f22eeb3ab0f1f0089e4e6b98093891d361bb (patch)
tree11c61ba61147e3ae0804a088d1dd27f88b7ef980 /llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
parent486369fc1ada0559dbcd751a53d49c6e929b43e7 (diff)
downloadbcm5719-llvm-9053f22eeb3ab0f1f0089e4e6b98093891d361bb.tar.gz
bcm5719-llvm-9053f22eeb3ab0f1f0089e4e6b98093891d361bb.zip
[AMDGPU] Split -amdgpu-early-inline-all option
Previously it was covered by the internalization. It turns out we cannot run internalizer in FE, it break separate compilation tests. Thus early inliner gets its own option. Differential Revision: https://reviews.llvm.org/D31429 llvm-svn: 298935
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index e8954c59479..c5302f7942f 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -95,6 +95,13 @@ static cl::opt<bool> InternalizeSymbols(
cl::init(false),
cl::Hidden);
+// Option to inline all early.
+static cl::opt<bool> EarlyInlineAll(
+ "amdgpu-early-inline-all",
+ cl::desc("Inline all functions early"),
+ cl::init(false),
+ cl::Hidden);
+
static cl::opt<bool> EnableSDWAPeephole(
"amdgpu-sdwa-peephole",
cl::desc("Enable SDWA peepholer"),
@@ -273,12 +280,14 @@ void AMDGPUTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
bool Internalize = InternalizeSymbols &&
(getOptLevel() > CodeGenOpt::None) &&
(getTargetTriple().getArch() == Triple::amdgcn);
+ bool EarlyInline = EarlyInlineAll &&
+ (getOptLevel() > CodeGenOpt::None);
bool AMDGPUAA = EnableAMDGPUAliasAnalysis && getOptLevel() > CodeGenOpt::None;
Builder.addExtension(
PassManagerBuilder::EP_ModuleOptimizerEarly,
- [Internalize, AMDGPUAA](const PassManagerBuilder &,
- legacy::PassManagerBase &PM) {
+ [Internalize, EarlyInline, AMDGPUAA](const PassManagerBuilder &,
+ legacy::PassManagerBase &PM) {
if (AMDGPUAA) {
PM.add(createAMDGPUAAWrapperPass());
PM.add(createAMDGPUExternalAAWrapperPass());
@@ -304,8 +313,9 @@ void AMDGPUTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
return !GV.use_empty();
}));
PM.add(createGlobalDCEPass());
- PM.add(createAMDGPUAlwaysInlinePass());
}
+ if (EarlyInline)
+ PM.add(createAMDGPUAlwaysInlinePass());
});
Builder.addExtension(
OpenPOWER on IntegriCloud