[mlir][arith] Fold `index_cast[ui]` of vectors
authorJakub Kuderski <kubak@google.com>
Wed, 29 Mar 2023 16:49:32 +0000 (12:49 -0400)
committerJakub Kuderski <kubak@google.com>
Wed, 29 Mar 2023 16:51:51 +0000 (12:51 -0400)
commitce6a03ce0b82dbebcf5c752bade0955dc3abb2ba
tree2e2ae6da62ba82171d20d942c46e3c9798cd8a48
parent2657e554d1bbe0cfff47e21a9df3f25ac0f1da4a
[mlir][arith] Fold `index_cast[ui]` of vectors

Handle the splat and dense case.

I saw this pattern show up in a couple recent SPIR-V-specific bug
report.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D147109
mlir/lib/Dialect/Arith/IR/ArithOps.cpp
mlir/test/Dialect/Arith/canonicalize.mlir