Split the logic behind CastInst::isNoopCast into a separate static function,