<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64257>64257</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] `arith-int-narrowing` pass crashed with assertion failure.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Colloportus0
</td>
</tr>
</table>
<pre>
MLIR built at commit b4c54b20
Reproduced with:
` mlir-opt --arith-int-narrowing temp.mlir`
trace:
```console
Assertion failed: (!supportedBitwidths.empty() && "Invalid options"), function NarrowingPattern, file IntNarrowing.cpp, line 50.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: mlir-opt --arith-int-narrowing temp.mlir
#0 0x0000000102324548 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f8548)
#1 0x00000001023227e4 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f67e4)
#2 0x0000000102324bf4 SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f8bf4)
#3 0x00000001a46cd4c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001a46b5ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001a45f0340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001a45ef754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x00000001061b2eb8 mlir::arith::populateArithIntNarrowingPatterns(mlir::RewritePatternSet&, mlir::arith::ArithIntNarrowingOptions const&) (.cold.2) (/workspace/build/bin/mlir-opt+0x104186eb8)
#8 0x0000000102571838 mlir::arith::populateArithIntNarrowingPatterns(mlir::RewritePatternSet&, mlir::arith::ArithIntNarrowingOptions const&) (/workspace/build/bin/mlir-opt+0x100545838)
#9 0x0000000102573984 mlir::arith::(anonymous namespace)::ArithIntNarrowingPass::runOnOperation() (/workspace/build/bin/mlir-opt+0x100547984)
#10 0x00000001049ade34 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102981e34)
#11 0x00000001049ae524 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102982524)
#12 0x00000001049b03bc mlir::PassManager::run(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x1029843bc)
#13 0x00000001049a8808 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x10297c808)
#14 0x00000001049a7d30 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (/workspace/build/bin/mlir-opt+0x10297bd30)
#15 0x0000000104a26be0 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/workspace/build/bin/mlir-opt+0x1029fabe0)
#16 0x00000001049a26e4 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x1029766e4)
#17 0x00000001049a2b54 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x102976b54)
#18 0x000000010202f58c main (/workspace/build/bin/mlir-opt+0x10000358c)
#19 0x000000010d811088
```
or reproduced with:
` mlir-opt --arith-int-narrowing temp.mlir`
trace
```console
Assertion failed: (!llvm::is_contained(supportedBitwidths, 0) && "Invalid bitwidth"), function NarrowingPattern, file IntNarrowing.cpp, line 51.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: mlir-opt --arith-int-narrowing=int-bitwidths-supported=0 temp.mlir
#0 0x0000000100c70548 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f8548)
#1 0x0000000100c6e7e4 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f67e4)
#2 0x0000000100c70bf4 SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f8bf4)
#3 0x00000001a46cd4c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001a46b5ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001a45f0340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001a45ef754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x0000000104aff704 mlir::RewritePatternSet& mlir::RewritePatternSet::add<mlir::arith::(anonymous namespace)::AddIPattern, mlir::arith::(anonymous namespace)::SubIPattern, mlir::arith::(anonymous namespace)::MulIPattern, mlir::arith::(anonymous namespace)::DivSIPattern, mlir::arith::(anonymous namespace)::DivUIPattern, mlir::arith::(anonymous namespace)::MinMaxPattern<mlir::arith::MaxSIOp, (mlir::arith::(anonymous namespace)::ExtensionKind)0>, mlir::arith::(anonymous namespace)::MinMaxPattern<mlir::arith::MaxUIOp, (mlir::arith::(anonymous namespace)::ExtensionKind)1>, mlir::arith::(anonymous namespace)::MinMaxPattern<mlir::arith::MinSIOp, (mlir::arith::(anonymous namespace)::ExtensionKind)0>, mlir::arith::(anonymous namespace)::MinMaxPattern<mlir::arith::MinUIOp, (mlir::arith::(anonymous namespace)::ExtensionKind)1>, mlir::arith::(anonymous namespace)::IToFPPattern<mlir::arith::SIToFPOp, (mlir::arith::(anonymous namespace)::ExtensionKind)0>, mlir::arith::(anonymous namespace)::IToFPPattern<mlir::arith::UIToFPOp, (mlir::arith::(anonymous namespace)::ExtensionKind)1>, mlir::arith::(anonymous namespace)::IndexCastPattern<mlir::arith::IndexCastOp, (mlir::arith::(anonymous namespace)::ExtensionKind)0>, mlir::arith::(anonymous namespace)::IndexCastPattern<mlir::arith::IndexCastUIOp, (mlir::arith::(anonymous namespace)::ExtensionKind)1>, mlir::MLIRContext*, mlir::arith::ArithIntNarrowingOptions const&, void>(mlir::MLIRContext*&&, mlir::arith::ArithIntNarrowingOptions const&) (.cold.1) (/workspace/build/bin/mlir-opt+0x104187704)
#8 0x0000000100ebd8b0 mlir::arith::populateArithIntNarrowingPatterns(mlir::RewritePatternSet&, mlir::arith::ArithIntNarrowingOptions const&) (/workspace/build/bin/mlir-opt+0x1005458b0)
#9 0x0000000100ebf984 mlir::arith::(anonymous namespace)::ArithIntNarrowingPass::runOnOperation() (/workspace/build/bin/mlir-opt+0x100547984)
#10 0x00000001032f9e34 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102981e34)
#11 0x00000001032fa524 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102982524)
#12 0x00000001032fc3bc mlir::PassManager::run(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x1029843bc)
#13 0x00000001032f4808 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x10297c808)
#14 0x00000001032f3d30 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (/workspace/build/bin/mlir-opt+0x10297bd30)
#15 0x0000000103372be0 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/workspace/build/bin/mlir-opt+0x1029fabe0)
#16 0x00000001032ee6e4 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x1029766e4)
#17 0x00000001032eeb54 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x102976b54)
#18 0x000000010097b58c main (/workspace/build/bin/mlir-opt+0x10000358c)
#19 0x000000010c0dd088
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.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