[all-commits] [llvm/llvm-project] 6e78a3: [OPENMP50]Codegen for scan directive in for simd r...
Alexey Bataev via All-commits
all-commits at lists.llvm.org
Tue Jun 16 13:16:22 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 6e78a3086a7f563cc55d2ba83a8697b3320857fb
https://github.com/llvm/llvm-project/commit/6e78a3086a7f563cc55d2ba83a8697b3320857fb
Author: Alexey Bataev <a.bataev at hotmail.com>
Date: 2020-06-16 (Tue, 16 Jun 2020)
Changed paths:
M clang/lib/CodeGen/CGStmtOpenMP.cpp
A clang/test/OpenMP/for_simd_scan_codegen.cpp
Log Message:
-----------
[OPENMP50]Codegen for scan directive in for simd regions.
Summary:
Added codegen for scan directives in parallel for regions.
Emits the code for the directive with inscan reductions.
Original code:
```
#pragma omp for simd reduction(inscan, op : ...)
for(...) {
<input phase>;
#pragma omp scan (in)exclusive(...)
<scan phase>
}
```
is transformed to something:
```
size num_iters = <num_iters>;
<type> buffer[num_iters];
#pragma omp for simd
for (i: 0..<num_iters>) {
<input phase>;
buffer[i] = red;
}
#pragma omp barrier
for (int k = 0; k != ceil(log2(num_iters)); ++k)
for (size cnt = last_iter; cnt >= pow(2, k); --k)
buffer[i] op= buffer[i-pow(2,k)];
#pragma omp for simd
for (0..<num_iters>) {
red = InclusiveScan ? buffer[i] : buffer[i-1];
<scan phase>;
}
```
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81658
More information about the All-commits
mailing list