[PATCH] D79948: [OPENMP50]Codegen for inscan reductions in worksharing directives.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 14 09:44:01 PDT 2020


ABataev created this revision.
ABataev added a reviewer: jdoerfert.
Herald added subscribers: arphaman, guansong, yaxunl.
Herald added a project: clang.

Implemented codegen for reduction clauses with inscan modifiers in
worksharing constructs.

Emits the code for the directive with inscan reductions.
The code is the following:

  size num_iters = <num_iters>;
  <type> buffer[num_iters];
  for (i: 0..<num_iters>) {
    <input phase>;
    buffer[i] = red;
  }
  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)];
  for (0..<num_iters>) {
    red = InclusiveScan ? buffer[i] : buffer[i-1];
    <scan phase>;
  }


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79948

Files:
  clang/include/clang/AST/OpenMPClause.h
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/lib/AST/OpenMPClause.cpp
  clang/lib/AST/StmtProfile.cpp
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/test/OpenMP/for_scan_codegen.cpp
  clang/test/OpenMP/scan_messages.cpp
  clang/tools/libclang/CIndex.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79948.264014.patch
Type: text/x-patch
Size: 71455 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200514/50707d6b/attachment-0001.bin>


More information about the cfe-commits mailing list