[llvm-profgen] Read build ID from binary for perfscript address filtering (#190862)
For shared libraries (.so), read the binary's build ID during load()
using object::getBuildID() and store it as FilterBuildID. Main
executables keep FilterBuildID empty, matching the convention that
their perfscript addresses have no buildid prefix.
This enables automatic build ID-based filtering of perfscript
addresses in [buildid:]0xaddr format without requiring a CLI option.
[BOLT] Use identify_magic for shared library detection (#190902)
Replace the fragile filename-based check (ends_with(".so")) with
identify_magic()/file_magic::elf_shared_object to reliably detect
shared libraries when filtering pre-aggregated profile data by
build ID.
Test Plan: pre-aggregated-perf-shlib.test
[orc-rt] Add Session::attach convenience overload. (#191199)
This overload enables one-line attach in the common case where the
ControllerAccess implementation does not require any configuration after
construction.
[CIR] Implement variable size array cleanup (#191247)
This implements partial array destruction for variable sized arrays. The
cir.array.dtor operation already had support for variable length, so
this change only needs to add the variable handling in
`emitArrayDestroy` and `emitArrayLength`.
Assisted-by: Cursor / claude-4.6-opus-high
[clang][modules] Add warning for symlinks to modular headers (#188059)
Symlinks that are not covered by a module that point to a header owned
by a module create situations where if a header is owned by a module
depends on which headers were included prior.
This adds a diagnostic for such cases when they can be detected, and
informs the user to use a textual forwarding header instead.
This bypasses Clang's FileManager and VFS as they don't know about
symlinks. The diagnostic is worded as "may" because of this.
[llvm-lit] Ignore malformed `.lit_test_times` entries
When running `llvm-lit`, I sometimes hit a traceback, because a
`.lit_test_times.txt` file has got corrupted (not sure how).
However, it's non-obvious what the issue is (you just get a traceback),
so I've fixed this as follows:
`read_test_times()` currently assumes every line in .lit_test_times.txt
contains a floating-point time followed by a test path. If the file
contains a blank line, a line without a path, or a non-numeric time,
lit raises during discovery instead of skipping the bad entry.
Fix this by parsing each line defensively. Split once, ignore lines
that do not produce both fields, and ignore entries whose time cannot
be parsed as a float. This keeps the existing behavior for valid lines
while making malformed timing files non-fatal.
Add a new `malformed-test-times.py` regression test and a checked-in
lit_test_times fixture containing both valid and malformed entries. The
[3 lines not shown]
NAS-139412 / 27.0.0-BETA.1 / Persist local reboot reasons (#18658)
## Problem
Local reboot reasons (`SystemRebootService.reboot_reasons`) were stored
in an in-memory Python dict. If middleware restarted without a system
reboot (crash, OOM, `systemctl restart middlewared`), all accumulated
reasons were silently lost. This caused failover to be unblocked
prematurely (`LOC_FIPS_REBOOT_REQ` / `LOC_UPGRADE_REBOOT_REQ` vanished
from `failover.disabled.reasons`), `toggle_reason` to invert its
behavior after restart, and the remote node to get a false "all clear"
when querying `system.reboot.info`. Additionally, the existing keyvalue
key naming for remote reboot reasons (`remote_reboot_reasons_A` meaning
"reasons recorded BY Node A about the other node") was confusing.
## Solution
- **Local reasons persisted via volatile cache**: Replace the in-memory
dict with the `cache` service (TDB VOLATILE at
[22 lines not shown]
[AArch64][clang] Fix `__arm_atomic_store_with_stshh` ordering and lowering
`__builtin_arm_atomic_store_with_stshh` must satisfy two constraints:
- preserve release/seq_cst ordering in LLVM IR
- keep `stshh` immediately adjacent to the final store in codegen
The original target-intrinsic lowering preserved the final `stshh` + store
sequence, but it did not model ordering strongly enough in LLVM IR, so the
optimizer could sink earlier stores across the builtin.
Fix this by inserting a `release` or `seq_cst` fence before the intrinsic
call. This preserves ordering in optimized IR while still letting the
backend emit the required final instruction sequence. This means we now
get a `dmb ish` instruction before the `stshh` instruction.
Also relax Sema for the builtin to accept storing 8/16/32/64-bit
floating-point and pointer values in addition to integers, and update
the diagnostic text accordingly.
[5 lines not shown]
Reapply "[clang][ModulesDriver] Add support for Clang modules to -fmodules-driver" (#191258)
This relands #187606 (reverted with #191122).
In the initial PR, the Clang module precompile jobs were created as
`CC1Command` objects instead of regular `Command` objects, which
introduced a memory leak.
(See discussion in https://reviews.llvm.org/D74447)
This has been fixed in this reland.
[RISCV][P-ext] Recognize (select (X >u ((1 << C) - 1), sext(X >s -1), trunc(X)) as usati (#190810)
Where the result is a type with C bits. The unsigned compare on the
select treats negative values as large positive values so any value
that isn't in the range [0, (1 << C) - 1] will use the True operand
of the select. The sext(X >s -1) creates all ones for positive values
of X and 0 for negative values of X.
This pattern appears in the picojpeg workload of embench-iot with
an i8 result type.
Assisted-by: Claude Sonnet 4.5
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
Readds a few test cases from da98651
Fixes #8740
Fixes #61818
Fixes #190388
[Analysis][NFC] Remove BPI::getEdgeProbability(iterator) (#191286)
Now that successor iterators are Use iterators, it is no longer cheap to
get the successor index. Replace uses with the variant that takes the
successor index, which in all cases is easily available.
This is primarily cleanup after the somewhat recent successor changes.
There's also a minor (barely measurable) performance improvement here.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
Readds a few test cases from da98651
Fixes #8740
Fixes #61818
Fixes #190388
[ADT] Refactor post order traversal (#191047)
Currently, po_iterator holds the traversal state. This makes copying
and moving po_iterator fairly expensive and the code cannot be optimized
away in several cases (most of it isn't even inlined in a default
build).
Therefore, refactor post-order traversal to hold the state in a wrapper
class with cheap iterators. Additionally, replace po_storage base class
with a CRTP implementation where users can provide their own storage.
Benefits:
- Performance in stage2-O3 improves by 0.19% instructions:u and even
more substantially in cycles/wall-time.
- Users that use a custom storage/iteration limitation can do so in a
more clean way by subclassing PostIteratorTraversalBase. See e.g.
LoopBlocksTraversal.
[15 lines not shown]