Preserve argument locations when cloning a region.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks!
Can you add a test?
This should do it:
// Test block arguments location propagation.
// Use two call-sites to force cloning.
func @func_with_block_args_location(%arg0 : i32) {
br ^bb1(%arg0 : i32)
^bb1(%x : i32 loc("foo")):
"test.foo" (%x) : (i32) -> () loc("bar")
return
}
// INLINE-LOC-LABEL: func @func_with_block_args_location_callee1
// INLINE-LOC: br
// INLINE-LOC: ^bb{{[0-9]+}}(%{{.*}}: i32 loc("foo")
func @func_with_block_args_location_callee1(%arg0 : i32) {
call @func_with_block_args_location(%arg0) : (i32) -> ()
return
}
// CHECK-LABEL: func @func_with_block_args_location_callee2
func @func_with_block_args_location_callee2(%arg0 : i32) {
call @func_with_block_args_location(%arg0) : (i32) -> ()
return
}in mlir/test/Transforms/inlining.mlir