[all-commits] [llvm/llvm-project] e27197: [mlir][spirv] Define spv.IsNan/spv.IsInf and add l...

Lei Zhang via All-commits all-commits at lists.llvm.org
Fri Jan 22 10:14:26 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e27197f3605450c372ddc71922d0e9982b30e115
      https://github.com/llvm/llvm-project/commit/e27197f3605450c372ddc71922d0e9982b30e115
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td
    M mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir
    M mlir/test/Dialect/SPIRV/IR/logical-ops.mlir
    M mlir/test/Target/SPIRV/logical-ops.mlir

  Log Message:
  -----------
  [mlir][spirv] Define spv.IsNan/spv.IsInf and add lowerings

spv.Ordered/spv.Unordered are meant for OpenCL Kernel capability.
For Vulkan Shader capability, we should use spv.IsNan to check
whether a number is NaN.

Add a new pattern for converting `std.cmpf ord|uno` to spv.IsNan
and bumped the pattern converting to spv.Ordered/spv.Unordered
to a higher benefit. The SPIR-V target environment will properly
select between these two patterns.

Reviewed By: mravishankar

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




More information about the All-commits mailing list