Grab the TargetRegisterInfo off of the subtarget from the
authorEric Christopher <echristo@gmail.com>
Wed, 8 Oct 2014 09:50:52 +0000 (09:50 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 8 Oct 2014 09:50:52 +0000 (09:50 +0000)
MachineFunction rather than a lookup on the TargetMachine
to avoid unnecessary lookups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219291 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 628ea626ee89fea1793f76b5951fa658f9018e7a..006f3e0143a56fba9f19b9e29f40e901f0d6be50 100644 (file)
@@ -454,7 +454,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
   // copied into vregs, emit the copies into the top of the block before
   // emitting the code for the block.
   MachineBasicBlock *EntryMBB = MF->begin();
-  const TargetRegisterInfo &TRI = *TM.getSubtargetImpl()->getRegisterInfo();
+  const TargetRegisterInfo &TRI = *MF->getSubtarget().getRegisterInfo();
   RegInfo->EmitLiveInCopies(EntryMBB, TRI, *TII);
 
   DenseMap<unsigned, unsigned> LiveInMap;