Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.
llvm-svn: 318090
//
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;
}
};