[PATCH] D59450: [ValueTracking] Use ConstantRange overflow check for signed add (NFC)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 17 14:32:34 PDT 2019
nikic marked an inline comment as done.
nikic added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4132
+ mapOverflowResult(LHSRange.signedAddMayOverflow(RHSRange));
+ if (OR != OverflowResult::MayOverflow)
+ return OR;
----------------
lebedev.ri wrote:
> I'm guessing `OverflowResult` won't grow, so there is no danger of accidentally doing the wrong thing here.
I do want to grow it a bit... I'd like to split up the AlwaysOverflows case into AlwaysOverflowsLow and AlwaysOverflowsHigh, so that it can be used in saturating math optimization. But that shouldn't have any impact on this check :)
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59450/new/
https://reviews.llvm.org/D59450
More information about the llvm-commits
mailing list