Skip to content

Cherry-pick all the missing 21.x commits until upstream EOL for 21.x#12714

Open
LumioseSil wants to merge 14 commits intoswiftlang:stable/21.xfrom
LumioseSil:swift-stable21-release-picks
Open

Cherry-pick all the missing 21.x commits until upstream EOL for 21.x#12714
LumioseSil wants to merge 14 commits intoswiftlang:stable/21.xfrom
LumioseSil:swift-stable21-release-picks

Conversation

@LumioseSil
Copy link
Copy Markdown

@LumioseSil LumioseSil commented Apr 4, 2026

This includes everything up to the final commit of LLVM 21.1.8, the last version of 21.x before it hit EOL.

Risk is minimal since this is all just fixing regressions.

dyung and others added 14 commits November 18, 2025 22:44
… when the compilation database is unavailable (llvm#153802)

fixes llvm#132413

(cherry picked from commit 5b55899)
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: https://phabricator.intern.facebook.com/D87662897
We already ensure that code for different architectures is always placed
in different pages in `assignAddresses`. We represent those ranges using
their first and last chunks. However, the RVAs of those chunks may not
be page-aligned, for example, due to extra padding for entry-thunk
offsets. Align the chunk RVAs to the page boundary so that the emitted
ranges correctly include the entire region.

This change affects an existing test that checks corner cases triggered
by merging a data section into a code section. We may now include such
data in the code range. This differs from MSVC’s behavior, but it should
not cause practical issues, and the new behavior is arguably more
correct.

Fixes llvm#168119.

(cherry picked from commit af45b02)
Addresses llvm#169377.

Previously, the RealtimeSanitizer pass only handled attributed function
_definitions_ in IR, and we have recently found that attributed function
_declarations_ caused it to crash. To fix the issue, we must check
whether the IR function is empty before attempting to do any
manipulation of its instructions.

This PR:

- Adds checks for whether IR `Function`s are `empty()` ~~in each
relevant~~ at the top-level RTSan pass routine
- ~~Removes the utility function `rtsanPreservedCFGAnalyses` from the
pass, whose result was unused and which would otherwise have complicated
the fix~~

(cherry picked from commit 5d4c441)
`FAKE_USE`s are essentially no-ops, so they have to be removed before
running ExplicitLocals so that `drop`s will be correctly inserted to
drop those values used by the `FAKE_USE`s.

---

This is reapplication of llvm#160228, which broke Wasm waterfall. This PR
additionally prevents `FAKE_USE`s uses from being stackified.

Previously, a 'def' whose first use was a `FAKE_USE` was able to be
stackified as `TEE`:
- Before
```
Reg = INST ...            // Def
FAKE_USE ..., Reg, ...    // Insert
INST ..., Reg, ...
INST ..., Reg, ...
```

- After RegStackify
```
DefReg = INST ...            // Def
TeeReg, Reg = TEE ... DefReg
FAKE_USE ..., TeeReg, ...    // Insert
INST ..., Reg, ...
INST ..., Reg, ...
```
And this assumes `DefReg` and `TeeReg` are stackified.

But this PR removes `FAKE_USE`s in the beginning of ExplicitLocals. And
later in ExplicitLocals we have a routine to unstackify registers that
have no uses left:

https://github.com/llvm/llvm-project/blob/7b28fcd2b182ba2c9d2d71c386be92fc0ee3cc9d/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp#L257-L269
(This was added in llvm#149626. Then it didn't seem it would trigger the
same assertions for `TEE`s because it was fixing the bug where a
terminator was removed in CFGSort (llvm#149097).
Details here:
llvm#149432 (comment))

- After `FAKE_USE` removal and unstackification
```
DefReg = INST ...
TeeReg, Reg = TEE ... DefReg
INST ..., Reg, ...
INST ..., Reg, ...
```
And now `TeeReg` is unstackified. This triggered the assertion here,
that `TeeReg` should be stackified:

https://github.com/llvm/llvm-project/blob/7b28fcd2b182ba2c9d2d71c386be92fc0ee3cc9d/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp#L316

This prevents `FAKE_USE`s' uses from being stackified altogether,
including `TEE` transformation. Even when it is not a `TEE`
transformation and just a single use stackification, it does not trigger
the assertion but there's no point stackifying it given that it will be
deleted.

---

Fixes emscripten-core/emscripten#25301.

(cherry picked from commit e5b2a06)
…170860)

This was creating a -1 with zero extension, while it needs to use sign
extension.

(cherry picked from commit 1165e41)
r13 does not provide the trap err.

Co-authored-by: Jerome Duval <jerome.duval@gmail.com>
(cherry picked from commit 62dbe57)
This patch backports a couple of patches that Tom and I submitted
recently to drop the usages of these actions. This allows us to delete
the usages in llvm/actions while keeping CI running in the release
branch.
This workflow is only used for libclang and SPIRV tests (and is
completely removed in main). Remove install-ninja and setup-windows
(only needed on non-Linux) so that we can remove them from llvm/actions.
@LumioseSil LumioseSil requested a review from a team as a code owner April 4, 2026 22:26
@LumioseSil
Copy link
Copy Markdown
Author

@adrian-prantl Thoughts?

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.