[all-commits] [llvm/llvm-project] 5d02ca: [libomptarget][nvptx] Undef, weak shared variables

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Wed Oct 28 07:26:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d02ca49a294848b533adf7dc1d1275d125ef587
      https://github.com/llvm/llvm-project/commit/5d02ca49a294848b533adf7dc1d1275d125ef587
  Author: JonChesterfield <jonathanchesterfield at gmail.com>
  Date:   2020-10-28 (Wed, 28 Oct 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
    M clang/test/OpenMP/nvptx_data_sharing.cpp
    M clang/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp
    M clang/test/OpenMP/nvptx_parallel_codegen.cpp
    M clang/test/OpenMP/nvptx_parallel_for_codegen.cpp
    M clang/test/OpenMP/nvptx_target_parallel_reduction_codegen.cpp
    M clang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_codegen.cpp
    M clang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_simd_codegen.cpp
    M clang/test/OpenMP/nvptx_teams_codegen.cpp
    M clang/test/OpenMP/nvptx_teams_reduction_codegen.cpp

  Log Message:
  -----------
  [libomptarget][nvptx] Undef, weak shared variables

[libomptarget][nvptx] Undef, weak shared variables

Shared variables on nvptx, and LDS on amdgcn, are uninitialized at
the start of kernel execution. Therefore create the variables with
undef instead of zeros, motivated in part by the amdgcn back end
rejecting LDS+initializer.

Common is zero initialized, which seems incompatible with shared. Thus
change them to weak, following the direction of
https://reviews.llvm.org/rG7b3eabdcd215

Reviewed By: jdoerfert

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




More information about the All-commits mailing list