This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Replace while loop with for loop
ClosedPublic

Authored by thakis on Jun 21 2022, 12:17 PM.

Details

Reviewers
tschuett
Group Reviewers
Restricted Project
Commits
rG3ade3d372408: [lld/mac] Replace while loop with for loop
Summary

No behavior change. In preparation for using a parallelFor() here.

Diff Detail

Event Timeline

thakis created this revision.Jun 21 2022, 12:17 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 21 2022, 12:17 PM
thakis requested review of this revision.Jun 21 2022, 12:17 PM

Nit. Your are not allowed to check getBlockCount() for every iteration. Pull it out of the loop?

Nit. Your are not allowed to check getBlockCount() for every iteration. Pull it out of the loop?

I don't understand what this means. Do you mean i < getBlockCount() in the loop conditional? Pretty sure all compilers strength-reduce this (e.g. https://godbolt.org/z/qjMW6cErh)

(in any case, it's irrelevant after D128298)

This revision is now accepted and ready to land.Jun 21 2022, 12:41 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 12:45 PM