This is an archive of the discontinued LLVM Phabricator instance.

[NFC][PowerPC] Improve the for loop in Early Return
ClosedPublic

Authored by ZhangKang on Jun 25 2019, 6:34 PM.

Details

Summary

In PPCEarlyReturn.cpp

183       for (MachineFunction::iterator I = MF.begin(); I != MF.end();) {
184         MachineBasicBlock &B = *I++;
185         if (processBlock(B))
186           Changed = true;
187       }

Above code can be improved to:

184       for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E;) {
185         MachineBasicBlock &B = *I++;
186         Changed |= processBlock(B);
187       }

Diff Detail

Repository
rL LLVM

Event Timeline

ZhangKang created this revision.Jun 25 2019, 6:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2019, 6:34 PM
hfinkel accepted this revision.Jun 25 2019, 6:37 PM

LGTM

This revision is now accepted and ready to land.Jun 25 2019, 6:37 PM
ZhangKang edited the summary of this revision. (Show Details)Jun 25 2019, 6:51 PM
This revision was automatically updated to reflect the committed changes.