Issue 203668
Summary [EmitC] [203455] Inconsistent handling of emitc.lvalue function arguments between mlir-opt and mlir-translate
Labels new issue
Assignees
Reporter Avaneethk
    mlir-opt accepts func.func arguments of type !emitc.lvalue<...>, but mlir-translate --mlir-to-cpp rejects the same IR.


Reproducer
func.func @member_access(
    %arg0: !emitc.lvalue<!emitc.opaque<"mystruct">>) {

  %0 = "emitc.member"(%arg0) {member = "a"}
      : (!emitc.lvalue<!emitc.opaque<"mystruct">>)
        -> !emitc.lvalue<i32>

  return
}
Commands
mlir-opt test.mlir

succeeds.

mlir-translate --mlir-to-cpp test.mlir

fails with

error: 'func.func' op cannot emit lvalue type as argument type
Expected behavior

Either

func.func verification should reject !emitc.lvalue argument types, making mlir-opt consistent with the translator,

or

the C++ translator should support emitting !emitc.lvalue function arguments.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to