[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 13:49:39 PDT 2019


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4151
         (AddKnown.isNegative() && LHSOrRHSKnownNegative)) {
       return OverflowResult::NeverOverflows;
     }
----------------
lebedev.ri wrote:
> This is still reachable, `computeKnownBits(Add, ...` is still more powerful than `signedAddMayOverflow()`?
computeKnownBitsFromOperator() itself is not more powerful than signedAddMayOverflow (or the existing ripple logic). However, computeKnownBits() also computes known bits from assumes on the add, which is what this call is really for. I've created D59473 to both make that more explicit and avoid a redundant known bits calculation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59450/new/

https://reviews.llvm.org/D59450





More information about the llvm-commits mailing list