diff options
author | Christian Sigg <csigg@google.com> | 2025-05-19 15:07:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-19 15:07:30 +0200 |
commit | c56e7f22f06ac52d2ef3ea487910ab60a1256138 (patch) | |
tree | 0e8c9fc4068ca6fc4d1e83d1569c924c4b4f4d91 /clang/lib/Basic/SourceManager.cpp | |
parent | 6d8a52146c853e74727d8f000dc6236781aa45dd (diff) | |
download | llvm-c56e7f22f06ac52d2ef3ea487910ab60a1256138.zip llvm-c56e7f22f06ac52d2ef3ea487910ab60a1256138.tar.gz llvm-c56e7f22f06ac52d2ef3ea487910ab60a1256138.tar.bz2 |
[mlir][arith] Canonicalize sitofp(truncf) -> sitofp, and uitofp. (#139925)
Add a canonicalization patterns that simplifies `truncf(sitofp(x))` to
`sitofp(x)` and `truncf(uitofp(x))` to `uitofp(x)`, if truncf has default rounding mode.
This assumes that the destination type of truncf is representable by the
intermediate type.
Note that the truncf semantics requires that the destination type is
narrower than the source type, so this is true for all types I can
possibly think of, but one could probably construct an artificial
counter example.
Somewhat related: https://github.com/llvm/llvm-project/pull/128096
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions