GH-115819: Eliminate Boolean guards when value is known (GH-116355)

This commit is contained in:
Mark Shannon 2024-03-05 15:06:00 +00:00 committed by GitHub
parent c91bdf86ef
commit 0c81ce1360
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 102 additions and 2 deletions

View file

@ -231,6 +231,15 @@ _Py_uop_sym_new_null(_Py_UOpsContext *ctx)
return null_sym;
}
bool
_Py_uop_sym_has_type(_Py_UopsSymbol *sym)
{
if (_Py_uop_sym_is_bottom(sym)) {
return false;
}
return sym->typ != NULL;
}
bool
_Py_uop_sym_matches_type(_Py_UopsSymbol *sym, PyTypeObject *typ)
{