This patch adds isConstant and getConstant for determining if KnownBits represents a constant value and to retrieve the value. Use them to simplify code.
Unfortunately SimplifyDemandedBits needs to check if DemandedMask is a subset of the known bits so we can't use isConstant there. Maybe we need to add a method like areDemandedBitsConstant?
braces