Skip to content

Conversation

@inkreasing
Copy link

This includes the fix for rust-lang/rust#149250, which made rtsan unusable.

This is my first time doing a llvm update, so let me know if something looks wrong. I am not sure if you only want to update to a llvm dot release or anything on the release branch is fine. If you want a dot release i will wait until 21.1.8 is released.

c-rhodes and others added 18 commits November 4, 2025 09:28
The VM_MEMORY_SANITIZER constant was added in macOs 10.15 and friends.
Support using the constant on older OSes.

Fixes llvm#156144

(cherry picked from commit bc55f4f)
This patch just copies the definitions from main, which should be working.
There are a lot of changes that were not explicitly backported.
… units (llvm#166272)

Fixes llvm#165445.

Fixes a crash when `ASTWriter::GenerateNameLookupTable` processes enum
constants from C++20 header units.

The special handling for enum constants, introduced in fccc6ee, doesn't
account for declarations whose owning module is a C++20 header unit. It
calls `isNamedModule()` on the result of
`getTopLevelOwningNamedModule()`, which returns null for header units,
causing a null pointer dereference.

(cherry picked from commit bc08e69)
We need to take into account that we may have already done a FirstSPAdjust.

Fixes llvm#164805.

(cherry picked from commit ff11b93)
…oves produced after forwarded uses (llvm#167336)

As reported in <llvm#166870>,
some copies with src==reg are not no-ops, e.g. when self-assigning a
w-reg on AArch64 which will zero-extend the corresponding x register.

Revert in order to fix the issue. We may revisit whether the
optimisation can be made safe at a later point.

Reverts dffbc03.
Fixes llvm#166870.

(cherry picked from commit a314b3b)
This was causing a build failure on Darwin and a test failure on Linux.
This config is not widely used or well tested, so I don't think the
potential and likely small performance gains and the portability from
this are worth the maintenance costs.

(cherry picked from commit 1906c3e)
…tion motion" (llvm#167465)

This patch introduces a new virtual method
`TargetInstrInfo::isSafeToMove()` to allow backends to control whether a
machine instruction can be safely moved by optimization passes.

The `BranchFolder` pass now respects this hook when hoisting common
code. By default, all instructions are considered safe to to move.

For LoongArch, `isSafeToMove()` is overridden to prevent
relocation-related instruction sequences (e.g. PC-relative addressing
and calls) from being broken by instruction motion. Correspondingly,
`isSchedulingBoundary()` is updated to reuse this logic for consistency.

Relands llvm#163725

(cherry picked from commit ea10026)
… 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)
@dianqk dianqk merged commit 89bab96 into rust-lang:rustc/21.1-2025-08-01 Dec 10, 2025
24 of 25 checks passed
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.