[llvm-commits] [llvm] r95323 - in /llvm/trunk: include/llvm/CodeGen/MachineRelocation.h lib/Target/X86/X86CodeEmitter.cpp
Evan Phoenix
evan at fallingsnow.net
Thu Feb 4 11:56:59 PST 2010
Author: evanphx
Date: Thu Feb 4 13:56:59 2010
New Revision: 95323
URL: http://llvm.org/viewvc/llvm-project?rev=95323&view=rev
Log:
Disable external stubs for X86-32 and X86-64
Instruction selection for X86 now can choose an instruction
sequence that will fit any address of any symbol, no matter
the pointer width. X86-64 uses a mov+call-via-reg sequence
for this.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineRelocation.h
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineRelocation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineRelocation.h?rev=95323&r1=95322&r2=95323&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineRelocation.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineRelocation.h Thu Feb 4 13:56:59 2010
@@ -138,14 +138,15 @@
///
static MachineRelocation getExtSym(uintptr_t offset, unsigned RelocationType,
const char *ES, intptr_t cst = 0,
- bool GOTrelative = 0) {
+ bool GOTrelative = 0,
+ bool NeedStub = true) {
assert((RelocationType & ~63) == 0 && "Relocation type too large!");
MachineRelocation Result;
Result.Offset = offset;
Result.ConstantVal = cst;
Result.TargetReloType = RelocationType;
Result.AddrType = isExtSym;
- Result.MayNeedFarStub = true;
+ Result.MayNeedFarStub = NeedStub;
Result.GOTRelative = GOTrelative;
Result.TargetResolve = false;
Result.Target.ExtSym = ES;
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=95323&r1=95322&r2=95323&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Thu Feb 4 13:56:59 2010
@@ -191,8 +191,15 @@
void Emitter<CodeEmitter>::emitExternalSymbolAddress(const char *ES,
unsigned Reloc) {
intptr_t RelocCST = (Reloc == X86::reloc_picrel_word) ? PICBaseOffset : 0;
+
+ // X86 never needs stubs because instruction selection will always pick
+ // an instruction sequence that is large enough to hold any address
+ // to a symbol.
+ // (see X86ISelLowering.cpp, near 2039: X86TargetLowering::LowerCall)
+ bool NeedStub = false;
MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
- Reloc, ES, RelocCST));
+ Reloc, ES, RelocCST,
+ 0, NeedStub));
if (Reloc == X86::reloc_absolute_dword)
MCE.emitDWordLE(0);
else
More information about the llvm-commits
mailing list