[PATCH] D110286: [WIP][Clang][OpenMP] Add new clang argument `-fopenmp-target-simd`

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 7 18:18:15 PDT 2021


tianshilei1992 added a comment.

In D110286#3047943 <https://reviews.llvm.org/D110286#3047943>, @JonChesterfield wrote:

> I'm excited about the thread to warp mapping but unclear why this needs to be a compile time flag. Can we use this mapping when pragma simd is present and otherwise stay with the current one?

Like I mentioned in the description, when `__kmpc_target_init` is emitted, the body has not yet. If the target region is something like:

  #pragma omp target
  {
  #pragma omp parallel
    { /* parallel region */ }
  #pragma omp simd
    { /* simd region */ }
  }

Clang has no idea the target region actually contains a simd region. As a result, it cannot adjust the execution mode accordingly. Of course we can always change the value in middle end (such as `OpenMPOpt`), but it's not gonna work if it is not invoked.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110286/new/

https://reviews.llvm.org/D110286



More information about the cfe-commits mailing list