Skip to content
Snippets Groups Projects
Commit 916645c2 authored by Justin Lebar's avatar Justin Lebar
Browse files

[NVPTX] Auto-upgrade some NVPTX intrinsics to LLVM target-generic code.

Summary:
Specifically, we upgrade llvm.nvvm.:

 * brev{32,64}
 * clz.{i,ll}
 * popc.{i,ll}
 * abs.{i,ll}
 * {min,max}.{i,ll,u,ull}
 * h2f

These either map directly to an existing LLVM target-generic
intrinsic or map to a simple LLVM target-generic idiom.

In all cases, we check that the code we generate is lowered to PTX as we
expect.

These builtins don't need to be backfilled in clang: They're not
accessible to user code from nvcc.

Reviewers: tra

Subscribers: majnemer, cfe-commits, llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292694 91177308-0d34-0410-b5e6-96231b3b80d8
parent e18adf04
No related branches found
No related tags found
No related merge requests found
......@@ -64,24 +64,10 @@ BUILTIN(__nvvm_read_ptx_sreg_pm3, "i", "n")
// MISC
BUILTIN(__nvvm_clz_i, "ii", "")
BUILTIN(__nvvm_clz_ll, "iLLi", "")
BUILTIN(__nvvm_popc_i, "ii", "")
BUILTIN(__nvvm_popc_ll, "iLLi", "")
BUILTIN(__nvvm_prmt, "UiUiUiUi", "")
// Min Max
BUILTIN(__nvvm_min_i, "iii", "")
BUILTIN(__nvvm_min_ui, "UiUiUi", "")
BUILTIN(__nvvm_min_ll, "LLiLLiLLi", "")
BUILTIN(__nvvm_min_ull, "ULLiULLiULLi", "")
BUILTIN(__nvvm_max_i, "iii", "")
BUILTIN(__nvvm_max_ui, "UiUiUi", "")
BUILTIN(__nvvm_max_ll, "LLiLLiLLi", "")
BUILTIN(__nvvm_max_ull, "ULLiULLiULLi", "")
BUILTIN(__nvvm_fmax_ftz_f, "fff", "")
BUILTIN(__nvvm_fmax_f, "fff", "")
BUILTIN(__nvvm_fmin_ftz_f, "fff", "")
......@@ -133,11 +119,6 @@ BUILTIN(__nvvm_div_rz_d, "ddd", "")
BUILTIN(__nvvm_div_rm_d, "ddd", "")
BUILTIN(__nvvm_div_rp_d, "ddd", "")
// Brev
BUILTIN(__nvvm_brev32, "UiUi", "")
BUILTIN(__nvvm_brev64, "ULLiULLi", "")
// Sad
BUILTIN(__nvvm_sad_i, "iiii", "")
......@@ -155,9 +136,6 @@ BUILTIN(__nvvm_ceil_d, "dd", "")
// Abs
BUILTIN(__nvvm_abs_i, "ii", "")
BUILTIN(__nvvm_abs_ll, "LLiLLi", "")
BUILTIN(__nvvm_fabs_ftz_f, "ff", "")
BUILTIN(__nvvm_fabs_f, "ff", "")
BUILTIN(__nvvm_fabs_d, "dd", "")
......@@ -385,8 +363,6 @@ BUILTIN(__nvvm_ull2d_rp, "dULLi", "")
BUILTIN(__nvvm_f2h_rn_ftz, "Usf", "")
BUILTIN(__nvvm_f2h_rn, "Usf", "")
BUILTIN(__nvvm_h2f, "fUs", "")
// Bitcast
BUILTIN(__nvvm_bitcast_f2i, "if", "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment