summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2021-06-21 19:11:11 +0100
committerFlorian Hahn <flo@fhahn.com>2021-06-22 11:27:51 +0100
commitd17798823ca2213af353e125f6f5233522dda7ce (patch)
treefb1dcea5d956ba67f1121e6583780a7b7f50f886 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent98e2b1a8dd8ff03b6289a40a16fe749834257494 (diff)
[SCEV] Retain AddExpr flags when subtracting a foldable constant.
Currently we drop wrapping flags for expressions like (A + C1)<flags> - C2. But we can retain flags under certain conditions: * Adding a smaller constant is NUW if the original AddExpr was NUW. * Adding a constant with the same sign and small magnitude is NSW, if the original AddExpr was NSW. This can improve results after using `SimplifyICmpOperands`, which may subtract one in order to use stricter predicates, as is the case for `isKnownPredicate`. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D104319
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions