diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-07-10 05:48:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-07-10 05:48:03 +0000 |
| commit | ace6ec26d93a01ac0082bdf1a22bc544f74d0cfb (patch) | |
| tree | 6da3982bd48c257403d716e89b60a3cbeb683641 /llvm/lib | |
| parent | 7277a807f08f6c447bad1b04f251b3674401350f (diff) | |
| download | bcm5719-llvm-ace6ec26d93a01ac0082bdf1a22bc544f74d0cfb.tar.gz bcm5719-llvm-ace6ec26d93a01ac0082bdf1a22bc544f74d0cfb.zip | |
actually, just eliminate PCRelGVRequiresExtraLoad. It makes the code
more complex and slow than just directly testing what we care about.
llvm-svn: 75231
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.h | 6 |
4 files changed, 2 insertions, 22 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index bbf773871b0..6359a4bef48 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/lib/Target/X86/X86FastISel.cpp @@ -587,7 +587,7 @@ bool X86FastISel::X86SelectCallAddress(Value *V, X86AddressMode &AM) { (AM.Base.Reg != 0 || AM.IndexReg != 0)) return false; - // Can't handle TLS yet. + // Can't handle TLS or DLLImport. if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) if (GVar->isThreadLocal() || GVar->hasDLLImportLinkage()) return false; @@ -597,7 +597,6 @@ bool X86FastISel::X86SelectCallAddress(Value *V, X86AddressMode &AM) { // No ABI requires an extra load for anything other than DLLImport, which // we rejected above. Return a direct reference to the global. - assert(!Subtarget->PCRelGVRequiresExtraLoad(GV, TM)); if (Subtarget->isPICStyleRIPRel()) { // Use rip-relative addressing if we can. Above we verified that the // base and index registers are unused. diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 5e615484028..40cd608ef9e 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1902,7 +1902,7 @@ SDValue X86TargetLowering::LowerCALL(SDValue Op, SelectionDAG &DAG) { // We should use extra load for direct calls to dllimported functions in // non-JIT mode. GlobalValue *GV = G->getGlobal(); - if (!Subtarget->PCRelGVRequiresExtraLoad(GV, getTargetMachine())) { + if (!GV->hasDLLImportLinkage()) { unsigned char OpFlags = 0; // On ELF targets, in both X86-64 and X86-32 mode, direct calls to diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index 6eb0235e15d..d966e34de77 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/lib/Target/X86/X86Subtarget.cpp @@ -72,19 +72,6 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue *GV, return false; } -/// PCRelGVRequiresExtraLoad - True if accessing the GV from a PC-relative -/// operand like a call target requires an extra load. -bool X86Subtarget::PCRelGVRequiresExtraLoad(const GlobalValue *GV, - const TargetMachine &TM) const { - // Windows targets only require an extra load for DLLImport linkage values, - // and they need these regardless of whether we're in PIC mode or not. - if (isTargetCygMing() || isTargetWindows()) - return GV->hasDLLImportLinkage(); - - return false; -} - - /// True if accessing the GV requires a register. This is a superset of the /// cases where GVRequiresExtraLoad is true. Some variations of PIC require /// a register, but not an extra load. diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h index b2e518ed39f..7148d0d8b67 100644 --- a/llvm/lib/Target/X86/X86Subtarget.h +++ b/llvm/lib/Target/X86/X86Subtarget.h @@ -204,12 +204,6 @@ public: bool GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine &TM, bool isDirectCall) const; - /// PCRelGVRequiresExtraLoad - True if accessing the GV from a PC-relative - /// operand like a call target requires an extra load. - bool PCRelGVRequiresExtraLoad(const GlobalValue *GV, - const TargetMachine &TM) const; - - /// True if accessing the GV requires a register. This is a superset of the /// cases where GVRequiresExtraLoad is true. Some variations of PIC require /// a register, but not an extra load. |

