HomePhabricator

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

Authored by jlebar on Jan 20 2017, 5:00 PM.

Description

[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

llvm-svn: 292694