]> granicus.if.org Git - llvm/commit
[ConstantRange] Add isWrappedSet() and isUpperSignWrapped()
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 27 Mar 2019 19:12:09 +0000 (19:12 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 27 Mar 2019 19:12:09 +0000 (19:12 +0000)
commit58c0bdde21eae54cd9ea3ae93b0af84c0d6f65e5
tree04aad15927d5ebe56a39e9811f56a4ab89b949ff
parent9af297cc57f0d2ab5d8f931d8da0baaab8db3929
[ConstantRange] Add isWrappedSet() and isUpperSignWrapped()

Split off from D59749. This adds isWrappedSet() and
isUpperSignWrapped() set with the same behavior as isSignWrappedSet()
and isUpperWrapped() for the respectively other domain.

The methods isWrappedSet() and isSignWrappedSet() will not consider
ranges of the form [X, Max] == [X, 0) and [X, SignedMax] == [X, SignedMin)
to be wrapping, while isUpperWrapped() and isUpperSignWrapped() will.

Also replace the checks in getUnsignedMin() and friends with method
calls that implement the same logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357112 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/ConstantRange.h
lib/IR/ConstantRange.cpp
unittests/IR/ConstantRangeTest.cpp