cloneLoopWithPreheader() currently only support innermost loop, and assert otherwise.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/lib/Transforms/Utils/CloneFunction.cpp | ||
---|---|---|
744 | Consider using DenseMap. | |
772 | [style] I like getting a reference that can be updated instead of another map lookup. I.e. Loop *&NewLoop = LMap[CurLoop]; ... NewLoop = LI->AllocateLoop(); | |
777–778 | [serious] Since the iteration order of OrigLoop->getBlocks() is undefined, we might get a block that is nested in two loops without having visited the parent first, i.e. NewParentLoop would be null in this case. Consider iterating over LoopInfo's loop tree before iterating over all block to ensure that the new loop structure has been created. |
llvm/lib/Transforms/Utils/CloneFunction.cpp | ||
---|---|---|
777–778 | Good catch! Modified as suggested. |
Consider using DenseMap.