Closed
Description
...as discussed in faster-cpython/ideas#568.
By adding a dedicated instruction for converting values to bool, we can easily specialize the conditions of all remaining branches in the bytecode while keeping the branches themselves as "dumb" and simple as possible.
This is one of the few remaining common cases where a little specilization will give us a lot of useful information (such as "this branch won't execute arbitrary code") for higher tiers of optimization. Plus, the most common specializations (such as for bool
or None
) will be effectively no-ops.