This is an archive of the discontinued LLVM Phabricator instance.

[LV][NFC] Factor out calculation of "best" estimated trip count.
ClosedPublic

Authored by ebrevnov on Sep 17 2019, 9:02 PM.

Details

Summary

This is just small refactoring to minimize changes in upcoming patch.
In the next path I'm going to introduce changes into heuristic for vectorization of "tiny trip count" loops.

Diff Detail

Event Timeline

ebrevnov created this revision.Sep 17 2019, 9:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2019, 9:02 PM
hsaito accepted this revision.Sep 17 2019, 11:18 PM

Nice clean up of the code as well. LGTM.

This revision is now accepted and ready to land.Sep 17 2019, 11:18 PM
Ayal added inline comments.Sep 18 2019, 1:57 AM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
372

nit: can simply check if (TC), or fold into

if (Optional<unsigned> TC = getLoopEstimatedTripCount(L))
  return TC;

as done above and below; possibly combining it with the previous if.

ebrevnov updated this revision to Diff 220648.Sep 18 2019, 4:48 AM

Fixed as requested by Ayal.

ebrevnov marked 2 inline comments as done.Sep 18 2019, 4:50 AM

Thanks Hideki & Ayal for quick response!
If you are satisfied with the current version please go ahead and commit it since I'm not permitted to do that myself.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
372

Thanks for noting. Done!

hsaito accepted this revision.Sep 18 2019, 12:48 PM

LGTM

ebrevnov marked an inline comment as done.Oct 10 2019, 4:57 AM

This one blocks subsequent patches. Could anyone assist in committing this one since I'm not a committer yet. Appreciated.

fhahn added a comment.Oct 10 2019, 5:34 AM

I can commit it in a bit.

This revision was automatically updated to reflect the committed changes.