mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Cache the TargetLowering info object as a pointer.
Caching it as a pointer allows us to reset it if the TargetMachine object changes. llvm-svn: 183361
This commit is contained in:
parent
f1847072a4
commit
2cca7e5acd
@ -43,7 +43,7 @@ namespace llvm {
|
||||
class SelectionDAGISel : public MachineFunctionPass {
|
||||
public:
|
||||
const TargetMachine &TM;
|
||||
const TargetLowering &TLI;
|
||||
const TargetLowering *TLI;
|
||||
const TargetLibraryInfo *LibInfo;
|
||||
const TargetTransformInfo *TTI;
|
||||
FunctionLoweringInfo *FuncInfo;
|
||||
@ -60,7 +60,7 @@ public:
|
||||
CodeGenOpt::Level OL = CodeGenOpt::Default);
|
||||
virtual ~SelectionDAGISel();
|
||||
|
||||
const TargetLowering &getTargetLowering() { return TLI; }
|
||||
const TargetLowering *getTargetLowering() { return TLI; }
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||
|
||||
|
@ -42,11 +42,11 @@ static cl::opt<signed> RegPressureThreshold(
|
||||
|
||||
ResourcePriorityQueue::ResourcePriorityQueue(SelectionDAGISel *IS) :
|
||||
Picker(this),
|
||||
InstrItins(IS->getTargetLowering().getTargetMachine().getInstrItineraryData())
|
||||
InstrItins(IS->getTargetLowering()->getTargetMachine().getInstrItineraryData())
|
||||
{
|
||||
TII = IS->getTargetLowering().getTargetMachine().getInstrInfo();
|
||||
TRI = IS->getTargetLowering().getTargetMachine().getRegisterInfo();
|
||||
TLI = &IS->getTargetLowering();
|
||||
TII = IS->getTargetLowering()->getTargetMachine().getInstrInfo();
|
||||
TRI = IS->getTargetLowering()->getTargetMachine().getRegisterInfo();
|
||||
TLI = IS->getTargetLowering();
|
||||
|
||||
const TargetMachine &tm = (*IS->MF).getTarget();
|
||||
ResourcesModel = tm.getInstrInfo()->CreateTargetScheduleState(&tm,NULL);
|
||||
|
@ -3013,7 +3013,7 @@ llvm::createHybridListDAGScheduler(SelectionDAGISel *IS,
|
||||
const TargetMachine &TM = IS->TM;
|
||||
const TargetInstrInfo *TII = TM.getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getRegisterInfo();
|
||||
const TargetLowering *TLI = &IS->getTargetLowering();
|
||||
const TargetLowering *TLI = IS->getTargetLowering();
|
||||
|
||||
HybridBURRPriorityQueue *PQ =
|
||||
new HybridBURRPriorityQueue(*IS->MF, true, false, TII, TRI, TLI);
|
||||
@ -3029,7 +3029,7 @@ llvm::createILPListDAGScheduler(SelectionDAGISel *IS,
|
||||
const TargetMachine &TM = IS->TM;
|
||||
const TargetInstrInfo *TII = TM.getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getRegisterInfo();
|
||||
const TargetLowering *TLI = &IS->getTargetLowering();
|
||||
const TargetLowering *TLI = IS->getTargetLowering();
|
||||
|
||||
ILPBURRPriorityQueue *PQ =
|
||||
new ILPBURRPriorityQueue(*IS->MF, true, false, TII, TRI, TLI);
|
||||
|
@ -6596,19 +6596,19 @@ static bool isOnlyUsedInEntryBlock(const Argument *A, bool FastISel) {
|
||||
void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
SelectionDAG &DAG = SDB->DAG;
|
||||
SDLoc dl = SDB->getCurSDLoc();
|
||||
const DataLayout *TD = TLI.getDataLayout();
|
||||
const DataLayout *TD = TLI->getDataLayout();
|
||||
SmallVector<ISD::InputArg, 16> Ins;
|
||||
|
||||
if (!FuncInfo->CanLowerReturn) {
|
||||
// Put in an sret pointer parameter before all the other parameters.
|
||||
SmallVector<EVT, 1> ValueVTs;
|
||||
ComputeValueVTs(TLI, PointerType::getUnqual(F.getReturnType()), ValueVTs);
|
||||
ComputeValueVTs(*TLI, PointerType::getUnqual(F.getReturnType()), ValueVTs);
|
||||
|
||||
// NOTE: Assuming that a pointer will never break down to more than one VT
|
||||
// or one register.
|
||||
ISD::ArgFlagsTy Flags;
|
||||
Flags.setSRet();
|
||||
MVT RegisterVT = TLI.getRegisterType(*DAG.getContext(), ValueVTs[0]);
|
||||
MVT RegisterVT = TLI->getRegisterType(*DAG.getContext(), ValueVTs[0]);
|
||||
ISD::InputArg RetArg(Flags, RegisterVT, true, 0, 0);
|
||||
Ins.push_back(RetArg);
|
||||
}
|
||||
@ -6618,7 +6618,7 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end();
|
||||
I != E; ++I, ++Idx) {
|
||||
SmallVector<EVT, 4> ValueVTs;
|
||||
ComputeValueVTs(TLI, I->getType(), ValueVTs);
|
||||
ComputeValueVTs(*TLI, I->getType(), ValueVTs);
|
||||
bool isArgValueUsed = !I->use_empty();
|
||||
for (unsigned Value = 0, NumValues = ValueVTs.size();
|
||||
Value != NumValues; ++Value) {
|
||||
@ -6647,15 +6647,15 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
if (F.getParamAlignment(Idx))
|
||||
FrameAlign = F.getParamAlignment(Idx);
|
||||
else
|
||||
FrameAlign = TLI.getByValTypeAlignment(ElementTy);
|
||||
FrameAlign = TLI->getByValTypeAlignment(ElementTy);
|
||||
Flags.setByValAlign(FrameAlign);
|
||||
}
|
||||
if (F.getAttributes().hasAttribute(Idx, Attribute::Nest))
|
||||
Flags.setNest();
|
||||
Flags.setOrigAlign(OriginalAlignment);
|
||||
|
||||
MVT RegisterVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
unsigned NumRegs = TLI.getNumRegisters(*CurDAG->getContext(), VT);
|
||||
MVT RegisterVT = TLI->getRegisterType(*CurDAG->getContext(), VT);
|
||||
unsigned NumRegs = TLI->getNumRegisters(*CurDAG->getContext(), VT);
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
ISD::InputArg MyFlags(Flags, RegisterVT, isArgValueUsed,
|
||||
Idx-1, i*RegisterVT.getStoreSize());
|
||||
@ -6671,9 +6671,9 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
|
||||
// Call the target to set up the argument values.
|
||||
SmallVector<SDValue, 8> InVals;
|
||||
SDValue NewRoot = TLI.LowerFormalArguments(DAG.getRoot(), F.getCallingConv(),
|
||||
F.isVarArg(), Ins,
|
||||
dl, DAG, InVals);
|
||||
SDValue NewRoot = TLI->LowerFormalArguments(DAG.getRoot(), F.getCallingConv(),
|
||||
F.isVarArg(), Ins,
|
||||
dl, DAG, InVals);
|
||||
|
||||
// Verify that the target's LowerFormalArguments behaved as expected.
|
||||
assert(NewRoot.getNode() && NewRoot.getValueType() == MVT::Other &&
|
||||
@ -6699,16 +6699,16 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
// Create a virtual register for the sret pointer, and put in a copy
|
||||
// from the sret argument into it.
|
||||
SmallVector<EVT, 1> ValueVTs;
|
||||
ComputeValueVTs(TLI, PointerType::getUnqual(F.getReturnType()), ValueVTs);
|
||||
ComputeValueVTs(*TLI, PointerType::getUnqual(F.getReturnType()), ValueVTs);
|
||||
MVT VT = ValueVTs[0].getSimpleVT();
|
||||
MVT RegVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
MVT RegVT = TLI->getRegisterType(*CurDAG->getContext(), VT);
|
||||
ISD::NodeType AssertOp = ISD::DELETED_NODE;
|
||||
SDValue ArgValue = getCopyFromParts(DAG, dl, &InVals[0], 1,
|
||||
RegVT, VT, NULL, AssertOp);
|
||||
|
||||
MachineFunction& MF = SDB->DAG.getMachineFunction();
|
||||
MachineRegisterInfo& RegInfo = MF.getRegInfo();
|
||||
unsigned SRetReg = RegInfo.createVirtualRegister(TLI.getRegClassFor(RegVT));
|
||||
unsigned SRetReg = RegInfo.createVirtualRegister(TLI->getRegClassFor(RegVT));
|
||||
FuncInfo->DemoteRegister = SRetReg;
|
||||
NewRoot = SDB->DAG.getCopyToReg(NewRoot, SDB->getCurSDLoc(),
|
||||
SRetReg, ArgValue);
|
||||
@ -6723,7 +6723,7 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
++I, ++Idx) {
|
||||
SmallVector<SDValue, 4> ArgValues;
|
||||
SmallVector<EVT, 4> ValueVTs;
|
||||
ComputeValueVTs(TLI, I->getType(), ValueVTs);
|
||||
ComputeValueVTs(*TLI, I->getType(), ValueVTs);
|
||||
unsigned NumValues = ValueVTs.size();
|
||||
|
||||
// If this argument is unused then remember its value. It is used to generate
|
||||
@ -6739,8 +6739,8 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
|
||||
|
||||
for (unsigned Val = 0; Val != NumValues; ++Val) {
|
||||
EVT VT = ValueVTs[Val];
|
||||
MVT PartVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
unsigned NumParts = TLI.getNumRegisters(*CurDAG->getContext(), VT);
|
||||
MVT PartVT = TLI->getRegisterType(*CurDAG->getContext(), VT);
|
||||
unsigned NumParts = TLI->getNumRegisters(*CurDAG->getContext(), VT);
|
||||
|
||||
if (!I->use_empty()) {
|
||||
ISD::NodeType AssertOp = ISD::DELETED_NODE;
|
||||
|
@ -226,19 +226,19 @@ namespace llvm {
|
||||
/// for the target.
|
||||
ScheduleDAGSDNodes* createDefaultScheduler(SelectionDAGISel *IS,
|
||||
CodeGenOpt::Level OptLevel) {
|
||||
const TargetLowering &TLI = IS->getTargetLowering();
|
||||
const TargetLowering *TLI = IS->getTargetLowering();
|
||||
const TargetSubtargetInfo &ST = IS->TM.getSubtarget<TargetSubtargetInfo>();
|
||||
|
||||
if (OptLevel == CodeGenOpt::None || ST.enableMachineScheduler() ||
|
||||
TLI.getSchedulingPreference() == Sched::Source)
|
||||
TLI->getSchedulingPreference() == Sched::Source)
|
||||
return createSourceListDAGScheduler(IS, OptLevel);
|
||||
if (TLI.getSchedulingPreference() == Sched::RegPressure)
|
||||
if (TLI->getSchedulingPreference() == Sched::RegPressure)
|
||||
return createBURRListDAGScheduler(IS, OptLevel);
|
||||
if (TLI.getSchedulingPreference() == Sched::Hybrid)
|
||||
if (TLI->getSchedulingPreference() == Sched::Hybrid)
|
||||
return createHybridListDAGScheduler(IS, OptLevel);
|
||||
if (TLI.getSchedulingPreference() == Sched::VLIW)
|
||||
if (TLI->getSchedulingPreference() == Sched::VLIW)
|
||||
return createVLIWDAGScheduler(IS, OptLevel);
|
||||
assert(TLI.getSchedulingPreference() == Sched::ILP &&
|
||||
assert(TLI->getSchedulingPreference() == Sched::ILP &&
|
||||
"Unknown sched type!");
|
||||
return createILPListDAGScheduler(IS, OptLevel);
|
||||
}
|
||||
@ -277,7 +277,7 @@ void TargetLowering::AdjustInstrPostInstrSelection(MachineInstr *MI,
|
||||
|
||||
SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm,
|
||||
CodeGenOpt::Level OL) :
|
||||
MachineFunctionPass(ID), TM(tm), TLI(*tm.getTargetLowering()),
|
||||
MachineFunctionPass(ID), TM(tm), TLI(tm.getTargetLowering()),
|
||||
FuncInfo(new FunctionLoweringInfo(TM)),
|
||||
CurDAG(new SelectionDAG(tm, OL)),
|
||||
SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)),
|
||||
@ -825,11 +825,11 @@ void SelectionDAGISel::PrepareEHLandingPad() {
|
||||
.addSym(Label);
|
||||
|
||||
// Mark exception register as live in.
|
||||
unsigned Reg = TLI.getExceptionPointerRegister();
|
||||
unsigned Reg = TLI->getExceptionPointerRegister();
|
||||
if (Reg) MBB->addLiveIn(Reg);
|
||||
|
||||
// Mark exception selector register as live in.
|
||||
Reg = TLI.getExceptionSelectorRegister();
|
||||
Reg = TLI->getExceptionSelectorRegister();
|
||||
if (Reg) MBB->addLiveIn(Reg);
|
||||
}
|
||||
|
||||
@ -929,7 +929,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
|
||||
// Initialize the Fast-ISel state, if needed.
|
||||
FastISel *FastIS = 0;
|
||||
if (TM.Options.EnableFastISel)
|
||||
FastIS = TLI.createFastISel(*FuncInfo, LibInfo);
|
||||
FastIS = TLI->createFastISel(*FuncInfo, LibInfo);
|
||||
|
||||
// Iterate over all basic blocks in the function.
|
||||
ReversePostOrderTraversal<const Function*> RPOT(&Fn);
|
||||
@ -1976,24 +1976,23 @@ CheckOpcode(const unsigned char *MatcherTable, unsigned &MatcherIndex,
|
||||
|
||||
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
|
||||
CheckType(const unsigned char *MatcherTable, unsigned &MatcherIndex,
|
||||
SDValue N, const TargetLowering &TLI) {
|
||||
SDValue N, const TargetLowering *TLI) {
|
||||
MVT::SimpleValueType VT = (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
|
||||
if (N.getValueType() == VT) return true;
|
||||
|
||||
// Handle the case when VT is iPTR.
|
||||
return VT == MVT::iPTR && N.getValueType() == TLI.getPointerTy();
|
||||
return VT == MVT::iPTR && N.getValueType() == TLI->getPointerTy();
|
||||
}
|
||||
|
||||
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
|
||||
CheckChildType(const unsigned char *MatcherTable, unsigned &MatcherIndex,
|
||||
SDValue N, const TargetLowering &TLI,
|
||||
SDValue N, const TargetLowering *TLI,
|
||||
unsigned ChildNo) {
|
||||
if (ChildNo >= N.getNumOperands())
|
||||
return false; // Match fails if out of range child #.
|
||||
return ::CheckType(MatcherTable, MatcherIndex, N.getOperand(ChildNo), TLI);
|
||||
}
|
||||
|
||||
|
||||
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
|
||||
CheckCondCode(const unsigned char *MatcherTable, unsigned &MatcherIndex,
|
||||
SDValue N) {
|
||||
@ -2003,13 +2002,13 @@ CheckCondCode(const unsigned char *MatcherTable, unsigned &MatcherIndex,
|
||||
|
||||
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
|
||||
CheckValueType(const unsigned char *MatcherTable, unsigned &MatcherIndex,
|
||||
SDValue N, const TargetLowering &TLI) {
|
||||
SDValue N, const TargetLowering *TLI) {
|
||||
MVT::SimpleValueType VT = (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
|
||||
if (cast<VTSDNode>(N)->getVT() == VT)
|
||||
return true;
|
||||
|
||||
// Handle the case when VT is iPTR.
|
||||
return VT == MVT::iPTR && cast<VTSDNode>(N)->getVT() == TLI.getPointerTy();
|
||||
return VT == MVT::iPTR && cast<VTSDNode>(N)->getVT() == TLI->getPointerTy();
|
||||
}
|
||||
|
||||
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
|
||||
@ -2434,7 +2433,7 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
|
||||
|
||||
MVT CaseVT = (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
|
||||
if (CaseVT == MVT::iPTR)
|
||||
CaseVT = TLI.getPointerTy();
|
||||
CaseVT = TLI->getPointerTy();
|
||||
|
||||
// If the VT matches, then we will execute this case.
|
||||
if (CurNodeVT == CaseVT)
|
||||
@ -2656,7 +2655,7 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
|
||||
for (unsigned i = 0; i != NumVTs; ++i) {
|
||||
MVT::SimpleValueType VT =
|
||||
(MVT::SimpleValueType)MatcherTable[MatcherIndex++];
|
||||
if (VT == MVT::iPTR) VT = TLI.getPointerTy().SimpleTy;
|
||||
if (VT == MVT::iPTR) VT = TLI->getPointerTy().SimpleTy;
|
||||
VTs.push_back(VT);
|
||||
}
|
||||
|
||||
|
@ -243,12 +243,12 @@ SDNode *AArch64DAGToDAGISel::TrySelectToMoveImm(SDNode *Node) {
|
||||
SDValue
|
||||
AArch64DAGToDAGISel::getConstantPoolItemAddress(SDLoc DL,
|
||||
const Constant *CV) {
|
||||
EVT PtrVT = TLI.getPointerTy();
|
||||
EVT PtrVT = TLI->getPointerTy();
|
||||
|
||||
switch (TLI.getTargetMachine().getCodeModel()) {
|
||||
switch (TLI->getTargetMachine().getCodeModel()) {
|
||||
case CodeModel::Small: {
|
||||
unsigned Alignment =
|
||||
TLI.getDataLayout()->getABITypeAlignment(CV->getType());
|
||||
TLI->getDataLayout()->getABITypeAlignment(CV->getType());
|
||||
return CurDAG->getNode(
|
||||
AArch64ISD::WrapperSmall, DL, PtrVT,
|
||||
CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_NO_FLAG),
|
||||
@ -312,7 +312,7 @@ SDNode *AArch64DAGToDAGISel::SelectToLitPool(SDNode *Node) {
|
||||
MemType.getSizeInBits()),
|
||||
UnsignedVal);
|
||||
SDValue PoolAddr = getConstantPoolItemAddress(DL, CV);
|
||||
unsigned Alignment = TLI.getDataLayout()->getABITypeAlignment(CV->getType());
|
||||
unsigned Alignment = TLI->getDataLayout()->getABITypeAlignment(CV->getType());
|
||||
|
||||
return CurDAG->getExtLoad(Extension, DL, DestType, CurDAG->getEntryNode(),
|
||||
PoolAddr,
|
||||
@ -327,7 +327,7 @@ SDNode *AArch64DAGToDAGISel::LowerToFPLitPool(SDNode *Node) {
|
||||
const ConstantFP *FV = cast<ConstantFPSDNode>(Node)->getConstantFPValue();
|
||||
EVT DestType = Node->getValueType(0);
|
||||
|
||||
unsigned Alignment = TLI.getDataLayout()->getABITypeAlignment(FV->getType());
|
||||
unsigned Alignment = TLI->getDataLayout()->getABITypeAlignment(FV->getType());
|
||||
SDValue PoolAddr = getConstantPoolItemAddress(DL, FV);
|
||||
|
||||
return CurDAG->getLoad(DestType, DL, CurDAG->getEntryNode(), PoolAddr,
|
||||
@ -473,7 +473,7 @@ SDNode *AArch64DAGToDAGISel::Select(SDNode *Node) {
|
||||
AArch64::ATOMIC_CMP_SWAP_I64);
|
||||
case ISD::FrameIndex: {
|
||||
int FI = cast<FrameIndexSDNode>(Node)->getIndex();
|
||||
EVT PtrTy = TLI.getPointerTy();
|
||||
EVT PtrTy = TLI->getPointerTy();
|
||||
SDValue TFI = CurDAG->getTargetFrameIndex(FI, PtrTy);
|
||||
return CurDAG->SelectNodeTo(Node, AArch64::ADDxxi_lsl0_s, PtrTy,
|
||||
TFI, CurDAG->getTargetConstant(0, PtrTy));
|
||||
|
@ -533,7 +533,7 @@ bool ARMDAGToDAGISel::SelectAddrModeImm12(SDValue N,
|
||||
if (N.getOpcode() == ISD::FrameIndex) {
|
||||
// Match frame index.
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
OffImm = CurDAG->getTargetConstant(0, MVT::i32);
|
||||
return true;
|
||||
}
|
||||
@ -557,7 +557,7 @@ bool ARMDAGToDAGISel::SelectAddrModeImm12(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
|
||||
return true;
|
||||
@ -703,7 +703,7 @@ AddrMode2Type ARMDAGToDAGISel::SelectAddrMode2Worker(SDValue N,
|
||||
Base = N;
|
||||
if (N.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
} else if (N.getOpcode() == ARMISD::Wrapper &&
|
||||
!(Subtarget->useMovt() &&
|
||||
N.getOperand(0).getOpcode() == ISD::TargetGlobalAddress)) {
|
||||
@ -724,7 +724,7 @@ AddrMode2Type ARMDAGToDAGISel::SelectAddrMode2Worker(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
Offset = CurDAG->getRegister(0, MVT::i32);
|
||||
|
||||
@ -901,7 +901,7 @@ bool ARMDAGToDAGISel::SelectAddrMode3(SDValue N,
|
||||
Base = N;
|
||||
if (N.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
Offset = CurDAG->getRegister(0, MVT::i32);
|
||||
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::add, 0),MVT::i32);
|
||||
@ -915,7 +915,7 @@ bool ARMDAGToDAGISel::SelectAddrMode3(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
Offset = CurDAG->getRegister(0, MVT::i32);
|
||||
|
||||
@ -960,7 +960,7 @@ bool ARMDAGToDAGISel::SelectAddrMode5(SDValue N,
|
||||
Base = N;
|
||||
if (N.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
} else if (N.getOpcode() == ARMISD::Wrapper &&
|
||||
!(Subtarget->useMovt() &&
|
||||
N.getOperand(0).getOpcode() == ISD::TargetGlobalAddress)) {
|
||||
@ -978,7 +978,7 @@ bool ARMDAGToDAGISel::SelectAddrMode5(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
|
||||
ARM_AM::AddrOpc AddSub = ARM_AM::add;
|
||||
@ -1202,7 +1202,7 @@ bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDValue N,
|
||||
SDValue &Base, SDValue &OffImm) {
|
||||
if (N.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
OffImm = CurDAG->getTargetConstant(0, MVT::i32);
|
||||
return true;
|
||||
}
|
||||
@ -1219,7 +1219,7 @@ bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
|
||||
return true;
|
||||
@ -1267,7 +1267,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeImm12(SDValue N,
|
||||
if (N.getOpcode() == ISD::FrameIndex) {
|
||||
// Match frame index.
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
OffImm = CurDAG->getTargetConstant(0, MVT::i32);
|
||||
return true;
|
||||
}
|
||||
@ -1297,7 +1297,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeImm12(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
|
||||
return true;
|
||||
@ -1326,7 +1326,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeImm8(SDValue N,
|
||||
Base = N.getOperand(0);
|
||||
if (Base.getOpcode() == ISD::FrameIndex) {
|
||||
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
}
|
||||
OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
|
||||
return true;
|
||||
@ -2587,7 +2587,7 @@ SDNode *ARMDAGToDAGISel::Select(SDNode *N) {
|
||||
SDValue CPIdx =
|
||||
CurDAG->getTargetConstantPool(ConstantInt::get(
|
||||
Type::getInt32Ty(*CurDAG->getContext()), Val),
|
||||
TLI.getPointerTy());
|
||||
TLI->getPointerTy());
|
||||
|
||||
SDNode *ResNode;
|
||||
if (Subtarget->isThumb1Only()) {
|
||||
@ -2617,7 +2617,7 @@ SDNode *ARMDAGToDAGISel::Select(SDNode *N) {
|
||||
case ISD::FrameIndex: {
|
||||
// Selects to ADDri FI, 0 which in turn will become ADDri SP, imm.
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
SDValue TFI = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
SDValue TFI = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
if (Subtarget->isThumb1Only()) {
|
||||
SDValue Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32),
|
||||
getAL(CurDAG), CurDAG->getRegister(0, MVT::i32) };
|
||||
|
@ -275,8 +275,8 @@ def HasSlowVDUP32 : Predicate<"Subtarget->isSwift()">;
|
||||
def UseVMOVSR : Predicate<"Subtarget->isCortexA9() || !Subtarget->useNEONForSinglePrecisionFP()">;
|
||||
def DontUseVMOVSR : Predicate<"!Subtarget->isCortexA9() && Subtarget->useNEONForSinglePrecisionFP()">;
|
||||
|
||||
def IsLE : Predicate<"TLI.isLittleEndian()">;
|
||||
def IsBE : Predicate<"TLI.isBigEndian()">;
|
||||
def IsLE : Predicate<"TLI->isLittleEndian()">;
|
||||
def IsBE : Predicate<"TLI->isBigEndian()">;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ARM Flag Definitions.
|
||||
|
@ -396,7 +396,7 @@ SDNode *HexagonDAGToDAGISel::SelectBaseOffsetLoad(LoadSDNode *LD, SDLoc dl) {
|
||||
EVT LoadedVT = LD->getMemoryVT();
|
||||
int64_t Offset = cast<GlobalAddressSDNode>(Base)->getOffset();
|
||||
if (Offset != 0 && OffsetFitsS11(LoadedVT, Offset)) {
|
||||
MVT PointerTy = TLI.getPointerTy();
|
||||
MVT PointerTy = TLI->getPointerTy();
|
||||
const GlobalValue* GV =
|
||||
cast<GlobalAddressSDNode>(Base)->getGlobal();
|
||||
SDValue TargAddr =
|
||||
@ -769,7 +769,7 @@ SDNode *HexagonDAGToDAGISel::SelectBaseOffsetStore(StoreSDNode *ST,
|
||||
EVT StoredVT = ST->getMemoryVT();
|
||||
int64_t Offset = cast<GlobalAddressSDNode>(Base)->getOffset();
|
||||
if (Offset != 0 && OffsetFitsS11(StoredVT, Offset)) {
|
||||
MVT PointerTy = TLI.getPointerTy();
|
||||
MVT PointerTy = TLI->getPointerTy();
|
||||
const GlobalValue* GV =
|
||||
cast<GlobalAddressSDNode>(Base)->getGlobal();
|
||||
SDValue TargAddr =
|
||||
|
@ -181,7 +181,7 @@ SelectAddrRegImm(SDValue N, SDValue &Base, SDValue &Disp) {
|
||||
/// GOT address into a register.
|
||||
SDNode *MBlazeDAGToDAGISel::getGlobalBaseReg() {
|
||||
unsigned GlobalBaseReg = getInstrInfo()->getGlobalBaseReg(MF);
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode();
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI->getPointerTy()).getNode();
|
||||
}
|
||||
|
||||
/// Select instructions not customized! Used for
|
||||
|
@ -259,7 +259,7 @@ bool MSP430DAGToDAGISel::SelectAddr(SDValue N,
|
||||
}
|
||||
|
||||
Base = (AM.BaseType == MSP430ISelAddressMode::FrameIndexBase) ?
|
||||
CurDAG->getTargetFrameIndex(AM.Base.FrameIndex, TLI.getPointerTy()) :
|
||||
CurDAG->getTargetFrameIndex(AM.Base.FrameIndex, TLI->getPointerTy()) :
|
||||
AM.Base.Reg;
|
||||
|
||||
if (AM.GV)
|
||||
|
@ -118,11 +118,11 @@ void Mips16DAGToDAGISel::processFunctionAfterISel(MachineFunction &MF) {
|
||||
SDValue Mips16DAGToDAGISel::getMips16SPAliasReg() {
|
||||
unsigned Mips16SPAliasReg =
|
||||
MF->getInfo<MipsFunctionInfo>()->getMips16SPAliasReg();
|
||||
return CurDAG->getRegister(Mips16SPAliasReg, TLI.getPointerTy());
|
||||
return CurDAG->getRegister(Mips16SPAliasReg, TLI->getPointerTy());
|
||||
}
|
||||
|
||||
void Mips16DAGToDAGISel::getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg) {
|
||||
SDValue AliasFPReg = CurDAG->getRegister(Mips::S0, TLI.getPointerTy());
|
||||
SDValue AliasFPReg = CurDAG->getRegister(Mips::S0, TLI->getPointerTy());
|
||||
if (Parent) {
|
||||
switch (Parent->getOpcode()) {
|
||||
case ISD::LOAD: {
|
||||
@ -149,7 +149,7 @@ void Mips16DAGToDAGISel::getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg) {
|
||||
}
|
||||
}
|
||||
}
|
||||
AliasReg = CurDAG->getRegister(Mips::SP, TLI.getPointerTy());
|
||||
AliasReg = CurDAG->getRegister(Mips::SP, TLI->getPointerTy());
|
||||
return;
|
||||
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ bool MipsDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
|
||||
/// GOT address into a register.
|
||||
SDNode *MipsDAGToDAGISel::getGlobalBaseReg() {
|
||||
unsigned GlobalBaseReg = MF->getInfo<MipsFunctionInfo>()->getGlobalBaseReg();
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode();
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI->getPointerTy()).getNode();
|
||||
}
|
||||
|
||||
/// ComplexPattern used on MipsInstrInfo
|
||||
|
@ -402,7 +402,7 @@ std::pair<bool, SDNode*> MipsSEDAGToDAGISel::selectNode(SDNode *Node) {
|
||||
}
|
||||
|
||||
case MipsISD::ThreadPointer: {
|
||||
EVT PtrVT = TLI.getPointerTy();
|
||||
EVT PtrVT = TLI->getPointerTy();
|
||||
unsigned RdhwrOpc, SrcReg, DestReg;
|
||||
|
||||
if (PtrVT == MVT::i32) {
|
||||
|
@ -67,13 +67,13 @@ private:
|
||||
|
||||
SDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
|
||||
unsigned GlobalBaseReg = TM.getInstrInfo()->getGlobalBaseReg(MF);
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode();
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI->getPointerTy()).getNode();
|
||||
}
|
||||
|
||||
bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
||||
SDValue &Base, SDValue &Offset) {
|
||||
if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), TLI.getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), TLI->getPointerTy());
|
||||
Offset = CurDAG->getTargetConstant(0, MVT::i32);
|
||||
return true;
|
||||
}
|
||||
@ -88,7 +88,7 @@ bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
||||
dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
|
||||
// Constant offset from frame ref.
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(),
|
||||
TLI.getPointerTy());
|
||||
TLI->getPointerTy());
|
||||
} else {
|
||||
Base = Addr.getOperand(0);
|
||||
}
|
||||
@ -131,7 +131,7 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
|
||||
}
|
||||
|
||||
R1 = Addr;
|
||||
R2 = CurDAG->getRegister(SP::G0, TLI.getPointerTy());
|
||||
R2 = CurDAG->getRegister(SP::G0, TLI->getPointerTy());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ namespace {
|
||||
SDValue &Scale, SDValue &Index,
|
||||
SDValue &Disp, SDValue &Segment) {
|
||||
Base = (AM.BaseType == X86ISelAddressMode::FrameIndexBase) ?
|
||||
CurDAG->getTargetFrameIndex(AM.Base_FrameIndex, TLI.getPointerTy()) :
|
||||
CurDAG->getTargetFrameIndex(AM.Base_FrameIndex, TLI->getPointerTy()) :
|
||||
AM.Base_Reg;
|
||||
Scale = getI8Imm(AM.Scale);
|
||||
Index = AM.IndexReg;
|
||||
@ -1515,7 +1515,7 @@ bool X86DAGToDAGISel::TryFoldLoad(SDNode *P, SDValue N,
|
||||
///
|
||||
SDNode *X86DAGToDAGISel::getGlobalBaseReg() {
|
||||
unsigned GlobalBaseReg = getInstrInfo()->getGlobalBaseReg(MF);
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode();
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI->getPointerTy()).getNode();
|
||||
}
|
||||
|
||||
SDNode *X86DAGToDAGISel::SelectAtomic64(SDNode *Node, unsigned Opc) {
|
||||
|
@ -125,7 +125,7 @@ SDNode *XCoreDAGToDAGISel::Select(SDNode *N) {
|
||||
SDValue CPIdx =
|
||||
CurDAG->getTargetConstantPool(ConstantInt::get(
|
||||
Type::getInt32Ty(*CurDAG->getContext()), Val),
|
||||
TLI.getPointerTy());
|
||||
TLI->getPointerTy());
|
||||
SDNode *node = CurDAG->getMachineNode(XCore::LDWCP_lru6, dl, MVT::i32,
|
||||
MVT::Other, CPIdx,
|
||||
CurDAG->getEntryNode());
|
||||
|
Loading…
Reference in New Issue
Block a user