[llvm-branch-commits] [llvm-branch] r236448 - Merging r235524:

Tom Stellard thomas.stellard at amd.com
Mon May 4 12:50:11 PDT 2015


Author: tstellar
Date: Mon May  4 14:50:11 2015
New Revision: 236448

URL: http://llvm.org/viewvc/llvm-project?rev=236448&view=rev
Log:
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.

------------------------------------------------------------------------

Modified:
    llvm/branches/release_36/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
    llvm/branches/release_36/test/CodeGen/R600/call.ll

Modified: llvm/branches/release_36/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp?rev=236448&r1=236447&r2=236448&view=diff
==============================================================================
--- llvm/branches/release_36/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp (original)
+++ llvm/branches/release_36/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp Mon May  4 14:50:11 2015
@@ -40,7 +40,8 @@ bool AMDGPUAlwaysInline::runOnModule(Mod
   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(Mod
 
   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);
     }
   }

Modified: llvm/branches/release_36/test/CodeGen/R600/call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/test/CodeGen/R600/call.ll?rev=236448&r1=236447&r2=236448&view=diff
==============================================================================
--- llvm/branches/release_36/test/CodeGen/R600/call.ll (original)
+++ llvm/branches/release_36/test/CodeGen/R600/call.ll Mon May  4 14:50:11 2015
@@ -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
 }
-





More information about the llvm-branch-commits mailing list