[all-commits] [llvm/llvm-project] 567b3f: [OpenMP][deviceRTLs] Drop `assert` in common parts...

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Feb 4 09:40:05 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 567b3f8841d0725e07dd816ca4288a309064bd39
      https://github.com/llvm/llvm-project/commit/567b3f8841d0725e07dd816ca4288a309064bd39
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2021-02-04 (Thu, 04 Feb 2021)

  Changed paths:
    M openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
    M openmp/libomptarget/deviceRTLs/common/debug.h
    M openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h

  Log Message:
  -----------
  [OpenMP][deviceRTLs] Drop `assert` in common parts of `deviceRTLs`

The header `assert.h` needs to be included in order to use `assert` in the code.
When building NVPTX `deviceRTLs` on a CUDA free system, it requires headers from
`gcc-multilib`, which some systems don't have. This patch drops the use of
`assert` in common parts of `deviceRTLs`. In light of
`openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h`, a code block
```
if (!cond)
  __builtin_trap();
```
is being used. The builtin will be translated to `call void @llvm.trap()`, and
the corresponding PTX is `trap;`.

Reviewed By: JonChesterfield

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




More information about the All-commits mailing list