aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--mlir/lib/Transforms/Utils/LoopUtils.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp
index c0eb9cd..fbb79b5 100644
--- a/mlir/lib/Transforms/Utils/LoopUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp
@@ -407,7 +407,7 @@ LogicalResult mlir::affineForOpBodySkew(AffineForOp forOp,
lbShift = d * step;
}
// Augment the list of operations that get into the current open interval.
- opGroupQueue.push_back({d, sortedOpGroups[d]});
+ opGroupQueue.emplace_back(d, sortedOpGroups[d]);
}
// Those operations groups left in the queue now need to be processed (FIFO)
@@ -1370,7 +1370,7 @@ struct JamBlockGatherer {
while (it != e && !isa<AffineForOp>(&*it))
++it;
if (it != subBlockStart)
- subBlocks.push_back({subBlockStart, std::prev(it)});
+ subBlocks.emplace_back(subBlockStart, std::prev(it));
// Process all for ops that appear next.
while (it != e && isa<AffineForOp>(&*it))
walk(&*it++);
@@ -1608,8 +1608,7 @@ static bool checkLoopInterchangeDependences(
// lexicographically negative.
// Example 1: [-1, 1][0, 0]
// Example 2: [0, 0][-1, 1]
- for (unsigned i = 0, e = depCompsVec.size(); i < e; ++i) {
- const SmallVector<DependenceComponent, 2> &depComps = depCompsVec[i];
+ for (const auto &depComps : depCompsVec) {
assert(depComps.size() >= maxLoopDepth);
// Check if the first non-zero dependence component is positive.
// This iterates through loops in the desired order.
@@ -1748,8 +1747,7 @@ AffineForOp mlir::sinkSequentialLoops(AffineForOp forOp) {
// Mark loops as either parallel or sequential.
SmallVector<bool, 8> isParallelLoop(maxLoopDepth, true);
- for (unsigned i = 0, e = depCompsVec.size(); i < e; ++i) {
- SmallVector<DependenceComponent, 2> &depComps = depCompsVec[i];
+ for (auto &depComps : depCompsVec) {
assert(depComps.size() >= maxLoopDepth);
for (unsigned j = 0; j < maxLoopDepth; ++j) {
DependenceComponent &depComp = depComps[j];
@@ -3181,7 +3179,7 @@ gatherLoopsInBlock(Block *block, unsigned currLoopDepth,
// Add a new empty level to output if it doesn't exist level already.
assert(currLoopDepth <= depthToLoops.size() && "Unexpected currLoopDepth");
if (currLoopDepth == depthToLoops.size())
- depthToLoops.push_back(SmallVector<AffineForOp, 2>());
+ depthToLoops.emplace_back();
for (auto &op : *block) {
if (auto forOp = dyn_cast<AffineForOp>(op)) {