[PATCH] D31489: [AMDGPU] Add GlobalOpt parameter to Always Inliner pass
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 30 13:28:35 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL299108: [AMDGPU] Add GlobalOpt parameter to Always Inliner pass (authored by rampitec).
Changed prior to commit:
https://reviews.llvm.org/D31489?vs=93446&id=93533#toc
Repository:
rL LLVM
https://reviews.llvm.org/D31489
Files:
llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
llvm/trunk/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
llvm/trunk/test/CodeGen/AMDGPU/early-inline.ll
Index: llvm/trunk/test/CodeGen/AMDGPU/early-inline.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/early-inline.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/early-inline.ll
@@ -1,5 +1,8 @@
; RUN: opt -mtriple=amdgcn-- -O1 -S -inline-threshold=1 -amdgpu-early-inline-all %s | FileCheck %s
+; CHECK: @c_alias
+ at c_alias = alias i32 (i32), i32 (i32)* @callee
+
define i32 @callee(i32 %x) {
entry:
%mul1 = mul i32 %x, %x
Index: llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
@@ -98,7 +98,7 @@
Pass *createAMDGPUStructurizeCFGPass();
FunctionPass *createAMDGPUISelDag(TargetMachine &TM,
CodeGenOpt::Level OptLevel);
-ModulePass *createAMDGPUAlwaysInlinePass();
+ModulePass *createAMDGPUAlwaysInlinePass(bool GlobalOpt = true);
ModulePass *createAMDGPUOpenCLImageTypeLoweringPass();
FunctionPass *createAMDGPUAnnotateUniformValues();
Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
@@ -24,8 +24,10 @@
class AMDGPUAlwaysInline : public ModulePass {
static char ID;
+ bool GlobalOpt;
+
public:
- AMDGPUAlwaysInline() : ModulePass(ID) { }
+ AMDGPUAlwaysInline(bool GlobalOpt) : ModulePass(ID), GlobalOpt(GlobalOpt) { }
bool runOnModule(Module &M) override;
StringRef getPassName() const override { return "AMDGPU Always Inline Pass"; }
};
@@ -45,8 +47,10 @@
}
}
- for (GlobalAlias* A : AliasesToRemove) {
- A->eraseFromParent();
+ if (GlobalOpt) {
+ for (GlobalAlias* A : AliasesToRemove) {
+ A->eraseFromParent();
+ }
}
for (Function &F : M) {
@@ -70,6 +74,6 @@
return false;
}
-ModulePass *llvm::createAMDGPUAlwaysInlinePass() {
- return new AMDGPUAlwaysInline();
+ModulePass *llvm::createAMDGPUAlwaysInlinePass(bool GlobalOpt) {
+ return new AMDGPUAlwaysInline(GlobalOpt);
}
Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -315,7 +315,7 @@
PM.add(createGlobalDCEPass());
}
if (EarlyInline)
- PM.add(createAMDGPUAlwaysInlinePass());
+ PM.add(createAMDGPUAlwaysInlinePass(false));
});
Builder.addExtension(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31489.93533.patch
Type: text/x-patch
Size: 2646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170330/93334413/attachment.bin>
More information about the llvm-commits
mailing list