Cloning basic blocks in the loop for runtime loop unroller depends on loop being
in rotated form (i.e. loop latch target is the exit block).
Assert that this is true, so that callers of runtime loop unroller pass in
canonical loops.
The single caller of this function has that check recently added:
https://reviews.llvm.org/rL301239
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Move the assert before the loop is being modified to support prolog/epilog remainders.
All tests passing.
LGTM.
lib/Transforms/Utils/LoopUnrollRuntime.cpp | ||
---|---|---|
515–521 ↗ | (On Diff #97628) | This seems like a natural extension of what I did. |
lib/Transforms/Utils/LoopUnrollRuntime.cpp | ||
---|---|---|
515–521 ↗ | (On Diff #97628) | Thanks, yes. I had spotted this implicit dependency (latch's successor is an exit) in the runtime unroller's clone function and was wondering if we can have such a situation where the dependency is not true. Sanjoy had pointed me to your fix (and test case) in the loop unroller. |
lib/Transforms/Utils/LoopUnrollRuntime.cpp | ||
---|---|---|
515–521 ↗ | (On Diff #97628) | Side note: ideally I'd like to teach the unroller to handle more complicated loops in the future rather than bailing out, but that would require more time than the one I can devote to the cause for the next 3 months at least. |