Skip to content

GH-115480: Reduce guard strength for binary ops when type of one operand is known already - #118050

Merged
markshannon merged 4 commits into
python:mainfrom
faster-cpython:more-tier2-binary-ops
Apr 22, 2024
Merged

GH-115480: Reduce guard strength for binary ops when type of one operand is known already#118050
markshannon merged 4 commits into
python:mainfrom
faster-cpython:more-tier2-binary-ops

Conversation

@markshannon

@markshannonmarkshannon commented Apr 18, 2024

Copy link
Copy Markdown
Member

Adds _GUARD_TOS_INT/FLOAT, _GUARD_NOS_INT/FLOAT and float variants and replaces _GUARD_BOTH_INT/FLOAT with them where able.

The stats show an 83% reduction in _GUARD_BOTH_INT and a 42% reduction in _GUARD_BOTH_FLOAT.

@gvanrossumgvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice win!

Comment threadPython/optimizer_bytecodes.c Outdated
markshannonand others added 2 commits April 19, 2024 09:25
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
@markshannon

Copy link
Copy Markdown
MemberAuthor

The four failures are a pre-existing issue with emulated ARM 64.

@markshannon
markshannon merged commit a6647d1 into python:mainApr 22, 2024
@markshannon
markshannon deleted the more-tier2-binary-ops branch August 6, 2024 10:16
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@markshannon@gvanrossum@Fidget-Spinner