Open tipparajuv opened 2 years ago
Hi, can you paste the code that triggered the error?
here you go:
Thank you, Vinod.
I was trying to compile the program first without OpenMP. When I try to compile it with, here is the error:
vinodt@m2000host0:/localdata/vinod/Polygeist/Heat3DOpenMP$ mlir-clang -fopenmp -I../build/projects/openmp/runtime/src -I../llvm-project/clang/lib/Headers main.c
mlir-clang: ../llvm-project/llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y>::ret_type llvm::cast(Y) [with X = clang::CastExpr; Y = clang::Expr; typename llvm::cast_retty<X, Y>::ret_type = clang::CastExpr]: Assertion `isa
Without openmp this should build on main. With OpenMP does indeed still trigger issues, will look into.
Thanks. Could you please share how you are building it without OpenMP?
It will be very useful if it were building with OpenMP :-)
Oh a large suite of fixes just landed to main, one of which fixed the issue you saw. But as for command line:
./bin/mlir-clang -resource-dir /home/wmoses/git/Polygeist/mlir-build/lib/clang/14.0.0 -o a.exe heat.c -O3
Thanks. Should the OpenMP version be building error-free with the fixes that landed?
Not yet, but I've added support for the requisite OMP single and related in a current PR which should enable that code to run.
thanks. I look forward to your PR being merged and trying it out.
Try now on the latest main.
It works, thank you.
Is polymer not being used anymore?
Polymer is/can still be used, but it'll be a bit before it can be used on this as the polymer codebase will need to update to the latest llvm & Polygeist commits.
We also need to add scf.parallel raising to affine.parallel for it to work in this case (and probably polymer should take in affine.parallel).
cc @kumasento @ftynse
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 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<llvm::pointee_iterator<std::unique_ptr<mlir::Pass, std::default_delete >, 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<llvm::pointee_iterator<std::unique_ptr<mlir::Pass, std::default_delete >, 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)