[all-commits] [llvm/llvm-project] 9f4a92: Reuse OMPIRBuilder `struct ident_t` handling in Clang

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Aug 25 08:07:01 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f4a92a4349ff1794379b706a4851c678899d5d2
      https://github.com/llvm/llvm-project/commit/9f4a92a4349ff1794379b706a4851c678899d5d2
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/CodeGen/CGOpenMPRuntime.h
    M clang/test/OpenMP/distribute_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_proc_bind_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_proc_bind_codegen.cpp
    M clang/test/OpenMP/distribute_simd_codegen.cpp
    M clang/test/OpenMP/for_codegen.cpp
    M clang/test/OpenMP/for_firstprivate_codegen.cpp
    M clang/test/OpenMP/for_lastprivate_codegen.cpp
    M clang/test/OpenMP/for_linear_codegen.cpp
    M clang/test/OpenMP/for_reduction_codegen.cpp
    M clang/test/OpenMP/for_reduction_codegen_UDR.cpp
    M clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp
    M clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
    M clang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp
    M clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp
    M clang/test/OpenMP/openmp_win_codegen.cpp
    M clang/test/OpenMP/ordered_codegen.cpp
    M clang/test/OpenMP/parallel_codegen.cpp
    M clang/test/OpenMP/parallel_copyin_codegen.cpp
    M clang/test/OpenMP/parallel_for_codegen.cpp
    M clang/test/OpenMP/parallel_master_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp
    M clang/test/OpenMP/parallel_num_threads_codegen.cpp
    M clang/test/OpenMP/parallel_proc_bind_codegen.cpp
    M clang/test/OpenMP/parallel_reduction_codegen.cpp
    M clang/test/OpenMP/sections_codegen.cpp
    M clang/test/OpenMP/sections_firstprivate_codegen.cpp
    M clang/test/OpenMP/sections_lastprivate_codegen.cpp
    M clang/test/OpenMP/sections_reduction_codegen.cpp
    M clang/test/OpenMP/single_codegen.cpp
    M clang/test/OpenMP/single_firstprivate_codegen.cpp
    M clang/test/OpenMP/target_depend_codegen.cpp
    M clang/test/OpenMP/target_parallel_codegen.cpp
    M clang/test/OpenMP/target_parallel_depend_codegen.cpp
    M clang/test/OpenMP/target_parallel_for_codegen.cpp
    M clang/test/OpenMP/target_parallel_for_simd_codegen.cpp
    M clang/test/OpenMP/target_parallel_if_codegen.cpp
    M clang/test/OpenMP/target_parallel_num_threads_codegen.cpp
    M clang/test/OpenMP/target_simd_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_codegen.cpp
    M clang/test/OpenMP/target_teams_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_proc_bind_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_proc_bind_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
    M clang/test/OpenMP/target_teams_num_teams_codegen.cpp
    M clang/test/OpenMP/target_teams_thread_limit_codegen.cpp
    M clang/test/OpenMP/task_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_simd_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
    M clang/test/OpenMP/teams_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_proc_bind_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_proc_bind_codegen.cpp
    M clang/test/OpenMP/threadprivate_codegen.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/lib/IR/IRBuilder.cpp
    M llvm/test/Transforms/OpenMP/deduplication.ll

  Log Message:
  -----------
  Reuse OMPIRBuilder `struct ident_t` handling in Clang

Replace the `ident_t` handling in Clang with the methods offered by the
OMPIRBuilder. This cuts down on the clang code as well as the
differences between the two, making further transitions easier. Tests
have changed but there should not be a real functional change. The most
interesting difference is probably that we stop generating local ident_t
allocations for now and just use globals. Given that this happens only
with debug info, the location part of the `ident_t` is probably bigger
than the test anyway. As the location part is already a global, we can
avoid the allocation, memcpy, and store in favor of a constant global
that is slightly bigger. This can be revisited if there are
complications.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D80735


  Commit: 1274d83482b950fa31a34a5fdc3a0575c8d1b6a4
      https://github.com/llvm/llvm-project/commit/1274d83482b950fa31a34a5fdc3a0575c8d1b6a4
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
    A clang/test/OpenMP/nvptx_target_parallel_reduction_codegen_tbaa_PR46146.cpp

  Log Message:
  -----------
  Do not use TBAA in type punning reduction GPU code PR46156

When we implement OpenMP GPU reductions we use type punning a lot during
the shuffle and reduce operations. This is not always compatible with
language rules on aliasing. So far we generated TBAA which later allowed
to remove some of the reduce code as accesses and initialization were
"known to not alias". With this patch we avoid TBAA in this step,
hopefully for all accesses that we need to.

Verified on the reproducer of PR46156 and QMCPack.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D86037


Compare: https://github.com/llvm/llvm-project/compare/c160ff1564d8...1274d83482b9


More information about the All-commits mailing list