cloneLoopWithPreheader() currently only support innermost loop, and assert otherwise.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/CloneFunction.cpp | ||
---|---|---|
744 | Consider using DenseMap. | |
771 | [style] I like getting a reference that can be updated instead of another map lookup. I.e. Loop *&NewLoop = LMap[CurLoop]; ... NewLoop = LI->AllocateLoop(); | |
776–777 | [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 | ||
---|---|---|
776–777 | Good catch! Modified as suggested. |
Consider using DenseMap.