Skip to content

Commit fff3775

Browse files
authored
Don't pass -fno-inline-functions when -Oz/-Os are used (#17843)
We have no reason not to let clang use its own heuristics here. As a followup we can consider completely removing the `INLINGING_LIMIT` setting since it no longer serves any purpose other than to set this clang flag.
1 parent 44df7ae commit fff3775

13 files changed

+41
-35
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ See docs/process.md for more on how version tagging works.
2121
3.1.22 (in development)
2222
-----------------------
2323
- compiler-rt updated to LLVM 15. (#17802)
24+
- Using `-Oz` or `-Os` will no longer pass `-fno-inline-functions` to clang and
25+
instead rely on clang's normal inline heuristics for these optimization
26+
levels. `-fno-inline-functions` can be passed explicitly if needed.
2427

2528
3.1.21 - 09/09/2022
2629
-------------------

emcc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,11 +3160,9 @@ def consume_arg_file():
31603160
if options.requested_level == 's':
31613161
options.requested_level = 2
31623162
settings.SHRINK_LEVEL = 1
3163-
settings_changes.append('INLINING_LIMIT=1')
31643163
elif options.requested_level == 'z':
31653164
options.requested_level = 2
31663165
settings.SHRINK_LEVEL = 2
3167-
settings_changes.append('INLINING_LIMIT=1')
31683166
settings.OPT_LEVEL = validate_arg_level(options.requested_level, 3, 'invalid optimization level: ' + arg, clamp=True)
31693167
elif check_arg('--js-opts'):
31703168
logger.warning('--js-opts ignored when using llvm backend')

test/code_size/hello_webgl2_wasm.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"a.html": 569,
33
"a.html.gz": 379,
44
"a.js": 4968,
5-
"a.js.gz": 2427,
6-
"a.wasm": 10418,
7-
"a.wasm.gz": 6674,
8-
"total": 15955,
9-
"total_gz": 9480
5+
"a.js.gz": 2428,
6+
"a.wasm": 10446,
7+
"a.wasm.gz": 6675,
8+
"total": 15983,
9+
"total_gz": 9482
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 567,
33
"a.html.gz": 379,
4-
"a.js": 18045,
5-
"a.js.gz": 7991,
4+
"a.js": 18065,
5+
"a.js.gz": 7983,
66
"a.mem": 3171,
77
"a.mem.gz": 2714,
8-
"total": 21783,
9-
"total_gz": 11084
8+
"total": 21803,
9+
"total_gz": 11076
1010
}

test/code_size/hello_webgl_wasm.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"a.html.gz": 379,
44
"a.js": 4447,
55
"a.js.gz": 2247,
6-
"a.wasm": 10418,
7-
"a.wasm.gz": 6674,
8-
"total": 15434,
9-
"total_gz": 9300
6+
"a.wasm": 10446,
7+
"a.wasm.gz": 6675,
8+
"total": 15462,
9+
"total_gz": 9301
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 567,
33
"a.html.gz": 379,
4-
"a.js": 17517,
5-
"a.js.gz": 7821,
4+
"a.js": 17536,
5+
"a.js.gz": 7833,
66
"a.mem": 3171,
77
"a.mem.gz": 2714,
8-
"total": 21255,
9-
"total_gz": 10914
8+
"total": 21274,
9+
"total_gz": 10926
1010
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
122337
1+
122342
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
122238
1+
122243
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
163779
1+
163784
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
135733
1+
135738

0 commit comments

Comments
 (0)