[llvm-branch-commits] [llvm-branch] r126414 - in /llvm/branches/Apple/palisade: lib/Target/ARM/ARMSubtarget.cpp test/CodeGen/ARM/available_externally.ll

Daniel Dunbar daniel at zuster.org
Thu Feb 24 12:02:19 PST 2011


Author: ddunbar
Date: Thu Feb 24 14:02:19 2011
New Revision: 126414

URL: http://llvm.org/viewvc/llvm-project?rev=126414&view=rev
Log:
Merge r126191:
--
Author: Evan Cheng <evan.cheng at apple.com>
Date:   Tue Feb 22 06:58:34 2011 +0000

    available_externally (hidden or not) GVs are always accessed via stubs. rdar://9027648.

Added:
    llvm/branches/Apple/palisade/test/CodeGen/ARM/available_externally.ll
Modified:
    llvm/branches/Apple/palisade/lib/Target/ARM/ARMSubtarget.cpp

Modified: llvm/branches/Apple/palisade/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/lib/Target/ARM/ARMSubtarget.cpp?rev=126414&r1=126413&r2=126414&view=diff
==============================================================================
--- llvm/branches/Apple/palisade/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/branches/Apple/palisade/lib/Target/ARM/ARMSubtarget.cpp Thu Feb 24 14:02:19 2011
@@ -171,7 +171,9 @@
 
   // Materializable GVs (in JIT lazy compilation mode) do not require an extra
   // load from stub.
-  bool isDecl = GV->isDeclaration() && !GV->isMaterializable();
+  bool isDecl = GV->hasAvailableExternallyLinkage();
+  if (GV->isDeclaration() && !GV->isMaterializable())
+    isDecl = true;
 
   if (!isTargetDarwin()) {
     // Extra load is needed for all externally visible.

Added: llvm/branches/Apple/palisade/test/CodeGen/ARM/available_externally.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/test/CodeGen/ARM/available_externally.ll?rev=126414&view=auto
==============================================================================
--- llvm/branches/Apple/palisade/test/CodeGen/ARM/available_externally.ll (added)
+++ llvm/branches/Apple/palisade/test/CodeGen/ARM/available_externally.ll Thu Feb 24 14:02:19 2011
@@ -0,0 +1,16 @@
+; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic | FileCheck %s
+; rdar://9027648
+
+ at A = available_externally hidden constant i32 1
+ at B = external hidden constant i32
+
+define i32 @t1() {
+  %tmp = load i32* @A
+  store i32 %tmp, i32* @B
+  ret i32 %tmp
+}
+
+; CHECK:      L_A$non_lazy_ptr:
+; CHECK-NEXT: .long _A
+; CHECK:      L_B$non_lazy_ptr:
+; CHECK-NEXT: .long _B





More information about the llvm-branch-commits mailing list