Skip to content

Commit ebe745a

Browse files
committed
Revert some changes
1 parent a878dc8 commit ebe745a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

llvm/lib/CodeGen/LiveIntervals.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ void LiveIntervals::print(raw_ostream &OS) const {
182182
OS << "********** INTERVALS **********\n";
183183

184184
// Dump the regunits.
185-
assert(RegUnitRanges.size() == TRI->getNumRegUnits());
186-
for (MCRegUnit Unit : TRI->regunits())
185+
for (unsigned Unit = 0, UnitE = RegUnitRanges.size(); Unit != UnitE; ++Unit)
187186
if (LiveRange *LR = RegUnitRanges[Unit])
188187
OS << printRegUnit(Unit, TRI) << ' ' << *LR << '\n';
189188

llvm/lib/CodeGen/LiveRegMatrix.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ void LiveRegMatrix::init(MachineFunction &MF, LiveIntervals &pLIS,
7575
void LiveRegMatrixWrapperLegacy::releaseMemory() { LRM.releaseMemory(); }
7676

7777
void LiveRegMatrix::releaseMemory() {
78-
assert(Matrix.size() == TRI->getNumRegUnits());
79-
for (MCRegUnit Unit : TRI->regunits()) {
80-
Matrix[Unit].clear();
78+
for (unsigned i = 0, e = Matrix.size(); i != e; ++i) {
79+
Matrix[i].clear();
8180
// No need to clear Queries here, since LiveIntervalUnion::Query doesn't
8281
// have anything important to clear and LiveRegMatrix's runOnFunction()
8382
// does a std::unique_ptr::reset anyways.

llvm/lib/CodeGen/ReachingDefAnalysis.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ void ReachingDefInfo::enterBasicBlock(MachineBasicBlock *MBB) {
155155
continue;
156156

157157
// Find the most recent reaching definition from a predecessor.
158-
for (MCRegUnit Unit : TRI->regunits())
158+
for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit)
159159
LiveRegs[Unit] = std::max(LiveRegs[Unit], Incoming[Unit]);
160160
}
161161

162162
// Insert the most recent reaching definition we found.
163-
for (MCRegUnit Unit : TRI->regunits())
163+
for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit)
164164
if (LiveRegs[Unit] != ReachingDefDefaultVal)
165165
MBBReachingDefs.append(MBBNumber, Unit, LiveRegs[Unit]);
166166
}
@@ -235,7 +235,7 @@ void ReachingDefInfo::reprocessBasicBlock(MachineBasicBlock *MBB) {
235235
if (Incoming.empty())
236236
continue;
237237

238-
for (MCRegUnit Unit : TRI->regunits()) {
238+
for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit) {
239239
int Def = Incoming[Unit];
240240
if (Def == ReachingDefDefaultVal)
241241
continue;
@@ -368,7 +368,7 @@ void ReachingDefInfo::traverse() {
368368
// Make sure reaching defs are sorted and unique.
369369
for (unsigned MBBNumber = 0, NumBlockIDs = MF->getNumBlockIDs();
370370
MBBNumber != NumBlockIDs; ++MBBNumber) {
371-
for (MCRegUnit Unit : TRI->regunits()) {
371+
for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit) {
372372
int LastDef = ReachingDefDefaultVal;
373373
for (int Def : MBBReachingDefs.defs(MBBNumber, Unit)) {
374374
assert(Def > LastDef && "Defs must be sorted and unique");

0 commit comments

Comments
 (0)