[all-commits] [llvm/llvm-project] fb80e6: [OPENMP50]Codegen for scan directive in simd loops.

Alexey Bataev via All-commits all-commits at lists.llvm.org
Thu Jun 11 06:08:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fb80e67f10eea7177b0ff9c618c8231363b6f2fc
      https://github.com/llvm/llvm-project/commit/fb80e67f10eea7177b0ff9c618c8231363b6f2fc
  Author: Alexey Bataev <a.bataev at hotmail.com>
  Date:   2020-06-11 (Thu, 11 Jun 2020)

  Changed paths:
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    A clang/test/OpenMP/scan_codegen.cpp

  Log Message:
  -----------
  [OPENMP50]Codegen for scan directive in simd loops.

Added codegen for scandirectives in simd loop. The codegen transforms
original code:

```
int x = 0;
 #pragma omp simd reduction(inscan, +: x)
for (..) {
  <first part>
  #pragma omp scan inclusive(x)
  <second part>
}
```
into
```
int x = 0;
for (..) {
  int x_priv = 0;
  <first part>
  x = x_priv + x;
  x_priv = x;
  <second part>
}
```
and
```
int x = 0;
 #pragma omp simd reduction(inscan, +: x)
for (..) {
  <first part>
  #pragma omp scan exclusive(x)
  <second part>
}
```
into
```
int x = 0;
for (..) {
  int x_priv = 0;
  <second part>
  int temp = x;
  x = x_priv + x;
  x_priv = temp;
  <first part>
}
```

Differential revision: https://reviews.llvm.org/D78232




More information about the All-commits mailing list