[Mlir-commits] [mlir] [mlir][ArmSME] Replace nested-region assertion in tile allocation with diagnostic (PR #181934)
Benjamin Maxwell
llvmlistbot at llvm.org
Wed Feb 18 00:53:17 PST 2026
================
@@ -343,24 +343,31 @@ struct LiveRange {
/// Operations are numbered consecutively wihin blocks, and the blocks are
/// topologically sorted (using forward edges). This function is only correct if
/// all ArmSME have been converted to CF (which is asserted).
-DenseMap<Operation *, unsigned>
+FailureOr<DenseMap<Operation *, unsigned>>
generateOperationNumbering(FunctionOpInterface function) {
unsigned index = 0;
SetVector<Block *> blocks =
getBlocksSortedByDominance(function.getFunctionBody());
DenseMap<Operation *, unsigned> operationToIndexMap;
+ bool sawNestedArmSMEOp = false;
for (Block *block : blocks) {
index++; // We want block args to have their own number.
for (Operation &op : block->getOperations()) {
-#ifndef NDEBUG
op.walk([&](ArmSMETileOpInterface nestedOp) {
- assert(&op == nestedOp.getOperation() &&
- "ArmSME tile allocation does not support nested regions");
+ if (&op == nestedOp.getOperation())
+ return;
+ nestedOp.emitError(
+ "ArmSME tile allocation requires flattened control flow; run "
+ "-convert-scf-to-cf before this pass (e.g. via "
+ "convert-arm-sme-to-llvm pipeline)");
+ sawNestedArmSMEOp = true;
----------------
MacDue wrote:
```suggestion
if (&op == nestedOp.getOperation())
return WalkResult::advance();
nestedOp.emitError(
"ArmSME tile allocation requires flattened control flow; run "
"-convert-scf-to-cf before this pass (e.g. via "
"convert-arm-sme-to-llvm pipeline)");
return WalkResult::interrupt();
```
https://github.com/llvm/llvm-project/pull/181934
More information about the Mlir-commits
mailing list