Skip to content

Commit e074eb2

Browse files
committed
[Technical debt] Remove compiler warnings for unused variable
1 parent 13fbd6a commit e074eb2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

llvm/lib/Target/AIE/AIELiveRegs.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,17 @@ void LiveRegs::computeBlockLiveIns(const MachineBasicBlock *MBB,
5353
}
5454

5555
bool LiveRegs::equal(LivePhysRegs &CurrentLive, LivePhysRegs &OldLive) {
56-
int LiveInCount = 0;
57-
bool Equal = true;
58-
56+
auto CurrentLiveIt = CurrentLive.begin();
5957
for (const MCPhysReg Reg : OldLive) {
6058
if (!CurrentLive.contains(Reg)) {
61-
Equal = false;
59+
return false;
6260
}
63-
LiveInCount++;
61+
if (CurrentLiveIt == CurrentLive.end())
62+
return false;
63+
++CurrentLiveIt;
6464
}
6565

66-
for (const MCPhysReg Reg : CurrentLive) {
67-
LiveInCount--;
68-
}
69-
return LiveInCount == 0 && Equal;
66+
return CurrentLiveIt == CurrentLive.end() ? true : false;
7067
}
7168

7269
void LiveRegs::updateLiveRegs(LivePhysRegs &CurrentLive,

0 commit comments

Comments
 (0)