[PATCH] D103793: [Clang][OpenMP] Monotonic does not apply to SIMD

Graham Hunter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 7 01:44:33 PDT 2021


huntergr created this revision.
huntergr added reviewers: ABataev, kkwli0.
Herald added subscribers: guansong, yaxunl.
huntergr requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

The codegen for simd constructs was affected by the presence (or
absence) of the 'monotonic' schedule modifier for worksharing
loops. The modifier is only intended to apply to the scheduling of
chunks for a thread, not iterations of a loop inside a chunk.

In addition, the monotonic modifier was applied to worksharing loops
by default if no schedule clause was present; the referenced part of
the OpenMP 4.5 spec in the code (section 2.7.1) only applies if the
user specified a schedule clause with a static kind but no modifier.
Without a user-specified schedule clause we should default to
nonmonotonic scheduling.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103793

Files:
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/OpenMP/distribute_parallel_for_simd_codegen.cpp
  clang/test/OpenMP/distribute_simd_codegen.cpp
  clang/test/OpenMP/for_simd_codegen.cpp
  clang/test/OpenMP/parallel_for_simd_codegen.cpp
  clang/test/OpenMP/schedule_codegen.cpp
  clang/test/OpenMP/target_parallel_for_simd_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_schedule_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_simd_dist_schedule_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_simd_schedule_codegen.cpp
  clang/test/OpenMP/teams_distribute_simd_codegen.cpp
  clang/test/OpenMP/teams_distribute_simd_dist_schedule_codegen.cpp



More information about the cfe-commits mailing list