We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent798f791 commitc49dc3bCopy full SHA for c49dc3b
Tools/jit/_targets.py
@@ -137,7 +137,15 @@ async def _compile(
137
f"-I{CPYTHON/'Include'/'internal'/'mimalloc'}",
138
f"-I{CPYTHON/'Python'}",
139
f"-I{CPYTHON/'Tools'/'jit'}",
140
-"-O3",
+# -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",
149
"-S",
150
# Shorten full absolute file paths in the generated code (like the
151
# __FILE__ macro and assert failure messages) for reproducibility: