Extract the code from LoopUnrollRuntime into utility function to
re-use it in D63923.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
IMO this seems like quite a specific function to add (there are other blocks that might be interesting to filter ). I think we could achieve the same thing with a filter_range on the caller side without much extra code and with it being slightly more explicit. But that’s quite subjective, so feel free to disregard.
Regarding tests, I think we have unit tests for most functions in LoopInfo, it would be good to add a test there for the new function too, if you decide to add it
Make getUniqueExitBlocksHelper more general with using filter predicate.
Unit test is added.
I decided to avoid using public API with predicate due to it will require introducing template function in template class and effectively moving implementation to LoopInfo.h
The explicit function for explicit need seems to be fine to me. If someone needs to introduce new function or move this to public API all building blocks are in place.