Skip to content

[PYCDE] Assertion failed: "incorrect fold result type" during operation folding via Python API #9043

@AnZhong24

Description

@AnZhong24

I encounter a crash when using PYCDE tool.
My original file is quite large, and unfortunately, it's been difficult to create a minimal reproducer. I've attached the full stack trace, and I hope it can provide some initial clues. Please let me know if there's any other information I can provide to help debug this.
Many thanks for your time and help!

The crash backtrace is as follows:

python: /project/llvm/mlir/lib/IR/Operation.cpp:626: void checkFoldResultTypes(mlir::Operation*, llvm::SmallVectorImpl<mlir::OpFoldResult>&): Assertion `false && "incorrect fold result type"' failed.
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  libPyCDE_CIRCTPythonCAPI.so 0x00007f659da0b588 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40
1  libPyCDE_CIRCTPythonCAPI.so 0x00007f659da07ea5
2  libc.so.6                   0x00007f65a1c05520
3  libc.so.6                   0x00007f65a1c599fc pthread_kill + 300
4  libc.so.6                   0x00007f65a1c05476 raise + 22
5  libc.so.6                   0x00007f65a1beb7f3 abort + 211
6  libc.so.6                   0x00007f65a1beb71b
7  libc.so.6                   0x00007f65a1bfce96
8  libPyCDE_CIRCTPythonCAPI.so 0x00007f659db95c0c
9  libPyCDE_CIRCTPythonCAPI.so 0x00007f659db96ab8 mlir::Operation::fold(llvm::ArrayRef<mlir::Attribute>, llvm::SmallVectorImpl<mlir::OpFoldResult>&) + 72
10 libPyCDE_CIRCTPythonCAPI.so 0x00007f659db96db3 mlir::Operation::fold(llvm::SmallVectorImpl<mlir::OpFoldResult>&) + 547
11 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dafbb54 mlir::OpBuilder::tryFold(mlir::Operation*, llvm::SmallVectorImpl<mlir::Value>&, llvm::SmallVectorImpl<mlir::Operation*>*) + 308
12 libPyCDE_CIRCTPythonCAPI.so 0x00007f659eafd160
13 libPyCDE_CIRCTPythonCAPI.so 0x00007f659eafd823 mlir::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) + 35
14 libPyCDE_CIRCTPythonCAPI.so 0x00007f659eaff25c mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) + 316
15 libPyCDE_CIRCTPythonCAPI.so 0x00007f659eb01643 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) + 131
16 libPyCDE_CIRCTPythonCAPI.so 0x00007f659e82dbb1
17 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dc0d8e1 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 1249
18 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dc0dd3a mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 362
19 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dc0e0ae
20 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dc0e27f
21 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dbbebce
22 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dbbf31b
23 libc.so.6                   0x00007f65a1c5cee8
24 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dbbf29e
25 libPyCDE_CIRCTPythonCAPI.so 0x00007f659dbbf8af
26 libPyCDE_CIRCTPythonCAPI.so 0x00007f659d9ec16b llvm::StdThreadPool::processTasks(llvm::ThreadPoolTaskGroup*) + 555
27 libPyCDE_CIRCTPythonCAPI.so 0x00007f659d9ecf5a
28 libc.so.6                   0x00007f65a1c57ac3
29 libc.so.6                   0x00007f65a1ce98c0
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions