llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
351 stars 94 forks source link

Implementation of OpenMP task constructs #499

Open eZWALT opened 6 months ago

eZWALT commented 6 months ago

Hey everyone, just wanted to give you a heads up that I'll be diving into implementing various task constructs of OpenMP over the next three months. This includes things like taskwait, task, taskloop, taskgroup, and more. @fabianmcg and I are already coordinating efforts, but if anyone else wants to jump in and work on a different construct, feel free to use this thread to chat about it.

Thanks you for this great community, I'm kicking things off by tackling taskwait this weekend.

bcardosolopes commented 6 months ago

This is great! Thanks @eZWALT and @fabianmcg for driving this, looking forward to patch review!

bcardosolopes commented 6 months ago

I cannot find your comment anymore, but this boils down to work that needs to be done, CIRGenerator.cpp:164!:

// For OpenMP emit declare reduction functions, if required.
if (astCtx->getLangOpts().OpenMP) {
   llvm_unreachable("NYI");
}

On Sun, Mar 10, 2024 at 10:48 AM Walter J.T.V @.***> wrote:

I am seeking insights regarding an issue encountered during testing. When including the library in the test code as shown below:

include

int main(){

pragma omp parallel{

 }

}

I observed unusual exceptions. This inclusion leads to the CIRGenerator.cpp file reaching a conditional statement that terminates with a llvm_unreachable. While I understand this may be expected behavior, I lack sufficient context to fully comprehend the issue. Could someone explain why the code functions without the inclusion of but raises an exception when included?

This is the most relevant part of the error, if it helps:

NYI UNREACHABLE executed at /home/walterjtv/Escritorio/Q8/TFG/clangir/clang/lib/CIR/CodeGen/CIRGenerator.cpp:164! PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump:

  1. Program arguments: /home/walterjtv/Escritorio/Q8/TFG/clangir-install/bin/clang-19 -fopenmp -fclangir-enable -emit-cir 2_basic_parallel.c -o 2_basic_parallel.cir
  2. /usr/include/x86_64-linux-gnu/bits/types.h:155:26: current parser token '__fsid_t'
  3. /usr/include/x86_64-linux-gnu/bits/types.h:155:12 : parsing struct/union body 'struct (unnamed at /usr/include/x86_64-linux-gnu/bits/types.h:155:12)'
  4. /usr/include/x86_64-linux-gnu/bits/types.h:155:12 : CIR generation of declaration 'struct (unnamed at /usr/include/x86_64-linux-gnu/bits/types.h:155:12)'

Thank you for your support.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

-- Bruno Cardoso Lopes http://www.brunocardoso.cc

eZWALT commented 6 months ago

Excuse me, I removed the commented because I thought that opening an issue would be more helpful. I'm pushing a PR in some minutes including implementations of taskwait, taskyield and barrier (Since this 3 have a symmetrical implementation).