@@ -800,9 +800,10 @@ computeCrossBlockCriticalPath(const TraceBlockInfo &TBI) {
800800 assert (TBI.HasValidInstrHeights && " Missing height info" );
801801 unsigned MaxLen = 0 ;
802802 for (const LiveInReg &LIR : TBI.LiveIns ) {
803- if (!LIR.Reg . isVirtual ())
803+ if (!LIR.VRegOrUnit . isVirtualReg ())
804804 continue ;
805- const MachineInstr *DefMI = MTM.MRI ->getVRegDef (LIR.Reg );
805+ const MachineInstr *DefMI =
806+ MTM.MRI ->getVRegDef (LIR.VRegOrUnit .asVirtualReg ());
806807 // Ignore dependencies outside the current trace.
807808 const TraceBlockInfo &DefTBI = BlockInfo[DefMI->getParent ()->getNumber ()];
808809 if (!DefTBI.isUsefulDominator (TBI))
@@ -1019,7 +1020,7 @@ addLiveIns(const MachineInstr *DefMI, unsigned DefOp,
10191020 return ;
10201021 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber ()];
10211022 // Just add the register. The height will be updated later.
1022- TBI.LiveIns .push_back ( Reg);
1023+ TBI.LiveIns .emplace_back ( VirtRegOrUnit ( Reg) );
10231024 }
10241025}
10251026
@@ -1056,15 +1057,16 @@ computeInstrHeights(const MachineBasicBlock *MBB) {
10561057 if (MBB) {
10571058 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber ()];
10581059 for (LiveInReg &LI : TBI.LiveIns ) {
1059- if (LI.Reg . isVirtual ()) {
1060+ if (LI.VRegOrUnit . isVirtualReg ()) {
10601061 // For virtual registers, the def latency is included.
1061- unsigned &Height = Heights[MTM.MRI ->getVRegDef (LI.Reg )];
1062+ unsigned &Height =
1063+ Heights[MTM.MRI ->getVRegDef (LI.VRegOrUnit .asVirtualReg ())];
10621064 if (Height < LI.Height )
10631065 Height = LI.Height ;
10641066 } else {
10651067 // For register units, the def latency is not included because we don't
10661068 // know the def yet.
1067- RegUnits[LI.Reg . id ()].Cycle = LI.Height ;
1069+ RegUnits[LI.VRegOrUnit . asMCRegUnit ()].Cycle = LI.Height ;
10681070 }
10691071 }
10701072 }
@@ -1159,14 +1161,15 @@ computeInstrHeights(const MachineBasicBlock *MBB) {
11591161 // height because the final height isn't known until now.
11601162 LLVM_DEBUG (dbgs () << printMBBReference (*MBB) << " Live-ins:" );
11611163 for (LiveInReg &LIR : TBI.LiveIns ) {
1162- const MachineInstr *DefMI = MTM.MRI ->getVRegDef (LIR.Reg );
1164+ Register Reg = LIR.VRegOrUnit .asVirtualReg ();
1165+ const MachineInstr *DefMI = MTM.MRI ->getVRegDef (Reg);
11631166 LIR.Height = Heights.lookup (DefMI);
1164- LLVM_DEBUG (dbgs () << ' ' << printReg (LIR. Reg ) << ' @' << LIR.Height );
1167+ LLVM_DEBUG (dbgs () << ' ' << printReg (Reg) << ' @' << LIR.Height );
11651168 }
11661169
11671170 // Transfer the live regunits to the live-in list.
11681171 for (const LiveRegUnit &RU : RegUnits) {
1169- TBI.LiveIns .push_back ( LiveInReg (RU.RegUnit , RU.Cycle ) );
1172+ TBI.LiveIns .emplace_back ( VirtRegOrUnit (RU.RegUnit ) , RU.Cycle );
11701173 LLVM_DEBUG (dbgs () << ' ' << printRegUnit (RU.RegUnit , MTM.TRI ) << ' @'
11711174 << RU.Cycle );
11721175 }
0 commit comments