mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
x86-64 PIC JIT fixes: do not generate the extra load for external GV's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53661 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
81fb5feede
commit
817a6a9eaa
@ -1677,15 +1677,11 @@ SDOperand X86TargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG) {
|
||||
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
|
||||
// We should use extra load for direct calls to dllimported functions in
|
||||
// non-JIT mode.
|
||||
if ((IsTailCall || !Is64Bit ||
|
||||
getTargetMachine().getCodeModel() != CodeModel::Large)
|
||||
&& !Subtarget->GVRequiresExtraLoad(G->getGlobal(),
|
||||
getTargetMachine(), true))
|
||||
if (!Subtarget->GVRequiresExtraLoad(G->getGlobal(),
|
||||
getTargetMachine(), true))
|
||||
Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy());
|
||||
} else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
|
||||
if (IsTailCall || !Is64Bit ||
|
||||
getTargetMachine().getCodeModel() != CodeModel::Large)
|
||||
Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy());
|
||||
Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy());
|
||||
} else if (IsTailCall) {
|
||||
unsigned Opc = Is64Bit ? X86::R9 : X86::ECX;
|
||||
|
||||
|
@ -37,7 +37,8 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
|
||||
bool isDirectCall) const
|
||||
{
|
||||
// FIXME: PIC
|
||||
if (TM.getRelocationModel() != Reloc::Static) {
|
||||
if (TM.getRelocationModel() != Reloc::Static &&
|
||||
TM.getCodeModel() != CodeModel::Large) {
|
||||
if (isTargetDarwin()) {
|
||||
return (!isDirectCall &&
|
||||
(GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
|
||||
|
Loading…
Reference in New Issue
Block a user