Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HandshakeToHW] Asserts with core dialects operations #7850

Open
teqdruid opened this issue Nov 19, 2024 · 0 comments
Open

[HandshakeToHW] Asserts with core dialects operations #7850

teqdruid opened this issue Nov 19, 2024 · 0 comments

Comments

@teqdruid
Copy link
Contributor

Should this pass work with arbitrary operations?

  handshake.func @TestFunc(%arg0: i8) -> i8 {
    %c15_i8 = hw.constant 15 : i8
    %0 = comb.and bin %arg0, %c15_i8 : i8
    return %0 : i8
  }
$ circt-opt <above>.mlir --lower-handshake-to-hw
circt-opt: /home/jodemme/circt/llvm/mlir/include/mlir/IR/Matchers.h:486: bool mlir::matchPattern(Value, const Pattern &) [Pattern = mlir::detail::constant_op_binder<mlir::Attribute>]: Assertion `value' failed.
PLEASE submit a bug report to https://github.com/llvm/circt and include the crash backtrace.
Stack dump:
0.      Program arguments: circt-opt debug.mlir --lower-handshake-to-hw
 #0 0x00005588e65f77ad llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/jodemme/circt/llvm/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x00005588e65f7c9b PrintStackTraceSignalHandler(void*) /home/jodemme/circt/llvm/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x00005588e65f5d06 llvm::sys::RunSignalHandlers() /home/jodemme/circt/llvm/llvm/lib/Support/Signals.cpp:105:5
 #3 0x00005588e65f83d5 SignalHandler(int) /home/jodemme/circt/llvm/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007fcad8465420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #5 0x00007fcad7de900b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007fcad7dc8859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #7 0x00007fcad7dc8729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #8 0x00007fcad7dc8729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #9 0x00007fcad7dd9fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#10 0x00005588e8cdf38a bool mlir::matchPattern<mlir::detail::constant_op_binder<mlir::Attribute> >(mlir::Value, mlir::detail::constant_op_binder<mlir::Attribute> const&) /home/jodemme/circt/llvm/mlir/include/mlir/IR/Matchers.h:488:24
#11 0x00005588e8cd7935 mlir::Operation::fold(llvm::SmallVectorImpl<mlir::OpFoldResult>&) /home/jodemme/circt/llvm/mlir/lib/IR/Operation.cpp:664:54
#12 0x00005588e8b2add7 mlir::OpBuilder::tryFold(mlir::Operation*, llvm::SmallVectorImpl<mlir::Value>&) /home/jodemme/circt/llvm/mlir/lib/IR/Builders.cpp:529:18
#13 0x00005588e9f88a4e (anonymous namespace)::OperationLegalizer::legalizeWithFold(mlir::Operation*, mlir::ConversionPatternRewriter&) /home/jodemme/circt/llvm/mlir/lib/Transforms/Utils/DialectConversion.cpp:1911:23
#14 0x00005588e9f801e7 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) /home/jodemme/circt/llvm/mlir/lib/Transforms/Utils/DialectConversion.cpp:1873:17
#15 0x00005588e9f7fc23 mlir::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) /home/jodemme/circt/llvm/mlir/lib/Transforms/Utils/DialectConversion.cpp:2392:26
#16 0x00005588e9f805cf mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) /home/jodemme/circt/llvm/mlir/lib/Transforms/Utils/DialectConversion.cpp:2495:16
#17 0x00005588e9f849a9 mlir::applyPartialConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) /home/jodemme/circt/llvm/mlir/lib/Transforms/Utils/DialectConversion.cpp:3258:22
#18 0x00005588e9f84aad mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) /home/jodemme/circt/llvm/mlir/lib/Transforms/Utils/DialectConversion.cpp:3264:10
#19 0x00005588e86521cd (anonymous namespace)::HandshakeToHWPass::runOnOperation() /home/jodemme/circt/lib/Conversion/HandshakeToHW/HandshakeToHW.cpp:2022:16
#20 0x00005588ea2a83ab mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1::operator()() const /home/jodemme/circt/llvm/mlir/lib/Pass/Pass.cpp:0:17
#21 0x00005588ea2a8345 void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) /home/jodemme/circt/llvm/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:5
#22 0x00005588e64f5939 llvm::function_ref<void ()>::operator()() const /home/jodemme/circt/llvm/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:5
#23 0x00005588ea2ab0d5 void mlir::MLIRContext::executeAction<mlir::PassExecutionAction, mlir::Pass&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, mlir::Pass&) /home/jodemme/circt/llvm/mlir/include/mlir/IR/MLIRContext.h:281:3
#24 0x00005588ea2a3b4a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/jodemme/circt/llvm/mlir/lib/Pass/Pass.cpp:532:17
#25 0x00005588ea2a40d4 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/jodemme/circt/llvm/mlir/lib/Pass/Pass.cpp:592:16
#26 0x00005588ea2a5b18 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /home/jodemme/circt/llvm/mlir/lib/Pass/Pass.cpp:905:10
#27 0x00005588ea2a5a42 mlir::PassManager::run(mlir::Operation*) /home/jodemme/circt/llvm/mlir/lib/Pass/Pass.cpp:885:60
#28 0x00005588e948f0e2 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /home/jodemme/circt/llvm/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:412:17
#29 0x00005588e948ed18 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) /home/jodemme/circt/llvm/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:477:12
#30 0x00005588e948eafc mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::raw_ostream&) const /home/jodemme/circt/llvm/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:560:12
#31 0x00005588e948ea96 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, 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&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::raw_ostream&) /home/jodemme/circt/llvm/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#32 0x00005588e94d34a2 llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::raw_ostream&) const /home/jodemme/circt/llvm/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
#33 0x00005588e94d2a8c 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::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) /home/jodemme/circt/llvm/mlir/lib/Support/ToolUtilities.cpp:27:12
#34 0x00005588e948b298 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) /home/jodemme/circt/llvm/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:563:10
#35 0x00005588e948b659 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) /home/jodemme/circt/llvm/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:604:14
#36 0x00005588e948b828 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) /home/jodemme/circt/llvm/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:620:10
#37 0x00005588e6478eee main /home/jodemme/circt/tools/circt-opt/circt-opt.cpp:80:23
#38 0x00007fcad7dca083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#39 0x00005588e6478cee _start (/home/jodemme/_circt_build/bin/circt-opt+0x34adcee)
Aborted (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant