Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc49dc3b

Browse files
authored
GH-115802: Optimize JIT stencils for size (GH-136393)
1 parent798f791 commitc49dc3b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎Tools/jit/_targets.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ async def _compile(
137137
f"-I{CPYTHON/'Include'/'internal'/'mimalloc'}",
138138
f"-I{CPYTHON/'Python'}",
139139
f"-I{CPYTHON/'Tools'/'jit'}",
140-
"-O3",
140+
# -O2 and -O3 include some optimizations that make sense for
141+
# standalone functions, but not for snippets of code that are going
142+
# to be laid out end-to-end (like ours)... common examples include
143+
# passes like tail-duplication, or aligning jump targets with nops.
144+
# -Os is equivalent to -O2 with many of these problematic passes
145+
# disabled. Based on manual review, for *our* purposes it usually
146+
# generates better code than -O2 (and -O2 usually generates better
147+
# code than -O3). As a nice benefit, it uses less memory too:
148+
"-Os",
141149
"-S",
142150
# Shorten full absolute file paths in the generated code (like the
143151
# __FILE__ macro and assert failure messages) for reproducibility:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp