I meet a problem when use mlir-cpu-runner show Unknown type!

here is my code

func.func @main() {
  %c1 = arith.constant 1 : index 
  %c10 = arith.constant 10 : index 
  %c100 = arith.constant 100 : index 
  %cst0 = arith.constant 0 : i32
  %cst1 = arith.constant 1 : i32
  %cst2 = arith.constant 2 : i32
  %mem = memref.alloc() : memref<100xi32>
  %mem_cast = memref.cast %mem : memref<100xi32> to memref<*xi32>
  gpu.host_register %mem_cast : memref<*xi32>
  gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c1, %grid_y = %c1, %grid_z = %c1) 
             threads(%tx, %ty, %tz) in (%block_x = %c100, %block_y = %c1, %block_z = %c1) {
      memref.store %cst0, %mem[%tx] : memref<100xi32>
      gpu.terminator
  }
  call @printMemrefI32(%mem_cast) : (memref<*xi32>) -> ()  
  %t0, %r0 = async.execute() -> !async.value<memref<100xi32>> {
   %b0 = gpu.alloc() : memref<100xi32>
    gpu.memcpy %b0, %mem : memref<100xi32>, memref<100xi32>
    async.yield %b0 : memref<100xi32>
  }
  return 
}
func.func private @printMemrefI32(%ptr : memref<*xi32>)

I encounter the problem when input

mlir-opt async-execute.mlir -gpu-kernel-outlining \
		-pass-pipeline='gpu.module(strip-debuginfo,convert-gpu-to-nvvm,gpu-to-cubin)' \
		-gpu-async-region -gpu-to-llvm -async-to-async-runtime -async-runtime-ref-counting \
    -convert-async-to-llvm -convert-func-to-llvm | \
mlir-cpu-runner -entry-point-result=void -shared-libs=${MLIR_RUNNER_UTILS} -shared-libs=${MLIR_CUDA_RUNTIME} \
	-shared-libs=${MLIR_ASYNC_RUNTIME}

it shows

Unknown type!
UNREACHABLE executed at  llvm/llvm/lib/CodeGen/ValueTypes.cpp:545!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

I don’t know how to solve the problem, hope someone can help me, thanks!

Hi, i found that i add a opt-flag O0 the problem will be solved, but i don’t konw the reason.

This looks like a bug and should be reported here: Issues · llvm/llvm-project · GitHub
There shouldn’t be an assertion regardless of the -O setting.

oh! I test O0, O1, O2, the don’t meet the problem, but if i don’t use the opt-flag, this problem still occurs.Is this still a bug?

Yes, with or without an O flag, that assertion would be a bug.