Skip to content

Commit 2015abf

Browse files
authored
Fix attr aliasing on region args (#389)
* Fix for aliasing the region args * Add test case * Add empty line
1 parent 3cd352b commit 2015abf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

mlir/lib/IR/AsmPrinter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ class DummyAliasOperationPrinter : private OpAsmPrinter {
779779
void printRegionArgument(BlockArgument arg, ArrayRef<NamedAttribute> argAttrs,
780780
bool omitType) override {
781781
printType(arg.getType());
782+
printOptionalAttrDict(argAttrs);
782783
// Visit the argument location.
783784
if (printerFlags.shouldPrintDebugInfo())
784785
// TODO: Allow deferring argument locations.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: mlir-opt %s | FileCheck %s
2+
3+
#map = affine_map<(d0) -> (d0)>
4+
// CHECK: {builtin.test = #map}
5+
func.func @test_attr_alias_on_region_attr(%arg0: memref<2xf32> {builtin.test = #map}) {
6+
%c0 = arith.constant 0 : index
7+
%c1 = arith.constant 0 : index
8+
%2 = memref.load %arg0[%c0] : memref<2xf32>
9+
memref.store %2, %arg0[%c1] : memref<2xf32>
10+
return
11+
}

0 commit comments

Comments
 (0)