Revision tags: llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
2034f2fc |
| 22-May-2024 |
Felix Schneider <fx.schn@gmail.com> |
[mlir][intrange] Use `nsw`,`nuw` flags in inference (#92642)
This patch includes the "no signed wrap" and "no unsigned wrap" flags,
which can be used to annotate some Ops in the `arith` dialect and
[mlir][intrange] Use `nsw`,`nuw` flags in inference (#92642)
This patch includes the "no signed wrap" and "no unsigned wrap" flags,
which can be used to annotate some Ops in the `arith` dialect and also
in LLVMIR, in the integer range inference.
The general approach is to use saturating arithmetic operations to infer
bounds which are assumed to not wrap and use overflowing arithmetic
operations in the normal case. If overflow is detected in the normal
case,
special handling makes sure that we don't underestimate the result
range.
show more ...
|
Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3 |
|
#
b7ffd968 |
| 20-Feb-2023 |
Kazu Hirata <kazu@google.com> |
Use APInt::getAllOnes instead of APInt::getAllOnesValue (NFC)
Note that getAllOnesValue has been soft-deprecated in favor of getAllOnes.
|
Revision tags: llvmorg-16.0.0-rc2 |
|
#
5c9013e2 |
| 28-Jan-2023 |
Kazu Hirata <kazu@google.com> |
Use std::optional instead of llvm::Optional (NFC)
|
Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7 |
|
#
5af9d16d |
| 09-Jan-2023 |
Krzysztof Drewniak <Krzysztof.Drewniak@amd.com> |
[mlir][Index] Implement InferIntRangeInterface, re-land
Re-land D140899 to fix a missing dependency in the index dialect's CMakeLists.txt.
Reviewed By: Mogball
Differential Revision: https://revie
[mlir][Index] Implement InferIntRangeInterface, re-land
Re-land D140899 to fix a missing dependency in the index dialect's CMakeLists.txt.
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D142147
show more ...
|
#
45530562 |
| 09-Jan-2023 |
Krzysztof Drewniak <Krzysztof.Drewniak@amd.com> |
[mlir][Index] Implement InferIntRangeInterface
Implement InferIntRangeInterface for all operations in the Index dialect. The inference implementation, unlike the one for Arith, accounts for the fact
[mlir][Index] Implement InferIntRangeInterface
Implement InferIntRangeInterface for all operations in the Index dialect. The inference implementation, unlike the one for Arith, accounts for the fact that Index can be either 64 or 32 bits long by evaluating both cases. Bounds are stored as if index were i64, but when inferring new bounds, we compute both f(...) and f(trunc(...)). We then compare trunc(f(...)) to f(trunc(...)). If they are equal in the relevant range components, we use the 64-bit range computation, otherwise we give the range ext(f(trunc(...))) union f(...).
Note that this can cause surprising behavior as seen in the tests, where, for example, the order of min and max operations impacts the behavior of the inference. The inference could perhaps be made more precise in the future (ex. by tracking 32 and 64-bit results separately and having them influence each other somehow) butt, since my project targets an index=i32 platform and doesn't see index-valued values > uint32_max, I'm not too concerned about it.
Depends on https://reviews.llvm.org/D141299
Depends on https://reviews.llvm.org/D141296
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D140899
show more ...
|