[PATCH] D71011: [ConstantRange] Add `shlWithNoWrap()` method

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 06:16:03 PST 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: reames, nikic, efriedma, spatel, sanjoy.
lebedev.ri added a project: LLVM.
Herald added a subscriber: hiraditya.
lebedev.ri added parent revisions: D71010: [ConstantRange] Add `getClosestToZero()` method - what value[s] are closest to signed zero?, D70043: [ConstantRange] Add `mulWithNoWrap()` method.

This modelling isn't precise, much like the baseline `shl()` modelling,
so only conservative-correctness exaustive tests are performed.
Also, pending resolution of disscussion in D70043 <https://reviews.llvm.org/D70043> whether or not
we should bother to ensure production of empty-set ranges for all-overflow inputs i've gone ahead with presumption that we will want that.

So all in all this is pretty similar to `ConstantRange::mulWithNoWrap()` modelling in D70043 <https://reviews.llvm.org/D70043>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71011

Files:
  llvm/include/llvm/IR/ConstantRange.h
  llvm/lib/IR/ConstantRange.cpp
  llvm/unittests/IR/ConstantRangeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71011.232108.patch
Type: text/x-patch
Size: 4816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191204/83727319/attachment.bin>


More information about the llvm-commits mailing list