[llvm-commits] [llvm] r72734 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/abi-isel.ll test/CodeGen/X86/ga-offset.ll test/CodeGen/X86/x86-store-gv-addr.ll
Evan Cheng
evan.cheng at apple.com
Tue Jun 2 13:09:32 PDT 2009
Author: evancheng
Date: Tue Jun 2 15:09:31 2009
New Revision: 72734
URL: http://llvm.org/viewvc/llvm-project?rev=72734&view=rev
Log:
On Darwin x86_64 small code model doesn't guarantee code address fits in 32-bit.
Added:
llvm/trunk/test/CodeGen/X86/x86-store-gv-addr.ll
Modified:
llvm/trunk/lib/Target/X86/X86Instr64bit.td
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/test/CodeGen/X86/abi-isel.ll
llvm/trunk/test/CodeGen/X86/ga-offset.ll
Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=72734&r1=72733&r2=72734&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original)
+++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Jun 2 15:09:31 2009
@@ -1399,16 +1399,16 @@
def : Pat<(store (i64 (X86Wrapper tconstpool:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tconstpool:$src)>,
- Requires<[SmallCode, IsStatic]>;
+ Requires<[SmallCode, IsStatic, IsNotDarwin]>;
def : Pat<(store (i64 (X86Wrapper tjumptable:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tjumptable:$src)>,
- Requires<[SmallCode, IsStatic]>;
+ Requires<[SmallCode, IsStatic, IsNotDarwin]>;
def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tglobaladdr:$src)>,
- Requires<[SmallCode, IsStatic]>;
+ Requires<[SmallCode, IsStatic, IsNotDarwin]>;
def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst),
(MOV64mi32 addr:$dst, texternalsym:$src)>,
- Requires<[SmallCode, IsStatic]>;
+ Requires<[SmallCode, IsStatic, IsNotDarwin]>;
// Calls
// Direct PC relative function call for small code model. 32-bit displacement
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=72734&r1=72733&r2=72734&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Jun 2 15:09:31 2009
@@ -237,6 +237,7 @@
def OptForSpeed : Predicate<"!OptForSize">;
def FastBTMem : Predicate<"!Subtarget->isBTMemSlow()">;
def CallImmAddr : Predicate<"Subtarget->IsLegalToCallImmediateAddr(TM)">;
+def IsNotDarwin : Predicate<"!Subtarget->isTargetDarwin()">;
//===----------------------------------------------------------------------===//
// X86 Instruction Format Definitions.
Modified: llvm/trunk/test/CodeGen/X86/abi-isel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/abi-isel.ll?rev=72734&r1=72733&r2=72734&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/abi-isel.ll (original)
+++ llvm/trunk/test/CodeGen/X86/abi-isel.ll Tue Jun 2 15:09:31 2009
@@ -146,7 +146,7 @@
; RUN: grep movl %t | count 91
; RUN: not grep addl %t
; RUN: not grep subl %t
-; RUN: grep leaq %t | count 70
+; RUN: grep leaq %t | count 81
; RUN: grep movq %t | count 56
; RUN: grep addq %t | count 20
; RUN: grep subq %t | count 14
@@ -160,7 +160,7 @@
; RUN: not grep @PLT %t
; RUN: not grep @PLTOFF %t
; RUN: grep {call \\\*} %t | count 10
-; RUN: grep {%rip} %t | count 139
+; RUN: grep {%rip} %t | count 150
; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=dynamic-no-pic -code-model=small > %t
; RUN: not grep leal %t
; RUN: grep movl %t | count 95
Modified: llvm/trunk/test/CodeGen/X86/ga-offset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ga-offset.ll?rev=72734&r1=72733&r2=72734&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/ga-offset.ll (original)
+++ llvm/trunk/test/CodeGen/X86/ga-offset.ll Tue Jun 2 15:09:31 2009
@@ -2,7 +2,7 @@
; RUN: not grep lea %t
; RUN: not grep add %t
; RUN: grep mov %t | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static > %t
+; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=static > %t
; RUN: not grep lea %t
; RUN: not grep add %t
; RUN: grep mov %t | count 1
Added: llvm/trunk/test/CodeGen/X86/x86-store-gv-addr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-store-gv-addr.ll?rev=72734&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/x86-store-gv-addr.ll (added)
+++ llvm/trunk/test/CodeGen/X86/x86-store-gv-addr.ll Tue Jun 2 15:09:31 2009
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep lea
+; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux-gnu -relocation-model=static | not grep lea
+
+ at v = external global i32, align 8
+ at v_addr = external global i32*, align 8
+
+define void @t() nounwind optsize {
+ store i32* @v, i32** @v_addr, align 8
+ unreachable
+}
More information about the llvm-commits
mailing list