Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeGen] Use range-based for loops (NFC) #97187

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/MachineSSAUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ Register LookForIdenticalPHI(MachineBasicBlock *BB,
return Register();

AvailableValsTy AVals;
for (unsigned i = 0, e = PredValues.size(); i != e; ++i)
AVals[PredValues[i].first] = PredValues[i].second;
for (const auto &[SrcBB, SrcReg] : PredValues)
AVals[SrcBB] = SrcReg;
while (I != BB->end() && I->isPHI()) {
bool Same = true;
for (unsigned i = 1, e = I->getNumOperands(); i != e; i += 2) {
Expand Down Expand Up @@ -196,8 +196,8 @@ Register MachineSSAUpdater::GetValueInMiddleOfBlock(MachineBasicBlock *BB,
InsertNewDef(TargetOpcode::PHI, BB, Loc, RegAttrs, MRI, TII);

// Fill in all the predecessors of the PHI.
for (unsigned i = 0, e = PredValues.size(); i != e; ++i)
InsertedPHI.addReg(PredValues[i].second).addMBB(PredValues[i].first);
for (const auto &[SrcBB, SrcReg] : PredValues)
InsertedPHI.addReg(SrcReg).addMBB(SrcBB);

// See if the PHI node can be merged to a single value. This can happen in
// loop cases when we get a PHI of itself and one other value.
Expand Down
Loading