This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Compute trip multiple for multiple exit loops
ClosedPublic

Authored by reames on May 26 2021, 11:03 AM.

Details

Summary

This patch implements getSmallConstantTripMultiple(L) correctly for multiple exit loops. The previous implementation was both imprecise, and violated the specified behavior of the method. This was fine in practice, because it turns out the function was both dead in real code, and not tested for the multiple exit case.

Diff Detail

Event Timeline

reames created this revision.May 26 2021, 11:03 AM
reames requested review of this revision.May 26 2021, 11:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2021, 11:03 AM
reames edited the summary of this revision. (Show Details)May 26 2021, 11:19 AM
nikic accepted this revision.May 26 2021, 11:41 AM

LGTM

llvm/lib/Analysis/ScalarEvolution.cpp
6985

Could be written as return Res.getValueOr(1). Feel free to keep it keep as-is though.

This revision is now accepted and ready to land.May 26 2021, 11:41 AM
This revision was automatically updated to reflect the committed changes.