diff options
| author | Ryotaro Kasuga <kasuga.ryotaro@fujitsu.com> | 2025-10-25 00:42:27 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-25 00:42:27 +0900 |
| commit | 30984358ff94f3f71f4ac50ea58f6ab32ccc7c23 (patch) | |
| tree | c60611983fd474629839ba762eea7e361936e3e9 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
| parent | a1ae9001ebb04a43f15a063663be22b92c3d0eb6 (diff) | |
| download | llvm-30984358ff94f3f71f4ac50ea58f6ab32ccc7c23.zip llvm-30984358ff94f3f71f4ac50ea58f6ab32ccc7c23.tar.gz llvm-30984358ff94f3f71f4ac50ea58f6ab32ccc7c23.tar.bz2 | |
[DA] Fix absolute value calculation (#164967)
This patch fixes the computation of the absolute value for SCEV.
Previously, it was calculated as `AbsX = SE->isKnownNonNegative(X) ? X :
-X`, which would incorrectly assume that `!isKnownNonNegative` implies
`isKnownNegative`. This assumption does not hold in general, for
example, when `X` is a `SCEVUnknown` and it can be an arbitrary value.
To compute the absolute value properly, we should use
ScalarEvolution::getAbsExpr instead.
Fix #149977
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
