Page MenuHomePhabricator

[LoopUtils][NFC] Minor refactoring in getLoopEstimatedTripCount.
ClosedPublic

Authored by ebrevnov on Dec 30 2019, 11:41 PM.

Details

Reviewers
Ayal
Summary

Split out of https://reviews.llvm.org/D71990. Minor stuff like renaming and introduction of divideNearest utility.

Event Timeline

ebrevnov created this revision.Dec 30 2019, 11:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2019, 11:41 PM
Ayal added inline comments.Dec 31 2019, 5:38 AM
llvm/lib/Transforms/Utils/LoopUtils.cpp
717–718

Can we agree on BackedgeTakenWeight and LatchExitWeight? They directly correspond to "the number of times the backedge was taken" and "the number of times we exited the loop" documented above, and the comment removed below.

725

(Above early exit can precede the swap, but agree it's better to first set the variables to their correct meaning.)

726–729

Original "// Divide the count ..." comment removed deliberately?

ebrevnov marked 4 inline comments as done.Jan 8 2020, 9:46 PM
ebrevnov added inline comments.
llvm/lib/Transforms/Utils/LoopUtils.cpp
717–718

Works for me.

726–729

Restored.

ebrevnov updated this revision to Diff 236963.Jan 8 2020, 9:47 PM
ebrevnov marked 2 inline comments as done.

Comments addressed.

Ayal accepted this revision.Jan 9 2020, 12:39 AM

This looks good to me, thanks!

This revision is now accepted and ready to land.Jan 9 2020, 12:39 AM
ebrevnov closed this revision.Jan 9 2020, 2:22 AM

ebrevnov committed rGf0abe820eebf: [LoopUtils][NFC] Minor refactoring in getLoopEstimatedTripCount. (authored by ebrevnov).