File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
mlir/lib/Dialect/Affine/Utils Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1351,10 +1351,12 @@ static bool checkLoopInterchangeDependences(
13511351// / nested sequence of loops in 'loops' would violate dependences.
13521352bool mlir::affine::isValidLoopInterchangePermutation (
13531353 ArrayRef<AffineForOp> loops, ArrayRef<unsigned > loopPermMap) {
1354+ assert (loopPermMap.size () == loops.size () && " invalid loop perm map" );
1355+ unsigned maxLoopDepth = loops.size ();
1356+ if (maxLoopDepth == 1 )
1357+ return true ;
13541358 // Gather dependence components for dependences between all ops in loop nest
13551359 // rooted at 'loops[0]', at loop depths in range [1, maxLoopDepth].
1356- assert (loopPermMap.size () == loops.size ());
1357- unsigned maxLoopDepth = loops.size ();
13581360 std::vector<SmallVector<DependenceComponent, 2 >> depCompsVec;
13591361 getDependenceComponents (loops[0 ], maxLoopDepth, &depCompsVec);
13601362 return checkLoopInterchangeDependences (depCompsVec, loops, loopPermMap);
You can’t perform that action at this time.
0 commit comments