diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-05-20 04:53:57 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-05-20 04:53:57 +0000 |
commit | 960983371cd6590fc9e507331e08cd64d49a1618 (patch) | |
tree | 5fad879be40c08bd5aaf4cc74078edb36fe6fd03 /llvm/lib/Target/X86/X86Subtarget.cpp | |
parent | c21cb44de28cde3eae6797e6ba0d35016d6d92fe (diff) | |
download | bcm5719-llvm-960983371cd6590fc9e507331e08cd64d49a1618.tar.gz bcm5719-llvm-960983371cd6590fc9e507331e08cd64d49a1618.zip |
Try again. Allow call to immediate address for ELF or when in static relocation mode.
llvm-svn: 72160
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index df1f7db85fc..d54ccb37e3b 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/lib/Target/X86/X86Subtarget.cpp @@ -74,8 +74,8 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV, /// cases where GVRequiresExtraLoad is true. Some variations of PIC require /// a register, but not an extra load. bool X86Subtarget::GVRequiresRegister(const GlobalValue *GV, - const TargetMachine& TM, - bool isDirectCall) const + const TargetMachine& TM, + bool isDirectCall) const { if (GVRequiresExtraLoad(GV, TM, isDirectCall)) return true; @@ -99,6 +99,14 @@ const char *X86Subtarget::getBZeroEntry() const { return 0; } +/// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls +/// to immediate address. +bool X86Subtarget::IsLegalToCallImmediateAddr(const TargetMachine &TM) const { + if (Is64Bit) + return false; + return isTargetELF() || TM.getRelocationModel() == Reloc::Static; +} + /// getSpecialAddressLatency - For targets where it is beneficial to /// backschedule instructions that compute addresses, return a value /// indicating the number of scheduling cycles of backscheduling that |