Differential D22913 Diff 66001 head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 4,946 Lines • ▼ Show 20 Lines | PrepareCall(SelectionDAG &DAG, SDValue &Callee, SDValue &InFlag, SDValue &Chain, | ||||
// we're building with the leopard linker or later, which automatically | // we're building with the leopard linker or later, which automatically | ||||
// synthesizes these stubs. | // synthesizes these stubs. | ||||
const TargetMachine &TM = DAG.getTarget(); | const TargetMachine &TM = DAG.getTarget(); | ||||
const Module *Mod = DAG.getMachineFunction().getFunction().getParent(); | const Module *Mod = DAG.getMachineFunction().getFunction().getParent(); | ||||
const GlobalValue *GV = nullptr; | const GlobalValue *GV = nullptr; | ||||
if (auto *G = dyn_cast<GlobalAddressSDNode>(Callee)) | if (auto *G = dyn_cast<GlobalAddressSDNode>(Callee)) | ||||
GV = G->getGlobal(); | GV = G->getGlobal(); | ||||
bool Local = TM.shouldAssumeDSOLocal(*Mod, GV); | bool Local = TM.shouldAssumeDSOLocal(*Mod, GV); | ||||
bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64; | // The PLT is only used in 32-bit ELF PIC mode. Attempting to use the PLT in | ||||
// a static relocation model causes some versions of GNU LD (2.17.50, at | |||||
// least) to force BSS-PLT, instead of secure-PLT, even if all objects are | |||||
// built with secure-PLT. | |||||
bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64 && | |||||
Subtarget.getTargetMachine().getRelocationModel() == Reloc::PIC_; | |||||
// If the callee is a GlobalAddress/ExternalSymbol node (quite common, | // If the callee is a GlobalAddress/ExternalSymbol node (quite common, | ||||
// every direct call is) turn it into a TargetGlobalAddress / | // every direct call is) turn it into a TargetGlobalAddress / | ||||
// TargetExternalSymbol node so that legalize doesn't hack it. | // TargetExternalSymbol node so that legalize doesn't hack it. | ||||
if (isFunctionGlobalAddress(Callee)) { | if (isFunctionGlobalAddress(Callee)) { | ||||
GlobalAddressSDNode *G = cast<GlobalAddressSDNode>(Callee); | GlobalAddressSDNode *G = cast<GlobalAddressSDNode>(Callee); | ||||
// A call to a TLS address is actually an indirect call to a | // A call to a TLS address is actually an indirect call to a | ||||
▲ Show 20 Lines • Show All 10,349 Lines • Show Last 20 Lines |