[PATCH] D60377: [ConstantRange] Add PreferredResultType support for unionWith()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 07:41:42 PDT 2019


nikic created this revision.
nikic added a reviewer: lebedev.ri.
Herald added subscribers: llvm-commits, javed.absar, hiraditya.
Herald added a project: LLVM.

This extends D59959 <https://reviews.llvm.org/D59959> to unionWith(), allowing to specify that a non-wrapping unsigned/signed range is preferred. This is somewhat less useful than the intersect case, because union operations are rarer. An example use would the the phi union computed in SCEV.

The implementation is mostly a straightforward use of getPreferredRange(), but I also had to adjust some <=/< checks to make sure that no ranges with lower==upper get constructed before they're passed to getPreferredRange(), as these have additional constraints.


Repository:
  rL LLVM

https://reviews.llvm.org/D60377

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: D60377.194061.patch
Type: text/x-patch
Size: 8060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190407/2a1dc830/attachment.bin>


More information about the llvm-commits mailing list