[CodeGen] Add MVT::isValid to replace manual validity checks. NFC.