[KnownBits] Add methods for determining if KnownBits is a constant value
authorCraig Topper <craig.topper@gmail.com>
Wed, 3 May 2017 23:12:29 +0000 (23:12 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 3 May 2017 23:12:29 +0000 (23:12 +0000)
commit8189a87a1ed98a4f3fc3966e52ebad984f18f262
tree3efca7e7607b0f58d48f1d185d0127bb1774477d
parentb201a20eabd5292b2b4a2b0948eb26330d5da65b
[KnownBits] Add methods for determining if KnownBits is a constant value

This patch adds isConstant and getConstant for determining if KnownBits represents a constant value and to retrieve the value. Use them to simplify code.

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

llvm-svn: 302091
llvm/include/llvm/Support/KnownBits.h
llvm/lib/Analysis/ConstantFolding.cpp
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp