[all-commits] [llvm/llvm-project] 0e3426: [mlir][spirv] Add a canonicalization pattern for U...

Nishant Patel via All-commits all-commits at lists.llvm.org
Thu Jun 8 07:34:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e3426f3fe27223ab6a1a67e8756df2214c258e3
      https://github.com/llvm/llvm-project/commit/0e3426f3fe27223ab6a1a67e8756df2214c258e3
  Author: Nishant Patel <nishant.b.patel at intel.com>
  Date:   2023-06-08 (Thu, 08 Jun 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td
    M mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
    M mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir

  Log Message:
  -----------
  [mlir][spirv] Add a canonicalization pattern for UModOp

Add a transformation for a pattern like

%6 = "spirv.Constant"() <{value = 32 : i32}> : () -> i32
%7 = "spirv.UMod"(%5, %6) : (i32, i32) -> i32
%8 = "spirv.Constant"() <{value = 4 : i32}> : () -> i32
%9 = "spirv.UMod"(%7, %8) : (i32, i32) -> i32

to transform to

%6 = "spirv.Constant"() <{value = 32 : i32}> : () -> i32
%7 = "spirv.UMod"(%5, %6) : (i32, i32) -> i32
%8 = "spirv.Constant"() <{value = 4 : i32}> : () -> i32
%9= "spirv.UMod"(%5, %8) : (i32, i32) -> i32

Patch By: nbpatel
Reviewed By: antiagainst, kuhar

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




More information about the All-commits mailing list