[ELF] Speed up ICF by hashing relocations and propagating over an edge list (#233697)
ICF's initial hash covers section contents and, since
https://reviews.llvm.org/D56986, two rounds of relocation target hashes,
but not what constantEq compares: offsets, types, addends, merge-section
offsets, and names of undefined or preemptible targets. Sections that
differ only in relocations, e.g. the string or external function they
reference, share a hash at every depth, which is why D56986 found no
gain from more rounds. segregate() separates them with a quadratic
number of equalsConstant calls, which dominates a Chromium --icf=all
link.
Hash what constantEq compares, and propagate hashes over relocations to
other candidates for 7 rounds. Each round saves up to one segregate()
pass. Also parallelize the symbol fold loop.
--threads=8, --icf=all, output byte-identical at --threads=1 and 8:
```
[7 lines not shown]
[KnownFPClass] Properly handle the denormal mode for fma (#234821)
Fixes https://github.com/llvm/llvm-project/issues/228972
I have made it so `KnownFPClass::fma` will only flush input denormals
before the multiplication step, and flush output denormals after the
addition step.
In total, this changes:
- Applying the input denormal mode to the Addend
- Applying the output denormal mode to the result
- Not applying the output denormal mode to the intermediate `fmul` step
The tests I added are not currently observable since `KnownFPClass::fma`
is not capable of refining zero/subnormal results precisely enough.
AI Disclosure:
I used Claude Opus 5 to help write the tests.
[clang][CodeGen] Copy function attributes to .inline builtin clones (#234081)
0f0e31cf511d created a separate `.inline` function for inline builtins
instead
of renaming `Fn` in place, but only set `alwaysinline` on the clone.
Exposed by #215264: missing target attributes can prevent inlining
`.inline`
clones, and missing `noundef` parameter attributes cause MSan false
positives
when the clone is not inlined.
Assisted-by: Gemini
[libc++] Cache the result of LNT commit refinement less aggressively (#234825)
At least as we tweak the new pipeline, waiting 3 hours to trigger new
commits is too long.
[BPF] Add UHMUL and SHMUL instruction variants with -mcpu=v5 (#234076)
This patch adds LLVM support for the unsigned and signed high-half
multiply instructions (UHMUL and SHMUL) proposed for the BPF ISA [1].
The instructions use the existing `BPF_MUL` opcode with the offset field
distinguishing the variants:
- `off = 1`: UHMUL, returning the upper 64 bits of an unsigned 64×64-bit
product.
- `off = 2`: SHMUL, returning the upper 64 bits of a signed 64×64-bit
product.
Both register and immediate forms are supported. For example:
```asm
r1 uh*= r2
r3 sh*= r4
r5 uh*= -2
[42 lines not shown]
[BOLT][RISCV] Handle cross-fragment branches in split functions (#223958)
Function splitting can place RISC-V hot and cold fragments beyond the ±1
MiB JAL range, causing relocation overflows.
Add `RISCVLongJmpPass` before function finalization to redirect each
cross-fragment CFG edge through a stub in the source fragment. The stub
uses `PseudoJump`, which expands to AUIPC/JALR without modifying ra and
can be shortened by JITLink when the target is within range.
Since RISC-V has no ABI-reserved scratch register for arbitrary
intra-function branches, need to select a caller-saved GPR that is dead
at the target. Conservatively exclude registers referenced by CFI and
disable scratch selection when raw CFI escapes are present. If any edge
has no safe scratch register, cancel splitting for that function while
preserving its basic block layout order.
NAS-144823 / 27.0.0 / Add layout parameter to sharing.s3 (by anodos325) (#20042)
Add a new create-time-only field to sharing.s3 `layout` that indicates
whether the specified share is used as a normal truenas S3 bucket, which
implies a certain directory structure `s3data` contains the live data
export and `.truenas_s3` contains a side tree with versions, in-progress
multipart uploads, etc. Or a "whole dataset" bucket.
Whole dataset buckets are readonly and are used for cases where
administrators wish to export existing RW NFS / SMB shares over S3 in a
readonly manner.
The configuration knob used to determine the type of bucket to be
created (and once again, this is create-time only), is the new `layout`
parameter that supports two values:
* BUCKET - a conventional S3 oriented bucket that may optionally be
exported RO via NFS / SMB
[12 lines not shown]
games/xray-16: Fix g_actor assertion in minimap update
Since the CUIZoneMap::Update(const CActor*) refactor the minimap radar
is updated even when the current view entity is not an actor. Map
locations then call Actor() from CMapLocation::UpdateSpot(), which
asserts (debug) or dereferences NULL (release). Skip the radar update
when there is no actor.
PR: 299743
Sponsored by: UNIS Labs (vvd)
Co-authored-by: Vladimir Druzenko <vvd at FreeBSD.org>
MFH: 2026Q4
(cherry picked from commit 7ffddc938047e2dce2d47424585ceb4a5e6179a0)
games/xray-16: Fix g_actor assertion in minimap update
Since the CUIZoneMap::Update(const CActor*) refactor the minimap radar
is updated even when the current view entity is not an actor. Map
locations then call Actor() from CMapLocation::UpdateSpot(), which
asserts (debug) or dereferences NULL (release). Skip the radar update
when there is no actor.
PR: 299743
Sponsored by: UNIS Labs (vvd)
Co-authored-by: Vladimir Druzenko <vvd at FreeBSD.org>
MFH: 2026Q4
NAS-144823 / 28.0.0-BETA.1 / Add layout parameter to sharing.s3 (#20035)
Add a new create-time-only field to sharing.s3 `layout` that indicates
whether the specified share is used as a normal truenas S3 bucket, which
implies a certain directory structure `s3data` contains the live data
export and `.truenas_s3` contains a side tree with versions, in-progress
multipart uploads, etc. Or a "whole dataset" bucket.
Whole dataset buckets are readonly and are used for cases where
administrators wish to export existing RW NFS / SMB shares over S3 in a
readonly manner.
The configuration knob used to determine the type of bucket to be
created (and once again, this is create-time only), is the new `layout`
parameter that supports two values:
* BUCKET - a conventional S3 oriented bucket that may optionally be
exported RO via NFS / SMB
[20 lines not shown]
[LoongArch] Select branches on `V{ALL,ANY}_{,NON}ZERO` to consume $FCC directly (#230801)
Much like what's already done in #226814, this PR matches branches that
use `V{ALL,ANY}_{,NON}ZERO` on the LHS and 0 on the RHS, and tries to
consume `$FCC0` directly when possible.
Two new tests focusing on vector branch-against-zero intrinsics are
added, one for LSX and one for LASX.
Fixes: #229443
Depends-on: #230799
[mlir][linalg] Fix incorrect hoisting of transfers with mismatched masks (#232246)
`hoist_redundant_vector_transfers` can change the result of a loop when
the read and write have different mask operands.
For example, `%buffer` initially contains `[0, 0]`, `%mask` is `[true,
false]`, `%zero` is `0`, and `%ones` is `[1, 1]`:
```mlir
scf.for %i = %c0 to %c2 step %c1 {
%v = vector.transfer_read %buffer[%c0], %zero, %mask
{in_bounds = [true]} : memref<2xi32>, vector<2xi32>
%next = arith.addi %v, %ones : vector<2xi32>
vector.transfer_write %next, %buffer[%c0]
{in_bounds = [true]} : vector<2xi32>, memref<2xi32>
}
```
The masked read returns zero for the second element on every iteration.
[24 lines not shown]