[Openmp-commits] [PATCH] D112680: [OpenMP] Lower printf to __llvm_omp_vprintf

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Oct 27 17:55:39 PDT 2021


JonChesterfield created this revision.
JonChesterfield added reviewers: jdoerfert, tianshilei1992, jhuber6, ye-luo, ronlieb, pdhaliwal.
Herald added subscribers: asavonic, kerbowa, guansong, tpr, yaxunl, mgorny, nhaehnle, jvesely.
JonChesterfield requested review of this revision.
Herald added subscribers: openmp-commits, cfe-commits, sstefan1.
Herald added projects: clang, OpenMP.

Extension of D112504 <https://reviews.llvm.org/D112504>. Lower amdgpu printf to `__llvm_omp_vprintf`
which takes the same const char*, void* arguments as cuda vprintf and also
passes the size of the void* alloca which will be needed by a non-stub
implementation of `__llvm_omp_vprintf` for amdgpu.

This removes the amdgpu link error on any printf in a target region in favour
of silently compiling code that doesn't print anything to stdout.

The exact set of changes to check-openmp probably needs revision before commit


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112680

Files:
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/CGGPUBuiltin.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  openmp/libomptarget/DeviceRTL/include/Debug.h
  openmp/libomptarget/DeviceRTL/include/Interface.h
  openmp/libomptarget/DeviceRTL/src/Debug.cpp
  openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
  openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu
  openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
  openmp/libomptarget/test/mapping/data_member_ref.cpp
  openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers.cpp
  openmp/libomptarget/test/mapping/declare_mapper_nested_mappers.cpp
  openmp/libomptarget/test/mapping/lambda_by_value.cpp
  openmp/libomptarget/test/mapping/ompx_hold/struct.c
  openmp/libomptarget/test/mapping/ptr_and_obj_motion.c
  openmp/libomptarget/test/mapping/reduction_implicit_map.cpp
  openmp/libomptarget/test/offloading/bug49021.cpp
  openmp/libomptarget/test/offloading/bug50022.cpp
  openmp/libomptarget/test/offloading/host_as_target.c
  openmp/libomptarget/test/unified_shared_memory/api.c
  openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c
  openmp/libomptarget/test/unified_shared_memory/close_modifier.c
  openmp/libomptarget/test/unified_shared_memory/shared_update.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112680.382868.patch
Type: text/x-patch
Size: 21645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211028/afa54307/attachment-0001.bin>


More information about the Openmp-commits mailing list