diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index 5d0eb7670b3bd4..b180f082fb9f7e 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -779,6 +779,7 @@ class DummyAliasOperationPrinter : private OpAsmPrinter { void printRegionArgument(BlockArgument arg, ArrayRef argAttrs, bool omitType) override { printType(arg.getType()); + printOptionalAttrDict(argAttrs); // Visit the argument location. if (printerFlags.shouldPrintDebugInfo()) // TODO: Allow deferring argument locations. diff --git a/mlir/test/IR/test-region-attr-aliasing.mlir b/mlir/test/IR/test-region-attr-aliasing.mlir new file mode 100644 index 00000000000000..ed1d2bd823471d --- /dev/null +++ b/mlir/test/IR/test-region-attr-aliasing.mlir @@ -0,0 +1,11 @@ +// RUN: mlir-opt %s | FileCheck %s + +#map = affine_map<(d0) -> (d0)> +// CHECK: {builtin.test = #map} +func.func @test_attr_alias_on_region_attr(%arg0: memref<2xf32> {builtin.test = #map}) { + %c0 = arith.constant 0 : index + %c1 = arith.constant 0 : index + %2 = memref.load %arg0[%c0] : memref<2xf32> + memref.store %2, %arg0[%c1] : memref<2xf32> + return +}