diff options
| author | Sriraman Tallam <tmsriram@google.com> | 2018-02-23 21:32:06 +0000 |
|---|---|---|
| committer | Sriraman Tallam <tmsriram@google.com> | 2018-02-23 21:32:06 +0000 |
| commit | 609f8c013c0b68ee051294f3e7ad6786d83bafac (patch) | |
| tree | 6b8f8a903e354f32b86238bc9ae1ef0dce25ad42 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
| parent | 80af005a485357bf87e0d58f6d4fbab1d186881b (diff) | |
| download | bcm5719-llvm-609f8c013c0b68ee051294f3e7ad6786d83bafac.tar.gz bcm5719-llvm-609f8c013c0b68ee051294f3e7ad6786d83bafac.zip | |
Intrinsics calls should avoid the PLT when "RtLibUseGOT" metadata is present.
Differential Revision: https://reviews.llvm.org/D42216
llvm-svn: 325962
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 956de5539d9..537434f5cba 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -3779,6 +3779,14 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, Callee = DAG.getTargetExternalSymbol( S->getSymbol(), getPointerTy(DAG.getDataLayout()), OpFlags); + + if (OpFlags == X86II::MO_GOTPCREL) { + Callee = DAG.getNode(X86ISD::WrapperRIP, dl, + getPointerTy(DAG.getDataLayout()), Callee); + Callee = DAG.getLoad( + getPointerTy(DAG.getDataLayout()), dl, DAG.getEntryNode(), Callee, + MachinePointerInfo::getGOT(DAG.getMachineFunction())); + } } else if (Subtarget.isTarget64BitILP32() && Callee->getValueType(0) == MVT::i32) { // Zero-extend the 32-bit Callee address into a 64-bit according to x32 ABI |

