[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]
[SelectionDAG] Replace `isKnownNeverZeroFloat` with `isKnownNeverLogicalZero` using `KnownFPClass` (#190621)
In so doing, this also corrects miscompiles caused by
`isKnownNeverZeroFloat` mishandling denormals in DAZ floats.
SymbolizableOjbectFile: Convert Wasm file offset to section offset for DWARF (#191068)
Wasm's object and linking format lacks virtual addresses like ELF et al.
As a result, linked files generally use file offsets as "addresses",
whereas
objects and DWARF sections use code section offsets.
This has led to incorrect interpretation of addresses in llvm-objdump
and llvm-symbolizer for linked files.
This change to SerializableObjectFile checks the input ModuleOffset, and
if it falls within a wasm code section, adjusts it to a section offset
before querying the DwarfContext. (For object files, Sec.getAddress() is
0 so it works for object files too). It extends the existing DWARF test
for llvm-symbolizer to include a linked file, and also adds an
equivalent for objdump.
Fixes #129523
[SystemZ][GOFF] Reference to external variable needs PR symbol
Variables are modelled as parts in the GOFF format. Referencing a
variable defined in a different compilation unit requires to use
a PR symbol instead of EXTRN/WEXTRN instruction.
A small issue is that these PR symbols can refer to the same ED
symbols, for which a section needs to be created.