It replaces DenseMap output with a SmallVector and it
removes empty loop levels from the output.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
1808 | Why is this pop_back() needed now? Or do you just view this as an "optimization"? |
Thanks!
mlir/lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
1808 | This is not to keep an empty level around in the output. For example, let's say we have two nested loops in a function. The algorithm would proceed as follows:
I'm now thinking that I could move this removal to the public 'gatherLoops' function so that it's only executed once since the empty level will always be one and the last one in the output vector, no matter how many or the structure of the loop nests visited. |
mlir/test/lib/Transforms/TestAffineDataCopy.cpp | ||
---|---|---|
46 | Typically we don't see SmallVector<SmallVector. These patterns are typically std::vector<SmallVector. |
mlir/test/lib/Transforms/TestAffineDataCopy.cpp | ||
---|---|---|
46 | Thanks Andy! I'll change that before committing. For my understanding, I'm not sure I follow the rationale. Isn't this one of the ideal cases for SmallVector? I.e., the object to be contained has a "large" memory footprint (a SmallVector with two op elements, in this case) and we want to avoid allocating unnecessary slots? |
Why is this pop_back() needed now? Or do you just view this as an "optimization"?