@@ -737,7 +737,7 @@ static void getPHIDeps(const MachineInstr &UseMI,
737737// tracking set when scanning instructions downwards.
738738static void updatePhysDepsDownwards (const MachineInstr *UseMI,
739739 SmallVectorImpl<DataDep> &Deps,
740- SparseSet<LiveRegUnit> &RegUnits,
740+ LiveRegUnitSet &RegUnits,
741741 const TargetRegisterInfo *TRI) {
742742 SmallVector<MCRegister, 8 > Kills;
743743 SmallVector<unsigned , 8 > LiveDefOps;
@@ -758,7 +758,7 @@ static void updatePhysDepsDownwards(const MachineInstr *UseMI,
758758 if (!MO.readsReg ())
759759 continue ;
760760 for (MCRegUnit Unit : TRI->regunits (Reg)) {
761- SparseSet<LiveRegUnit> ::iterator I = RegUnits.find (Unit);
761+ LiveRegUnitSet ::iterator I = RegUnits.find (Unit);
762762 if (I == RegUnits.end ())
763763 continue ;
764764 Deps.push_back (DataDep (I->MI , I->Op , MO.getOperandNo ()));
@@ -813,9 +813,9 @@ computeCrossBlockCriticalPath(const TraceBlockInfo &TBI) {
813813 return MaxLen;
814814}
815815
816- void MachineTraceMetrics::Ensemble::
817- updateDepth (MachineTraceMetrics::TraceBlockInfo &TBI, const MachineInstr &UseMI,
818- SparseSet<LiveRegUnit> &RegUnits) {
816+ void MachineTraceMetrics::Ensemble::updateDepth (TraceBlockInfo &TBI,
817+ const MachineInstr &UseMI,
818+ LiveRegUnitSet &RegUnits) {
819819 SmallVector<DataDep, 8 > Deps;
820820 // Collect all data dependencies.
821821 if (UseMI.isPHI ())
@@ -852,18 +852,17 @@ updateDepth(MachineTraceMetrics::TraceBlockInfo &TBI, const MachineInstr &UseMI,
852852 }
853853}
854854
855- void MachineTraceMetrics::Ensemble::
856- updateDepth ( const MachineBasicBlock *MBB, const MachineInstr &UseMI,
857- SparseSet<LiveRegUnit> &RegUnits) {
855+ void MachineTraceMetrics::Ensemble::updateDepth ( const MachineBasicBlock *MBB,
856+ const MachineInstr &UseMI,
857+ LiveRegUnitSet &RegUnits) {
858858 updateDepth (BlockInfo[MBB->getNumber ()], UseMI, RegUnits);
859859}
860860
861- void MachineTraceMetrics::Ensemble::
862- updateDepths (MachineBasicBlock::iterator Start,
863- MachineBasicBlock::iterator End,
864- SparseSet<LiveRegUnit> &RegUnits) {
865- for (; Start != End; Start++)
866- updateDepth (Start->getParent (), *Start, RegUnits);
861+ void MachineTraceMetrics::Ensemble::updateDepths (
862+ MachineBasicBlock::iterator Start, MachineBasicBlock::iterator End,
863+ LiveRegUnitSet &RegUnits) {
864+ for (; Start != End; Start++)
865+ updateDepth (Start->getParent (), *Start, RegUnits);
867866}
868867
869868// / Compute instruction depths for all instructions above or in MBB in its
@@ -887,7 +886,7 @@ computeInstrDepths(const MachineBasicBlock *MBB) {
887886 // in the trace. We should track any live-out physregs that were defined in
888887 // the trace. This is quite rare in SSA form, typically created by CSE
889888 // hoisting a compare.
890- SparseSet<LiveRegUnit> RegUnits;
889+ LiveRegUnitSet RegUnits;
891890 RegUnits.setUniverse (MTM.TRI ->getNumRegUnits ());
892891
893892 // Go through trace blocks in top-down order, stopping after the center block.
@@ -925,7 +924,7 @@ computeInstrDepths(const MachineBasicBlock *MBB) {
925924// Return the issue height of MI after considering any live regunits.
926925// Height is the issue height computed from virtual register dependencies alone.
927926static unsigned updatePhysDepsUpwards (const MachineInstr &MI, unsigned Height,
928- SparseSet<LiveRegUnit> &RegUnits,
927+ LiveRegUnitSet &RegUnits,
929928 const TargetSchedModel &SchedModel,
930929 const TargetInstrInfo *TII,
931930 const TargetRegisterInfo *TRI) {
@@ -944,7 +943,7 @@ static unsigned updatePhysDepsUpwards(const MachineInstr &MI, unsigned Height,
944943 // This is a def of Reg. Remove corresponding entries from RegUnits, and
945944 // update MI Height to consider the physreg dependencies.
946945 for (MCRegUnit Unit : TRI->regunits (Reg.asMCReg ())) {
947- SparseSet<LiveRegUnit> ::iterator I = RegUnits.find (Unit);
946+ LiveRegUnitSet ::iterator I = RegUnits.find (Unit);
948947 if (I == RegUnits.end ())
949948 continue ;
950949 unsigned DepHeight = I->Cycle ;
@@ -1048,7 +1047,7 @@ computeInstrHeights(const MachineBasicBlock *MBB) {
10481047
10491048 // For physregs, the def isn't known when we see the use.
10501049 // Instead, keep track of the highest use of each regunit.
1051- SparseSet<LiveRegUnit> RegUnits;
1050+ LiveRegUnitSet RegUnits;
10521051 RegUnits.setUniverse (MTM.TRI ->getNumRegUnits ());
10531052
10541053 // If the bottom of the trace was already precomputed, initialize heights
0 commit comments