[all-commits] [llvm/llvm-project] 21427b: libclc: Add clspv target to libclc

alan-baker via All-commits all-commits at lists.llvm.org
Wed Mar 3 21:20:01 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 21427b8eb8e773789bdb4cd8911bee6631910a37
      https://github.com/llvm/llvm-project/commit/21427b8eb8e773789bdb4cd8911bee6631910a37
  Author: Alan Baker <alanbaker at google.com>
  Date:   2021-03-04 (Thu, 04 Mar 2021)

  Changed paths:
    M libclc/CMakeLists.txt
    A libclc/clspv/lib/SOURCES
    A libclc/clspv/lib/math/fma.cl
    A libclc/clspv/lib/math/nextafter.cl
    A libclc/clspv/lib/math/nextafter.inc
    A libclc/clspv/lib/subnormal_config.cl

  Log Message:
  -----------
  libclc: Add clspv target to libclc

Add clspv as a new target for libclc. clspv is an open-source compiler that compiles OpenCL C to Vulkan SPIR-V. Compiles for the spir target.

The clspv target differs from the the spirv target in the following ways:
* fma is modified to use uint2 instead of ulong for mantissas. This results in lower performance fma, but provides a implementation that can be used on more Vulkan devices where 64-bit integer support is less common.
* Use of a software implementation of nextafter because the generic implementation depends on nextafter being a defined builtin function for which clspv has no definition.
* Full optimization of the library (-O3) and no conversion to SPIR-V

This library is close to what would be produced by running opt -O3 < builtins.opt.spirv-mesa3d-.bc > builtins.opt.clspv--.bc and continuing the build from that point.

Reviewer: jvesely

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




More information about the All-commits mailing list