Cache TargetLowering on SelectionDAGISel and update previous

calls to getTargetLowering() with the cached variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219284 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2014-10-08 07:32:17 +00:00
parent b07b0970b1
commit b7cd35b171
8 changed files with 57 additions and 78 deletions

View File

@ -42,13 +42,12 @@ static cl::opt<signed> RegPressureThreshold(
cl::desc("Track reg pressure and switch priority to in-depth"));
ResourcePriorityQueue::ResourcePriorityQueue(SelectionDAGISel *IS)
: Picker(this), InstrItins(IS->getTargetLowering()
->getTargetMachine()
: Picker(this), InstrItins(IS->TLI->getTargetMachine()
.getSubtargetImpl()
->getInstrItineraryData()) {
const TargetMachine &TM = (*IS->MF).getTarget();
TRI = TM.getSubtargetImpl()->getRegisterInfo();
TLI = IS->getTargetLowering();
TLI = IS->TLI;
TII = TM.getSubtargetImpl()->getInstrInfo();
ResourcesModel = TII->CreateTargetScheduleState(&TM, nullptr);
// This hard requirement could be relaxed, but for now