llvm-project/llvm
Nikita Popov 4246106aba [ConstantRange] Add unsigned and signed intersection types
The intersection of two ConstantRanges may consist of two disjoint
ranges. As we can only return one range as the result, we need to
return one of the two possible ranges that cover both. Currently the
result is picked based on set size. However, this is not always
optimal: If we're in an unsigned context, we'd prefer to get a large
unsigned range over a small signed range -- the latter effectively
becomes a full set in the unsigned domain.

This revision adds a PreferredRangeType, which can be either Smallest,
Unsigned or Signed. Smallest is the current behavior and Unsigned and
Signed are new variants that prefer not to wrap the unsigned/signed
domain. The new type isn't used anywhere yet (but SCEV will be a good
first user, see D60035).

I've also added some comments to illustrate the various cases in
intersectWith(), which should hopefully make it more obvious what is
going on.

Differential Revision: https://reviews.llvm.org/D59959

llvm-svn: 357873
2019-04-07 18:44:36 +00:00
..
benchmarks
bindings
cmake [llvm] [cmake] Add additional headers only if they exist 2019-04-04 14:21:38 +00:00
docs last changes for now 2019-04-07 14:34:24 +00:00
examples
include [ConstantRange] Add unsigned and signed intersection types 2019-04-07 18:44:36 +00:00
lib [ConstantRange] Add unsigned and signed intersection types 2019-04-07 18:44:36 +00:00
projects
resources
runtimes [runtime] Use --strip-all rather than --strip-sections 2019-03-10 04:26:54 +00:00
test Reapply [ValueTracking] Support min/max selects in computeConstantRange() 2019-04-07 17:22:16 +00:00
tools [llvm-objdump] Split disassembleObject and simplify --{start,stop}-address handling 2019-04-07 16:33:24 +00:00
unittests [ConstantRange] Add unsigned and signed intersection types 2019-04-07 18:44:36 +00:00
utils [gn] Support for per-target runtime directory layout 2019-04-06 23:05:56 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Moved everything SMT-related to LLVM and updated the cmake scripts. 2019-03-25 17:47:45 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.