[all-commits] [llvm/llvm-project] 0d03b3: [mlir][StandardToSPIRV] Use spv.UMod for index re-...

Lei Zhang via All-commits all-commits at lists.llvm.org
Wed Aug 5 11:52:26 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d03b3901d38484683cd9d6d0d6382967599e92b
      https://github.com/llvm/llvm-project/commit/0d03b3901d38484683cd9d6d0d6382967599e92b
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
    M mlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir

  Log Message:
  -----------
  [mlir][StandardToSPIRV] Use spv.UMod for index re-calculation

Per Vulkan's SPIR-V environment spec: "While the OpSRem and OpSMod
instructions are supported by the Vulkan environment, they require
non-negative values and thus do not enable additional functionality
beyond what OpUMod provides."

The `getOffsetForBitwidth` function is used for lowering std.load
and std.store, whose indices are of `index` type and cannot be
negative. So we should be okay to use spv.UMod directly here to
be exact. Also made the comment explicit about the assumption.

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




More information about the All-commits mailing list