@@ -344,7 +344,7 @@ static LogicalResult getFuncOpsOrderedByCalls(
344
344
}
345
345
346
346
// Put all other functions in the list of remaining functions. These are
347
- // functions that call each each circularly.
347
+ // functions that call each other circularly.
348
348
for (auto it : numberCallOpsContainedInFuncOp)
349
349
remainingFuncOps.push_back (it.first );
350
350
@@ -387,8 +387,13 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
387
387
" expected that function boundary bufferization is activated" );
388
388
FuncAnalysisState &funcState = getOrCreateFuncAnalysisState (state);
389
389
390
- // A list of functions in the order in which they are analyzed + bufferized.
391
- SmallVector<func::FuncOp> orderedFuncOps, remainingFuncOps;
390
+ // A list of non-circular functions in the order in which they are analyzed
391
+ // and bufferized.
392
+ SmallVector<func::FuncOp> orderedFuncOps;
393
+ // A list of all other functions. I.e., functions that call each other
394
+ // recursively. For these, we analyze the function body but not the function
395
+ // boundary.
396
+ SmallVector<func::FuncOp> remainingFuncOps;
392
397
393
398
// A mapping of FuncOps to their callers.
394
399
FuncCallerMap callerMap;
@@ -397,8 +402,8 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
397
402
remainingFuncOps, callerMap)))
398
403
return failure ();
399
404
400
- // Analyze ops in order. Starting with functions that are not calling any
401
- // other functions.
405
+ // Analyze functions in order. Starting with functions that are not calling
406
+ // any other functions.
402
407
for (func::FuncOp funcOp : orderedFuncOps) {
403
408
if (!state.getOptions ().isOpAllowed (funcOp))
404
409
continue ;
@@ -422,7 +427,7 @@ mlir::bufferization::analyzeModuleOp(ModuleOp moduleOp,
422
427
funcState.analyzedFuncOps [funcOp] = FuncOpAnalysisState::Analyzed;
423
428
}
424
429
425
- // Analyze all other ops .
430
+ // Analyze all other functions. All function boundary analyses are skipped .
426
431
for (func::FuncOp funcOp : remainingFuncOps) {
427
432
if (!state.getOptions ().isOpAllowed (funcOp))
428
433
continue ;
@@ -459,8 +464,13 @@ LogicalResult mlir::bufferization::bufferizeModuleOp(
459
464
" expected that function boundary bufferization is activated" );
460
465
IRRewriter rewriter (moduleOp.getContext ());
461
466
462
- // A list of functions in the order in which they are analyzed + bufferized.
463
- SmallVector<func::FuncOp> orderedFuncOps, remainingFuncOps;
467
+ // A list of non-circular functions in the order in which they are analyzed
468
+ // and bufferized.
469
+ SmallVector<func::FuncOp> orderedFuncOps;
470
+ // A list of all other functions. I.e., functions that call each other
471
+ // recursively. For these, we analyze the function body but not the function
472
+ // boundary.
473
+ SmallVector<func::FuncOp> remainingFuncOps;
464
474
465
475
// A mapping of FuncOps to their callers.
466
476
FuncCallerMap callerMap;
0 commit comments