| Issue |
203229
|
| Summary |
[mlir][convert-arith-to-spirv] mlir-opt crashes at BuiltinAttributes.cpp.inc:403 with assertion `value.getBitWidth() == intTy.getWidth() && "IntegerAttr::get: APInt bit width must match integer type width"' failed.
|
| Labels |
|
| Assignees |
|
| Reporter |
Aran-414
|
git version: e6db723ce7b1e43327d265081f7e5818194569a0
MLIR Program:
```mlir
module {
func.func @rewrite_fp8_tensor() -> tensor<2xf8E4M3FN> {
%cst = arith.constant dense<[1.000000e+00, -5.000000e-01]> : tensor<2xf8E4M3FN>
return %cst : tensor<2xf8E4M3FN>
}
}
```
Reproduce Command: `mlir-opt -convert-arith-to-spirv a.mlir`
StackTrace:
```
mlir-opt: /data2/dependency/dev/llvm-project/build/tools/mlir/include/mlir/IR/BuiltinAttributes.cpp.inc:403: static mlir::IntegerAttr mlir::IntegerAttr::get(mlir::Type, const llvm::APInt&): Assertion `value.getBitWidth() == intTy.getWidth() && "IntegerAttr::get: APInt bit width must match integer type width"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /data2/dependency/dev/llvm-project/build/bin/mlir-opt -convert-arith-to-spirv a.mlir
#0 0x0000561d60f79dbf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25d9dbf)
#1 0x0000561d60f7648c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25d648c)
#2 0x0000561d60f76627 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f2002946420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f200243100b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f2002410859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f2002410729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f2002421fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x0000561d6a013499 mlir::IntegerAttr::get(mlir::Type, llvm::APInt const&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb673499)
#9 0x0000561d6579a554 getIntegerAttrFromFloatAttr(mlir::FloatAttr, mlir::Type, mlir::ConversionPatternRewriter&) ArithToSPIRV.cpp:0:0
#10 0x0000561d657b6296 (anonymous namespace)::ConstantCompositeOpPattern::matchAndRewrite(mlir::arith::ConstantOp, mlir::arith::ConstantOpAdaptor, mlir::ConversionPatternRewriter&) const ArithToSPIRV.cpp:0:0
#11 0x0000561d6285e545 llvm::LogicalResult mlir::ConversionPattern::dispatchTo1To1<mlir::OpConversionPattern<mlir::arith::ConstantOp>, mlir::arith::ConstantOp>(mlir::OpConversionPattern<mlir::arith::ConstantOp> const&, mlir::arith::ConstantOp, mlir::arith::ConstantOp::GenericAdaptor<llvm::ArrayRef<mlir::ValueRange>>, mlir::ConversionPatternRewriter&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x3ebe545)
#12 0x0000561d6285e6a6 mlir::OpConversionPattern<mlir::arith::ConstantOp>::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::ValueRange>, mlir::ConversionPatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x3ebe6a6)
#13 0x0000561d69c853e8 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb2e53e8)
#14 0x0000561d69ccc142 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::'lambda'()::operator()() const PatternApplicator.cpp:0:0
#15 0x0000561d69ccd638 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb32d638)
#16 0x0000561d69c7ffab (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*) DialectConversion.cpp:0:0
#17 0x0000561d69c804a6 mlir::OperationConverter::convert(mlir::Operation*, bool) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb2e04a6)
#18 0x0000561d69c8b4aa mlir::OperationConverter::applyConversion(llvm::ArrayRef<mlir::Operation*>) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb2eb4aa)
#19 0x0000561d69c8cda8 applyConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode) DialectConversion.cpp:0:0
#20 0x0000561d69c8cf86 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb2ecf86)
#21 0x0000561d657b4bfb (anonymous namespace)::ConvertArithToSPIRVPass::runOnOperation() ArithToSPIRV.cpp:0:0
#22 0x0000561d69d38861 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb398861)
#23 0x0000561d69d38bf0 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb398bf0)
#24 0x0000561d69d3aca4 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb39aca4)
#25 0x0000561d69d3bd31 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb39bd31)
#26 0x0000561d610409ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#27 0x0000561d61041453 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, mlir::SourceMgrDiagnosticVerifierHandler*, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#28 0x0000561d610416db llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#29 0x0000561d6a115a15 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb775a15)
#30 0x0000561d61037384 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (.part.0) MlirOptMain.cpp:0:0
#31 0x0000561d61041bf7 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x26a1bf7)
#32 0x0000561d61041e33 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x26a1e33)
#33 0x0000561d60e77abc main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x24d7abc)
#34 0x00007f2002412083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#35 0x0000561d60f562be _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25b62be)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs