Description
mlir-opt
crashes when trying to parse/build linalg.elemwise_unary
, the unreachable is being hit in ElemwiseUnaryOp::regionBuilder
Reproducer:
func.func @main(%arg0 : tensor<?xi32>) -> tensor<?xi32> {
%0 = linalg.elemwise_unary ins(%arg0 : tensor<?xi32>) outs(%arg0 : tensor<?xi32>) -> tensor<?xi32>
return %0 : tensor<?xi32>
}
Truncated stack-trace:
unsupported non numeric type
UNREACHABLE executed at /home/nod/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:421!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
#11 0x00005bd2e86a9532 (anonymous namespace)::RegionBuilderHelper::buildUnaryFn(mlir::linalg::UnaryFn, mlir::Value) /home/nod/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:0:7
#12 0x00005bd2e86a93f3 mlir::linalg::ElemwiseUnaryOp::regionBuilder(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>) /home/nod/llvm-project/build/Debug/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.cpp.inc:123:25
#13 0x00005bd2e8865694 void std::__invoke_impl<void, void (*&)(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>), mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>>(std::__invoke_other, void (*&)(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>), mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:7
#14 0x00005bd2e886560d std::enable_if<is_invocable_r_v<void, void (*&)(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>), mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>>, void>::type std::__invoke_r<void, void (*&)(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>), mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>>(void (*&)(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>), mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:117:5
#15 0x00005bd2e8865535 std::_Function_handler<void (mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>), void (*)(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>)>::_M_invoke(std::_Any_data const&, mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290:2
#16 0x00005bd2e8896661 std::function<void (mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>)>::operator()(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:2
#17 0x00005bd2e8896605 void llvm::function_ref<void (mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>)>::callback_fn<std::function<void (mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>)>>(long, mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>) /home/nod/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#18 0x00005bd2e88653b9 llvm::function_ref<void (mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>)>::operator()(mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>) const /home/nod/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
Full stacktrace here: https://gist.github.com/IanWood1/8f4d9c3d613c81b7490cac37872e8fe4
Commit: 746d8b0