Issue 238258
Summary [CIR][OpenMP] Implement codegen for OpenMP `master` directive
Labels new issue
Assignees
Reporter skadewdl3
    Currently, Clang throws a not-yet-implemented error when the master directive is used in a program.

Master doesn't take any other clauses, so just emitting a `omp::MasterOp` and the associated statement inside it should be a good start.

A simple test case:
```c
// RUN: %clang_cc1 -fopenmp -triple x86_64-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s --check-prefix=CIR

void before(void);
void body(void);
void after(void);

// CIR-LABEL: cir.func{{.*}}@simple_master(
void simple_master(void) {
  // CIR: cir.call @before
  before();

  // CIR-NEXT: omp.master {
#pragma omp master
 body();
  // CIR-NEXT: cir.call @body
  // CIR-NEXT: omp.terminator
  // CIR-NEXT: }

  // CIR-NEXT: cir.call @after
  after();
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to