From 6ecc2602a6898fb610d958d1f50d356042a8c0d1 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 3 Jun 2009 00:37:20 +0000 Subject: Revert r72734. The Darwin assembler doesn't support the static relocation model on x86-64. Higher level logic should override the relocation model to PIC on x86_64-apple-darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72746 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86Instr64bit.td | 8 ++++---- lib/Target/X86/X86InstrInfo.td | 1 - test/CodeGen/X86/abi-isel.ll | 4 ++-- test/CodeGen/X86/ga-offset.ll | 2 +- test/CodeGen/X86/x86-store-gv-addr.ll | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/Target/X86/X86Instr64bit.td b/lib/Target/X86/X86Instr64bit.td index d4e298e9ca..dc15e4aa4e 100644 --- a/lib/Target/X86/X86Instr64bit.td +++ b/lib/Target/X86/X86Instr64bit.td @@ -1399,16 +1399,16 @@ def : Pat<(i64 (X86Wrapper texternalsym:$dst)), def : Pat<(store (i64 (X86Wrapper tconstpool:$src)), addr:$dst), (MOV64mi32 addr:$dst, tconstpool:$src)>, - Requires<[SmallCode, IsStatic, IsNotDarwin]>; + Requires<[SmallCode, IsStatic]>; def : Pat<(store (i64 (X86Wrapper tjumptable:$src)), addr:$dst), (MOV64mi32 addr:$dst, tjumptable:$src)>, - Requires<[SmallCode, IsStatic, IsNotDarwin]>; + Requires<[SmallCode, IsStatic]>; def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst), (MOV64mi32 addr:$dst, tglobaladdr:$src)>, - Requires<[SmallCode, IsStatic, IsNotDarwin]>; + Requires<[SmallCode, IsStatic]>; def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst), (MOV64mi32 addr:$dst, texternalsym:$src)>, - Requires<[SmallCode, IsStatic, IsNotDarwin]>; + Requires<[SmallCode, IsStatic]>; // Calls // Direct PC relative function call for small code model. 32-bit displacement diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index c3f82a52f1..50ae417641 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -237,7 +237,6 @@ def IsStatic : Predicate<"TM.getRelocationModel() == Reloc::Static">; def OptForSpeed : Predicate<"!OptForSize">; def FastBTMem : Predicate<"!Subtarget->isBTMemSlow()">; def CallImmAddr : Predicate<"Subtarget->IsLegalToCallImmediateAddr(TM)">; -def IsNotDarwin : Predicate<"!Subtarget->isTargetDarwin()">; //===----------------------------------------------------------------------===// // X86 Instruction Format Definitions. diff --git a/test/CodeGen/X86/abi-isel.ll b/test/CodeGen/X86/abi-isel.ll index 5decbcff92..f1fec3f8b9 100644 --- a/test/CodeGen/X86/abi-isel.ll +++ b/test/CodeGen/X86/abi-isel.ll @@ -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 81 +; RUN: grep leaq %t | count 70 ; 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 150 +; RUN: grep {%rip} %t | count 139 ; 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 diff --git a/test/CodeGen/X86/ga-offset.ll b/test/CodeGen/X86/ga-offset.ll index 40787cb946..cc93b4c2ee 100644 --- a/test/CodeGen/X86/ga-offset.ll +++ b/test/CodeGen/X86/ga-offset.ll @@ -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 -mtriple=x86_64-unknown-linux-gnu -relocation-model=static > %t +; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static > %t ; RUN: not grep lea %t ; RUN: not grep add %t ; RUN: grep mov %t | count 1 diff --git a/test/CodeGen/X86/x86-store-gv-addr.ll b/test/CodeGen/X86/x86-store-gv-addr.ll index 53d6a91e2a..799340d35d 100644 --- a/test/CodeGen/X86/x86-store-gv-addr.ll +++ b/test/CodeGen/X86/x86-store-gv-addr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep lea +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -relocation-model=static | not grep lea ; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux-gnu -relocation-model=static | not grep lea @v = external global i32, align 8 -- cgit v1.2.3