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
- Build Status
Buildable 6103 Build 6103: arc lint + arc unit
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 | This seems like a natural extension of what I did. |
lib/Transforms/Utils/LoopUnrollRuntime.cpp | ||
---|---|---|
515–521 | 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 | 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. |
This seems like a natural extension of what I did.
I think the fact that the other successor is the header is given by the definition of a latch, so we should be fine with this.