diff options
author | Uday Bondhugula <uday@polymagelabs.com> | 2025-04-23 05:11:38 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-23 05:11:38 +0530 |
commit | 8c74dc1adf83d370e740e44ffe073487fd3b38d2 (patch) | |
tree | df42df3f7113611f8a77624626fcdd1b6670ca43 /clang/lib/Format/FormatTokenLexer.cpp | |
parent | 8dbf92e06a9f86ba256b537b2a1a99bce9dee765 (diff) | |
download | llvm-8c74dc1adf83d370e740e44ffe073487fd3b38d2.zip llvm-8c74dc1adf83d370e740e44ffe073487fd3b38d2.tar.gz llvm-8c74dc1adf83d370e740e44ffe073487fd3b38d2.tar.bz2 |
[MLIR][Affine] Fix affine.apply verifier and add functionality to demote invalid symbols to dims (#128289)
Fixes: https://github.com/llvm/llvm-project/issues/120189,
https://github.com/llvm/llvm-project/issues/128403
Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
contexts where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
`-canonicalize` to have generated invalid IR when such
affine.apply ops were composed.
Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols). Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
`canonicalizeMapOrSetAndOperands` so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.
In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.
This commit also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
Diffstat (limited to 'clang/lib/Format/FormatTokenLexer.cpp')
0 files changed, 0 insertions, 0 deletions