With this patch the getLoopEstimatedTripCount function will
accept also the loops where there are more than one exit but
all exits except latch block should ends up with a call to deopt.
This side exits should not impact the estimated trip count.
Differential D64553
[LoopUtils] Extend the scope of getLoopEstimatedTripCount skatkov on Jul 11 2019, 3:32 AM. Authored by
Details With this patch the getLoopEstimatedTripCount function will This side exits should not impact the estimated trip count.
Diff Detail
Event Timeline
Comment Actions The tests using this functionality can be found in https://reviews.llvm.org/D63923 and https://reviews.llvm.org/D64618 or you need a separate unit test? Comment Actions LGTM w/required fix before submit.
|
I'm seeing Assertion 'L->hasDedicatedExits() && "getUniqueExitBlocks assumes the loop has canonical form exits!"' failed. with some out-of-tree code that calls getLoopEstimatedTripCount. Does this analysis really require that the loop has dedicated exits? If it does, can we guard this call so getLoopEstimatedTripCount fails gracefully for loops without dedicated exits?
I think all the in-tree users of getLoopEstimatedTripCount require dedicated exits for other reasons, so no bug report.