Add _REPLACE_WITH_TRUE
to the tier 2 optimizer
#128195
Labels
easy
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
_REPLACE_WITH_TRUE
is not currently in the tier 2 optimizer's known list, resulting in some missed opportunities.To add it, here are the following steps:
_REPLACE_WITH_TRUE
inPython/optimizer_bytecodes.c
, with the same header as the one inPython/bytecodes.c
.optimizer_bytecodes.c
should sayres = sym_new_const(ctx, Py_True);
. Meaning that the new value is a new symbolic constant of the value "True".make regen-cases
on *nix.Lib/test/test_capi/test_opt.py
. This is optional, you can choose not to as well.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
_REPLACE_WITH_TRUE
to the tier2 optimizer #128203The text was updated successfully, but these errors were encountered: