[PATCH] D60420: [ValueTracking] Use computeConstantRange() for signed add/sub overflow determination

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 13:10:35 PDT 2019


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

This is D59386 <https://reviews.llvm.org/D59386> for the signed case. The computeConstantRange() result is now intersected into the existing known bits information, allowing to detect additional no-overflow/always-overflow conditions (though the latter isn't used yet).

This (finally...) covers the motivating case from D59071 <https://reviews.llvm.org/D59071>.


Repository:
  rL LLVM

https://reviews.llvm.org/D60420

Files:
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/test/Transforms/InstCombine/and2.ll
  llvm/test/Transforms/InstCombine/icmp-add.ll
  llvm/test/Transforms/InstCombine/sadd-with-overflow.ll
  llvm/test/Transforms/InstCombine/saturating-add-sub.ll
  llvm/test/Transforms/InstCombine/ssub-with-overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60420.194198.patch
Type: text/x-patch
Size: 8277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190408/7c949668/attachment.bin>


More information about the llvm-commits mailing list