<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58749>58749</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] convert-math-to-spirv pass crashed with error "unimplemented types for ConstantOp::getOne()"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Colloportus0
      </td>
    </tr>
</table>

<pre>
    MLIR built at commit https://github.com/llvm/llvm-project/commit/6924a49690eee074f6c341d3ada4e98d640b8a7e

Reproduced with: 
`mlir-opt --convert-math-to-spirv temp.mlir`

[temp.mlir.txt](https://github.com/llvm/llvm-project/files/9915904/temp.mlir.txt)


crash trace:
```
unimplemented types for ConstantOp::getOne()
UNREACHABLE executed at /Users/haoyu/workspace/mlir-fuzz/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp:2078!
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 --convert-math-to-spirv temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt                 0x000000010534610c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1  mlir-opt                 0x0000000105346628 PrintStackTraceSignalHandler(void*) + 28
2  mlir-opt                 0x0000000105344738 llvm::sys::RunSignalHandlers() + 148
3  mlir-opt                 0x0000000105347ef8 SignalHandler(int) + 252
4  libsystem_platform.dylib 0x00000001a33254c4 _sigtramp + 56
5  libsystem_pthread.dylib  0x00000001a330dee0 pthread_kill + 288
6  libsystem_c.dylib        0x00000001a3248340 abort + 168
7  mlir-opt                 0x00000001051c7470 llvm::install_out_of_memory_new_handler() + 0
8  mlir-opt                 0x00000001072c56ac mlir::spirv::ConstantOp::getOne(mlir::Type, mlir::Location, mlir::OpBuilder&) + 828
9  mlir-opt                 0x0000000107edccb4 (anonymous namespace)::Log1pOpPattern<mlir::spirv::CLLogOp>::matchAndRewrite(mlir::math::Log1pOp, mlir::math::Log1pOpAdaptor, mlir::ConversionPatternRewriter&) const + 236
10 mlir-opt                 0x0000000107ec26b4 mlir::OpConversionPattern<mlir::math::Log1pOp>::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::Value>, mlir::ConversionPatternRewriter&) const + 176
11 mlir-opt                 0x0000000108ed4470 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const + 368
12 mlir-opt                 0x0000000109bd18e8 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1432
13 mlir-opt                 0x0000000108ef4f00 (anonymous namespace)::OperationLegalizer::legalizeWithPattern(mlir::Operation*, mlir::ConversionPatternRewriter&) + 328
14 mlir-opt                 0x0000000108ef4654 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) + 996
15 mlir-opt                 0x0000000108ef3c44 (anonymous namespace)::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) + 64
16 mlir-opt                 0x0000000108ed8128 (anonymous namespace)::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>, llvm::function_ref<void (mlir::Diagnostic&)>) + 568
17 mlir-opt                 0x0000000108ed7e58 mlir::applyPartialConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget&, mlir::FrozenRewritePatternSet const&, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>*) + 124
18 mlir-opt                 0x0000000108ed834c mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget&, mlir::FrozenRewritePatternSet const&, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>*) + 72
19 mlir-opt                 0x0000000107ef0964 (anonymous namespace)::ConvertMathToSPIRVPass::runOnOperation() + 396
20 mlir-opt                 0x0000000108d9c838 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 512
21 mlir-opt                 0x0000000108d9cf08 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 364
22 mlir-opt                 0x0000000108d9f0cc mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) + 108
23 mlir-opt                 0x0000000108d9eea0 mlir::PassManager::run(mlir::Operation*) + 732
24 mlir-opt                 0x0000000108d83b80 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 560
25 mlir-opt                 0x0000000108d83714 processBuffer(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, bool, bool, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) + 496
26 mlir-opt                 0x0000000108d834dc mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0::operator()(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const + 204
27 mlir-opt                 0x0000000108d833f0 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>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 80
28 mlir-opt                 0x0000000108f80700 llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::operator()(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const + 96
29 mlir-opt                 0x0000000108f801e4 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) + 128
30 mlir-opt                 0x0000000108d80e48 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 320
31 mlir-opt                 0x0000000108d81050 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool, bool) + 296
32 mlir-opt                 0x0000000108d81bfc mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 2888
33 mlir-opt                 0x0000000104b85df8 main + 148
34 dyld                     0x0000000121d2d088 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