[lld-macho] Build the export trie by edges, not bytes (#234857)
Emit singleton suffixes directly and scan common prefixes in one pass,
avoiding repeated byte-wise partitioning. This speeds up builds that
emit large export tries.
Wall time with
[LinkerBench](https://github.com/int3/macho-linker-bench),
release build, assertions off. Median ± 95% CI over at least 20
interleaved
runs per side.
## M4 Mac mini (10 cores, 16 GB):
| Link | Exports | 10 threads | 1 thread |
| --- | ---: | ---: | ---: |
| rust-analyzer (debug) | 248,607 | 650.3 ± 1.2 → 625.4 ± 1.9 ms (−3.8%)
| 951.7 ± 0.9 → 870.3 ± 1.7 ms (−8.6%) |
| SourceKit-LSP | 105,359 | 604.2 ± 2.3 → 605.4 ± 1.6 ms | 774.5 ± 1.3 →
[13 lines not shown]
[SLP]Extract vectorized pointers used by vector loads
Blended loads, loads of extracted aggregates and loads with leading
poison lanes use scalar pointers directly, which get erased if they
are vectorized. Register them as external uses to replace all their
uses with the extracts.
Fixes #236177
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/236623
www/mod_sgi4: removed MOVED line now the port has been reintroduced
The port has been reintroduced, so this is no longer needed
and may break existing setups that have mod_wsgi4 installed.
Fixes: 0121f370d86ddea8411bacfb72961eecedbd163a
Approved by: clusteradm
[LoongArch] Compute known bits and sign bits for BSTRINS/BSTRPICK (#233738)
BSTRINS and BSTRPICK are formed early by DAG combines, so the generic
known-bits and sign-bits analyses see them as opaque target nodes. When
such a value is live out of a block, its LiveOutInfo is lost and PHIs
merging it can no longer prove that the value is already sign- or
zero-extended, leaving redundant addi.w/bstrpick.d behind.
This is common in Rust code decoding UTF-8, e.g. `str::chars().rev()`,
where the multi-byte path assembles the code point with bstrins.d and is
merged with the ASCII byte loaded by ld.b before an i32 compare.
rustc-perf svg-parse-1 on LA664: instructions -2.4%, cycles -1.7%.
ena: Retrieve RSS indirection table size from the device in ena-com
This patch allows the driver to create RSS indirection table with the
size advertised by the device.
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Fix ENA_MEM_FREE_COHERENT with an expression size argument
ENA_MEM_FREE_COHERENT() discards its size parameter with "(void)size".
A cast binds tighter than '*', so when the argument is an in-place
calculation the macro expands to ((void)(a)) * b, which fails to
compile with "void value not ignored as it ought to be".
Wrap the parameter in parentheses before casting it. No functional
change for existing callers, which all pass a plain variable.
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
[PGO] Load GPU wave counts into IR metadata
GPU profiles contain wave counts alongside lane counts, but profile use
does not expose them to optimizations. Wave visits do not obey scalar
flow conservation, so unmeasured blocks cannot use counts reconstructed
from neighboring blocks or ordinary branch weights.
Map wave-counter indices to the blocks selected by PGO instrumentation,
after reproducing its critical-edge splits. For dense profiles, also map the
appended wave-only slots to eligible blocks in function order, after the
original block/select prefix. Select the layout from the profile flags.
Attach measured counts using wave.profile metadata, retaining measured
zeros and marking blocks without measurements unavailable. Require a
measured entry count for normalization and exclude select-counter slots
from the block mapping. Repeated instrumentation sites for the same block
represent one measurement and are not summed.
Validate the wave-counter layout against the accepted lane profile.
Clear old wave metadata when loading a replacement profile, including
[14 lines not shown]
amd64 FRED: normalize the user-provided 'fred' knob value
Assembler accesses 'fred' as byte, ensure that any non-zero
user-provided value works. This is pure cosmetics.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
amd64 resumectx(): restore FRED state before loading %cr4
%cr4 has the FRED enable bit. This only matters for NMI and #MC, and the
kernel is really not ready to handle them while in resumectx(), but do
it for formal correctness.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
amd64 FRED: no need to store fs/gsbase on user_fred_not_syscall path
The stores are only relevant for PCB_FULL_IRET return to userspace,
and setting the flag stores the bases into the pcb anyway. Also, the
hidden issue is that FRED already did implicit SWAPGS on entry, so
stored gsbase was wrong anyway.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
amd64 FRED: handle in-kernel faults same as IDT
Pass #MC and #DF directly to corresponding handlers, avoiding EFI
pcb_onfault case.
If a fault occurs while kdb/ddb is active, handler must call
kdb_reenter() and not do the normal processing, which typically ends up
in panic() for kernel-mode faults. But #MC and #DF should be excluded
there as well.
NMI is not an exception, it is delivered as specific event.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
[IR] Define GPU wave-profile metadata
Existing offload GPU profile counters measure lane executions, while
GPU instructions execute at wave granularity under an active-lane
mask. A block visited by every wave can therefore look cold when only
a few lanes are active. Scalar branch weights also cannot represent a
divergent wave visiting both successors before reconverging. These
profiles are a poor fit for optimizations that estimate work performed
by a wave.
Lane counters remain useful for measuring per-lane branch selectivity
and estimating work that scales with the number of active lanes.
Wave counters cannot replace them: a visit with one active lane and a
visit with all lanes active both count as one. The two profiles provide
complementary information about instruction execution and lane activity.
Introduce wave.profile and wave.profile.block metadata to represent
measured wave visits to IR blocks. Each dynamic visit with at least one
active lane contributes one to the count. A measured zero is distinct
[19 lines not shown]
[RISCV][P-ext] Add isel pattern for mul.w01/mul.w11 (#236323)
`mul.w01` multiplies the sign-extended lower word of rs1 by the
sign-extended upper word of rs2, and `mul.w11` multiplies the
sign-extended upper words of both. Both produce a 64-bit result and
are RV64 only.
Previously, (sra X, 32) was selected as a separate srai feeding `mul`.
Match it directly so the shift is folded.
rtwn: fix 8188f channel offset / width programming
* rtwn_chan2centieee() already calculates the proper centre
frequency, so it doesn't need to be further offset.
* Don't program R92C_RF_CHNLBW with further 20MHz wide bits;
the rest of the programming works correctly for 20/40MHz
operation.
Tested:
* Verified against the linux rtl8xxxu/8188f.c code.
* Tested w/ 20 and 40MHz 11n; 40MHz is now operating at higher
speed.
Fixes: 2c38dc04d6f8bc84620bb3b67c8ccd9f910c4d03
[Support] Add missing cast to uch (#236493)
In #174150, a call to `isdigit(PEEK())` was added, but `PEEK()` expands
to an expression of type `char` and `isdigit` requires its argument to
be `unsigned char`. Elsewhere in this file, this is done by just casting
the argument, `isalpha((uch)PEEK())`, so do the same here.
Revert "[asan] Adopt sanitizer_common operator-new framework (#196388)" (#236607)
#196388 made ASan's throwing operator new throw std::bad_alloc when
allocator_may_return_null=1. That exception does not reach the caller in
two configurations:
- arm64 Darwin linked with ld64.lld. asan_win.cpp compiles to an empty
object that is linked right before asan_new_delete.cpp.o, and ld64.lld
writes an encoding-0 (no unwind information) compact unwind entry at
operator new's address (#224949). The unwinder cannot step out of
operator new, so the std::bad_alloc it throws terminates the program
instead of reaching the caller's handler. The linker fix is #225055.
- Android. Both libclang_rt.asan-\*-android.so and libc++_shared.so link
static libc++abi.a, so the two libraries have separate new-handler state
and std::bad_alloc type info (#235557).
This also reverts #235557, which marked tests XFAIL on Android only
because of #196388.
[4 lines not shown]
Build the vdev config in place instead of copying it.
vdev_config_generate() built each child's nvlist on its own, copied it
into the parent and then freed it. The extended stats and the vdev
tree in spa_config_generate() were added the same way. In a config
with stats, the stats of a leaf under a raidz vdev were copied four
times.
Each nested nvlist is now added empty and filled where it lives. The
output is the same. vdev_config_generate() keeps its interface and
calls the new vdev_config_generate_impl().
On a pool with 1200 disks, building the config that
ZFS_IOC_POOL_STATS returns took about 287 ms before and about 80 ms
after. This was measured in userland with libzpool. In a perf profile
of that ioctl the copies were about 55% of the samples.
Signed-off-by: Caleb St. John <yocalebo at gmail.com>
Reviewed-by: Ameer Hamza <ameer.hamza at truenas.com>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #19355
[lldb] Add libstdcpp atomic data formatters (#174218)
This patch adds a new synthetic child provider and a summary formatter
for the libstdc++ implementation of std::atomic<>.