forked from OSchip/llvm-project
Use isPositionIndependent predicate. NFC.
llvm-svn: 273827
This commit is contained in:
parent
ae0d866f56
commit
405e25a970
|
@ -1408,15 +1408,15 @@ HexagonTargetLowering::LowerConstantPool(SDValue Op, SelectionDAG &DAG) const {
|
||||||
EVT ValTy = Op.getValueType();
|
EVT ValTy = Op.getValueType();
|
||||||
ConstantPoolSDNode *CPN = cast<ConstantPoolSDNode>(Op);
|
ConstantPoolSDNode *CPN = cast<ConstantPoolSDNode>(Op);
|
||||||
unsigned Align = CPN->getAlignment();
|
unsigned Align = CPN->getAlignment();
|
||||||
Reloc::Model RM = HTM.getRelocationModel();
|
bool IsPositionIndependent = isPositionIndependent();
|
||||||
unsigned char TF = (RM == Reloc::PIC_) ? HexagonII::MO_PCREL : 0;
|
unsigned char TF = IsPositionIndependent ? HexagonII::MO_PCREL : 0;
|
||||||
|
|
||||||
SDValue T;
|
SDValue T;
|
||||||
if (CPN->isMachineConstantPoolEntry())
|
if (CPN->isMachineConstantPoolEntry())
|
||||||
T = DAG.getTargetConstantPool(CPN->getMachineCPVal(), ValTy, Align, TF);
|
T = DAG.getTargetConstantPool(CPN->getMachineCPVal(), ValTy, Align, TF);
|
||||||
else
|
else
|
||||||
T = DAG.getTargetConstantPool(CPN->getConstVal(), ValTy, Align, TF);
|
T = DAG.getTargetConstantPool(CPN->getConstVal(), ValTy, Align, TF);
|
||||||
if (RM == Reloc::PIC_)
|
if (IsPositionIndependent)
|
||||||
return DAG.getNode(HexagonISD::AT_PCREL, SDLoc(Op), ValTy, T);
|
return DAG.getNode(HexagonISD::AT_PCREL, SDLoc(Op), ValTy, T);
|
||||||
return DAG.getNode(HexagonISD::CP, SDLoc(Op), ValTy, T);
|
return DAG.getNode(HexagonISD::CP, SDLoc(Op), ValTy, T);
|
||||||
}
|
}
|
||||||
|
@ -1425,8 +1425,7 @@ SDValue
|
||||||
HexagonTargetLowering::LowerJumpTable(SDValue Op, SelectionDAG &DAG) const {
|
HexagonTargetLowering::LowerJumpTable(SDValue Op, SelectionDAG &DAG) const {
|
||||||
EVT VT = Op.getValueType();
|
EVT VT = Op.getValueType();
|
||||||
int Idx = cast<JumpTableSDNode>(Op)->getIndex();
|
int Idx = cast<JumpTableSDNode>(Op)->getIndex();
|
||||||
Reloc::Model RM = HTM.getRelocationModel();
|
if (isPositionIndependent()) {
|
||||||
if (RM == Reloc::PIC_) {
|
|
||||||
SDValue T = DAG.getTargetJumpTable(Idx, VT, HexagonII::MO_PCREL);
|
SDValue T = DAG.getTargetJumpTable(Idx, VT, HexagonII::MO_PCREL);
|
||||||
return DAG.getNode(HexagonISD::AT_PCREL, SDLoc(Op), VT, T);
|
return DAG.getNode(HexagonISD::AT_PCREL, SDLoc(Op), VT, T);
|
||||||
}
|
}
|
||||||
|
@ -1593,9 +1592,9 @@ HexagonTargetLowering::LowerToTLSInitialExecModel(GlobalAddressSDNode *GA,
|
||||||
// Get the thread pointer.
|
// Get the thread pointer.
|
||||||
SDValue TP = DAG.getCopyFromReg(DAG.getEntryNode(), dl, Hexagon::UGP, PtrVT);
|
SDValue TP = DAG.getCopyFromReg(DAG.getEntryNode(), dl, Hexagon::UGP, PtrVT);
|
||||||
|
|
||||||
Reloc::Model RM = HTM.getRelocationModel();
|
bool IsPositionIndependent = isPositionIndependent();
|
||||||
unsigned char TF = (RM == Reloc::PIC_) ? HexagonII::MO_IEGOT
|
unsigned char TF =
|
||||||
: HexagonII::MO_IE;
|
IsPositionIndependent ? HexagonII::MO_IEGOT : HexagonII::MO_IE;
|
||||||
|
|
||||||
// First generate the TLS symbol address
|
// First generate the TLS symbol address
|
||||||
SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl, PtrVT,
|
SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl, PtrVT,
|
||||||
|
@ -1603,7 +1602,7 @@ HexagonTargetLowering::LowerToTLSInitialExecModel(GlobalAddressSDNode *GA,
|
||||||
|
|
||||||
SDValue Sym = DAG.getNode(HexagonISD::CONST32, dl, PtrVT, TGA);
|
SDValue Sym = DAG.getNode(HexagonISD::CONST32, dl, PtrVT, TGA);
|
||||||
|
|
||||||
if (RM == Reloc::PIC_) {
|
if (IsPositionIndependent) {
|
||||||
// Generate the GOT pointer in case of position independent code
|
// Generate the GOT pointer in case of position independent code
|
||||||
SDValue GOT = LowerGLOBAL_OFFSET_TABLE(Sym, DAG);
|
SDValue GOT = LowerGLOBAL_OFFSET_TABLE(Sym, DAG);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue