diff options
author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-06-09 11:09:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-09 11:09:36 -0400 |
commit | a3c7d461456f2da25c1d119b6686773f675e313e (patch) | |
tree | 1b60875693a8385dc03d8a57297fa664771f9953 /llvm/lib/IR/Module.cpp | |
parent | 02f0f5c3eccd1add188d0d1fb7207c0cb14e1190 (diff) | |
download | llvm-a3c7d461456f2da25c1d119b6686773f675e313e.zip llvm-a3c7d461456f2da25c1d119b6686773f675e313e.tar.gz llvm-a3c7d461456f2da25c1d119b6686773f675e313e.tar.bz2 |
[mlir][spirv] Implement UMod canonicalization for vector constants (#141902)
Closes #63174.
Implements this transformation pattern, which is currently only applied
to scalars, for vectors:
```
%1 = "spirv.UMod"(%0, %CONST_32) : (i32, i32) -> i32
%2 = "spirv.UMod"(%1, %CONST_4) : (i32, i32) -> i32
```
to
```
%1 = "spirv.UMod"(%0, %CONST_32) : (i32, i32) -> i32
%2 = "spirv.UMod"(%0, %CONST_4) : (i32, i32) -> i32
```
Additionally fixes and issue where patterns like this:
```
%1 = "spirv.UMod"(%0, %CONST_4) : (i32, i32) -> i32
%2 = "spirv.UMod"(%1, %CONST_32) : (i32, i32) -> i32
```
were incorrectly canonicalized to:
```
%1 = "spirv.UMod"(%0, %CONST_4) : (i32, i32) -> i32
%2 = "spirv.UMod"(%0, %CONST_32) : (i32, i32) -> i32
```
which is incorrect since `(X % A) % B` == `(X % B)` IFF A is a multiple
of B, i.e., B divides A.
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions