Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318087
91177308-0d34-0410-b5e6-
96231b3b80d8
//// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V) {
- return V->getValueID() >= ConstantFirstVal &&
- V->getValueID() <= ConstantLastVal;
+ static_assert(ConstantFirstVal == 0, "V->getValueID() >= ConstantFirstVal always succeeds");
+ return V->getValueID() <= ConstantLastVal;
}
/// This method is a special form of User::replaceUsesOfWith