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(
1351
1351
// / nested sequence of loops in 'loops' would violate dependences.
1352
1352
bool mlir::affine::isValidLoopInterchangePermutation (
1353
1353
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 ;
1354
1358
// Gather dependence components for dependences between all ops in loop nest
1355
1359
// rooted at 'loops[0]', at loop depths in range [1, maxLoopDepth].
1356
- assert (loopPermMap.size () == loops.size ());
1357
- unsigned maxLoopDepth = loops.size ();
1358
1360
std::vector<SmallVector<DependenceComponent, 2 >> depCompsVec;
1359
1361
getDependenceComponents (loops[0 ], maxLoopDepth, &depCompsVec);
1360
1362
return checkLoopInterchangeDependences (depCompsVec, loops, loopPermMap);
You can’t perform that action at this time.
0 commit comments