[PATCH] D59450: [ValueTracking] Use ConstantRange overflow check for signed add (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 03:30:23 PDT 2019


nikic created this revision.
nikic added reviewers: spatel, lebedev.ri.
Herald added subscribers: llvm-commits, jdoerfert, hiraditya.
Herald added a project: LLVM.

This is the same change as rL356290 <https://reviews.llvm.org/rL356290>, but for signed add. It replaces the existing ripple logic with the overflow logic in ConstantRange, where the range is produced from KnownBits in a way that avoids wrapping the signed domain.

This is still intended as NFC, but it's somewhat less obvious here, so I'm putting up a review. It should be noted that this does make computeOverflowForSignedAdd more powerful, but only in that it can now also determine AlwaysOverflows conditions. However, none of the consumers of this method make use of this yet, so it does not impact optimization (I'll submit a followup to use AlwaysOverflows for with.overflow).


Repository:
  rL LLVM

https://reviews.llvm.org/D59450

Files:
  llvm/lib/Analysis/ValueTracking.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59450.190952.patch
Type: text/x-patch
Size: 5676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190316/6e0b7a6d/attachment.bin>


More information about the llvm-commits mailing list