[KnownBits] Add methods for determining if the known bits represent a negative/nonneg...
authorCraig Topper <craig.topper@gmail.com>
Sat, 29 Apr 2017 16:43:11 +0000 (16:43 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sat, 29 Apr 2017 16:43:11 +0000 (16:43 +0000)
commitca48af3c8786ad64a1533eaabae94a05028fbbf6
treefb37cf54998a412934244449aca229202a9c095e
parent9d580e85281c743ce3e8a18c935956bd78f1ea90
[KnownBits] Add methods for determining if the known bits represent a negative/nonnegative number and add methods for changing the negative/nonnegative state

Summary: This patch adds isNegative, isNonNegative for querying whether the sign bit is known. It also adds makeNegative and makeNonNegative for controlling the sign bit.

Reviewers: RKSimon, spatel, davide

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 301747
llvm/include/llvm/Support/KnownBits.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp