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@318090
91177308-0d34-0410-b5e6-
96231b3b80d8
//
template <> struct isa_impl<Constant, Value> {
static inline bool doit(const Value &Val) {
- return Val.getValueID() >= Value::ConstantFirstVal &&
- Val.getValueID() <= Value::ConstantLastVal;
+ static_assert(Value::ConstantFirstVal == 0, "Val.getValueID() >= Value::ConstantFirstVal");
+ return Val.getValueID() <= Value::ConstantLastVal;
}
};