llvm / llvm/Polygeist

compiling OpenMP programs

Open
#137 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
624
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Hello, I get an error compiling a simple OpenMP program. Could you please help?

vinodt@m2000host0:/localdata/vinod/Polygeist/Heat3DOpenMP$ mlir-clang -I../llvm-project/clang/lib/Headers main.c
mlir-clang: /localdata/vinod/Polygeist/lib/polygeist/Passes/LoopRestructure.cpp:647: void {anonymous}::LoopRestructure::runOnRegion(mlir::DominanceInfo&, mlir::Region&): Assertion `loop.before().getBlocks().size() == 1' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: mlir-clang -I ../llvm-project/clang/lib/Headers main.c
#0 0x00005582c9fca00a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:0
#1 0x00005582c9fca0c1 PrintStackTraceSignalHandler(void*) /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:0
#2 0x00005582c9fc7d75 llvm::sys::RunSignalHandlers() /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Signals.cpp:97:0
#3 0x00005582c9fc998b SignalHandler(int) /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:0
#4 0x00007fe4c613b980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#5 0x00007fe4c4decfb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007fe4c4dee921 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:81:0
#7 0x00007fe4c4dde48a __assert_fail_base /build/glibc-S9d2JN/glibc-2.27/assert/assert.c:89:0
#8 0x00007fe4c4dde502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
#9 0x00005582ca899740 (anonymous namespace)::LoopRestructure::runOnRegion(mlir::DominanceInfo&, mlir::Region&) /localdata/vinod/Polygeist/lib/polygeist/Passes/LoopRestructure.cpp:648:0
#10 0x00005582ca8962d9 (anonymous namespace)::LoopRestructure::runOnFunction() /localdata/vinod/Polygeist/lib/polygeist/Passes/LoopRestructure.cpp:283:0
#11 0x00005582ca816edf mlir::FunctionPass::runOnOperation() /localdata/vinod/Polygeist/llvm-project/mlir/include/mlir/Pass/Pass.h:395:0
#12 0x00005582ccdc53d9 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:393:0
#13 0x00005582ccdc56ab mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:452:0
#14 0x00005582ccdc611d mlir::detail::OpToOpPassAdaptor::runOnOperationImpl(bool) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:548:0
#15 0x00005582ccdc5e71 mlir::detail::OpToOpPassAdaptor::runOnOperation(bool) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:530:0
#16 0x00005582ccdc53ba mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:390:0
#17 0x00005582ccdc56ab mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:452:0
#18 0x00005582ccdc6da0 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:697:0
#19 0x00005582ccdc6be8 mlir::PassManager::run(mlir::Operation*) /localdata/vinod/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:676:0
#20 0x00005582c843eb96 main /localdata/vinod/Polygeist/tools/mlir-clang/mlir-clang.cc:447:0
#21 0x00007fe4c4dcfbf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#22 0x00005582c840fb4a _start (/localdata/vinod/Polygeist/build/bin/mlir-clang+0x858b4a)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the reported mlir-clang command and the example main.c, then inspect lib/polygeist/Passes/LoopRestructure.cpp around lines 647-648 and the caller at line 283. Determine why the assertion is reached and add a regression case if the existing tests provide a suitable entry point. Done means the reported program no longer aborts during compilation and the regression test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.