Skip to content

Update compiler-rt from LLVM 22.1.8 to 23.1.3 - #27808

Closed
arsnyder16 wants to merge 12 commits into
emscripten-core:mainfrom
arsnyder16:asnyder/update-compiler-rt
Closed

arsnyder16 wants to merge 12 commits into
emscripten-core:mainfrom
arsnyder16:asnyder/update-compiler-rt

Conversation

@arsnyder16

@arsnyder16 arsnyder16 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

This updates compiler-rt from LLVM 22.1.8 to LLVM 23.1.3:
https://github.com/llvm/llvm-project/releases/tag/llvmorg-23.1.3

This restores coverage affected by #27223. The current LLVM toolchain emits raw profile version 11, while compiler-rt 22.1.8 uses version 10. This mismatch causes programs built with -fcoverage-mapping to trap while writing profile data. Updating compiler-rt brings the runtime in sync with the toolchain and allows test_fcoverage_mapping to be re-enabled. Keeping compiler-rt continuously synchronized with the compiler remains a separate task in #27223.

The LLVM 22 downstream branch was first refreshed from Emscripten main using system/lib/push_llvm_changes.py:
emscripten-core/llvm-project#23

The complete downstream runtime patch set was then ported to LLVM 23.1.3. The patch branch is ready for review against the LLVM 23 base branch in the Emscripten LLVM fork:
https://github.com/arsnyder16/llvm-project/tree/asnyder/emscripten-libs-23-review

Additional changes:

  • Exclude InstrProfilingPlatformROCm.cpp and InstrProfilingPlatformROCmHSA.cpp from the standard profiling runtime. LLVM 23 builds these only as part of its separate opt-in profile_rocm runtime, while Emscripten otherwise includes every profile .cpp file.

@sbc100

sbc100 commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

@aheejin has normally be overseeing the llvm version upgrades for these libraries. @aheejin do you want to take care of this again this time around?

One thing we should do is open a tracking issue for the llvm 23 library upgrades.

…er-rt

# Conflicts:
#	test/codesize/test_codesize_hello_dylink_all.json
…er-rt

# Conflicts:
#	test/codesize/test_codesize_hello_dylink_all.json
…er-rt

# Conflicts:
#	test/codesize/test_codesize_hello_dylink_all.json
@arsnyder16

Copy link
Copy Markdown
Contributor Author

@aheejin @sbc100 Any update here?

@aheejin

aheejin commented Oct 7, 2026

Copy link
Copy Markdown
Member

Sorry, I am OOO for two weeks now. Will be back next week.

@arsnyder16 arsnyder16 changed the title Update compiler-rt to LLVM 23.1.2 Update compiler-rt from LLVM 22.1.8 to 23.1.3 Oct 16, 2026
@sbc100

sbc100 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

I created a tracking bug for the llvm library update: #27992

@hoodmane

Copy link
Copy Markdown
Collaborator

Would be nice to see this fixed. I've been looking to make PGO work with Python since it improves performance by about 10%, but this is a blocker for that as I understand it. Unless you paste over the installed copy of Emscripten with the right compiler-rt.

@sbc100

sbc100 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Would be nice to see this fixed. I've been looking to make PGO work with Python since it improves performance by about 10%, but this is a blocker for that as I understand it. Unless you paste over the installed copy of Emscripten with the right compiler-rt.

I think for that you really want #27223 (the continuous update of compiler-rt). This PR is just a one of update to v23 (when tot / emscripten is already ahead of that).

@arsnyder16

Copy link
Copy Markdown
Contributor Author

I think for that you really want #27223

@sbc100 I have had this frustration for sure and its a struggle to get the changes i need all in a single release. More thoughts added in #27992

@sbc100

sbc100 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Can we land the https://github.com/arsnyder16/llvm-project/tree/asnyder/emscripten-libs-23 patches branch first? i.e. can you sent a PR for that in our fork? It should target the llvm 23 base branch. Once we approve it I will push emscripten-libs-23 to out fork.

Are you sure you captured all the current changes in this branch? Normally I run system/lib/push_llvm_changes.py in the old branch (in this case emscripten-libs-22) before doing a rebase onto the new one. Did you do that somehow?

aheejin added a commit to emscripten-core/llvm-project that referenced this pull request Oct 19, 2026
This adds all cumulative downstream changes so far to emscripten-libs-23
branch (which currently is at llvmorg-23.1.3 upstream tag).

Normally I used to upload this after all changes are finalized with
Emscripten library updates and all tests pass. But given that the
compiler-rt update has been requested
(emscripten-core/emscripten#27808), I'll upload
this as a draft here, and add more changes to this as I fix tests.

@aheejin aheejin 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.

I uploaded #28011, mostly because without running the script myself I wasn't able to confirm this contains everything. Currently the two PRs have some differences.

Comment thread ChangeLog.md Outdated
Comment thread test/test_core.py
@arsnyder16

Copy link
Copy Markdown
Contributor Author

@aheejin Your PR is fine. i can follow up enabling that test coverage test

@arsnyder16 arsnyder16 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants