diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2017-08-18 22:50:29 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2017-08-18 22:50:29 +0000 |
commit | 0aaf8c16acad178afa75f50252ea58a15d852bd9 (patch) | |
tree | c0eb3fe708c558701b698dbb054dea4f6ec1feee /clang/lib/Tooling/ASTDiff/ASTDiff.cpp | |
parent | b29bebe47b3378ca96f16dddd9dfc4f73ad48a91 (diff) | |
download | bcm5719-llvm-0aaf8c16acad178afa75f50252ea58a15d852bd9.tar.gz bcm5719-llvm-0aaf8c16acad178afa75f50252ea58a15d852bd9.zip |
[IRCE] Fix buggy behavior in Clamp
Clamp function was too optimistic when choosing signed or unsigned min/max function for calculations.
In fact, `!IsSignedPredicate` guarantees us that `Smallest` and `Greatest` can be compared safely using unsigned
predicates, but we did not check this for `S` which can in theory be negative.
This patch makes Clamp use signed min/max for cases when it fails to prove `S` being non-negative,
and it adds a test where such situation may lead to incorrect conditions calculation.
Differential Revision: https://reviews.llvm.org/D36873
llvm-svn: 311205
Diffstat (limited to 'clang/lib/Tooling/ASTDiff/ASTDiff.cpp')
0 files changed, 0 insertions, 0 deletions