aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-05-04 19:50:11 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-05-04 19:50:11 +0000
commitdc1f0687ea2f19edf1bbf59b265953eb09f504dc (patch)
tree19caf081f3d218dbb62fc4dbfcc0cb715c618834
parent034f3f6a572b645f40f020a330197b9a5489c87e (diff)
downloadllvm-dc1f0687ea2f19edf1bbf59b265953eb09f504dc.zip
llvm-dc1f0687ea2f19edf1bbf59b265953eb09f504dc.tar.gz
llvm-dc1f0687ea2f19edf1bbf59b265953eb09f504dc.tar.bz2
Merging r235524:
------------------------------------------------------------------------ r235524 | Matthew.Arsenault | 2015-04-22 13:10:44 -0400 (Wed, 22 Apr 2015) | 4 lines R600: Fix always inline pass breaking noinline functions No test since calls are not actually supported yet. ------------------------------------------------------------------------ llvm-svn: 236448
-rw-r--r--llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp5
-rw-r--r--llvm/test/CodeGen/R600/call.ll19
2 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp b/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
index b545b45..0b426bc 100644
--- a/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
+++ b/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
@@ -40,7 +40,8 @@ bool AMDGPUAlwaysInline::runOnModule(Module &M) {
std::vector<Function*> FuncsToClone;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
Function &F = *I;
- if (!F.hasLocalLinkage() && !F.isDeclaration() && !F.use_empty())
+ if (!F.hasLocalLinkage() && !F.isDeclaration() && !F.use_empty() &&
+ !F.hasFnAttribute(Attribute::NoInline))
FuncsToClone.push_back(&F);
}
@@ -54,7 +55,7 @@ bool AMDGPUAlwaysInline::runOnModule(Module &M) {
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
Function &F = *I;
- if (F.hasLocalLinkage()) {
+ if (F.hasLocalLinkage() && !F.hasFnAttribute(Attribute::NoInline)) {
F.addFnAttr(Attribute::AlwaysInline);
}
}
diff --git a/llvm/test/CodeGen/R600/call.ll b/llvm/test/CodeGen/R600/call.ll
index 6de51f1..9a0eb1c 100644
--- a/llvm/test/CodeGen/R600/call.ll
+++ b/llvm/test/CodeGen/R600/call.ll
@@ -7,28 +7,27 @@
declare i32 @external_function(i32) nounwind
-define i32 @defined_function(i32 %x) nounwind noinline {
- %y = add i32 %x, 8
- ret i32 %y
-}
-
-define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
+define void @test_call_external(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
%b_ptr = getelementptr i32 addrspace(1)* %in, i32 1
%a = load i32 addrspace(1)* %in
%b = load i32 addrspace(1)* %b_ptr
- %c = call i32 @defined_function(i32 %b) nounwind
+ %c = call i32 @external_function(i32 %b) nounwind
%result = add i32 %a, %c
store i32 %result, i32 addrspace(1)* %out
ret void
}
-define void @test_call_external(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
+define i32 @defined_function(i32 %x) nounwind noinline {
+ %y = add i32 %x, 8
+ ret i32 %y
+}
+
+define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
%b_ptr = getelementptr i32 addrspace(1)* %in, i32 1
%a = load i32 addrspace(1)* %in
%b = load i32 addrspace(1)* %b_ptr
- %c = call i32 @external_function(i32 %b) nounwind
+ %c = call i32 @defined_function(i32 %b) nounwind
%result = add i32 %a, %c
store i32 %result, i32 addrspace(1)* %out
ret void
}
-