[libc][AArch64] Support LFI in setjmp and longjmp (#238092)
Skip saving and restoring LFI-reserved registers (x25, x27, and x28) in
AArch64 setjmp and longjmp when building for LFI (`__LFI__`).
[MachineLICM] Track peak register pressure when hoisting
The pressure check in MachineLICM only looks at the estimates saved in
BackTrace. These record pressure at block boundaries, so they can miss an
earlier peak in the current BB or an ancestor BB. If pressure falls before the
candidate, the check can allow it to move even though its def then needs to stay
live across that earlier peak. This can push pressure beyond the limit and cause
spills.
This PR adds PeakPressure alongside RegPressure and saves the previous peak with
the existing boundary estimate in BackTrace. The pressure check considers the
current BB's peak and both saved estimates. Normal hoists adjust the current and
saved peaks, and scope exit restores the previous peak. Preheader scanning skips
peak updates and seeds the starting pressure from its final estimate.
Fixes LCOMPILER-3233.
This PR was assisted by AI but I reviewed all the changes.
[CodeGen] Honor -stress-regalloc in register pressure limits
computePSetLimit falls back to the target pressure limit when the reserved
register weight is at least that limit. This avoids underflow, but loses
allocation restrictions such as -stress-regalloc.
Bound this fallback by the remaining allocatable register weight. The
allocatable count already includes the stress limit. Keep the existing
subtraction when it leaves a positive limit and the zero-allocation
fallback.
Add an AMDGPU MIR test for stress limits that block or allow hoisting.
Add an X86 MIR test to check that a stress value which clips no allocation
order preserves the normal pressure adjustment and hoisting result.
Update the affected AMDGPU stress test.
Validation: all 51 stress-regalloc tests pass with MachineLICM unchanged.
With the stacked MachineLICM change, the full LLVM suite has 80,791 passes
and no unexpected failures.
[2 lines not shown]
[lldb] Let ProcessWasm order the call frame addresses of Wasm frames
UnwindWasm now counts frames up from the outermost one, in the invalid Wasm
address space, which has no memory, and ProcessWasm::CompareCFAs orders them, so
a synthetic address can neither decrease below zero nor fall inside linear
memory.
[lldb] Let the process compare call frame addresses
StackID::IsYoungerThan asks Process::CompareCFAs before it assumes a stack that
grows down; the default has no opinion.
[lldb][NFC] Pass the process to StackID::IsYoungerThan (#243487)
A following change lets the process decide how call frame addresses
order
frames.
Stack:
- #243487
- #243488
- #243535
NAS-145276 / 27.0.0 / Reject "/" in nvmet NQNs and guard configfs entry names (by bmeagherix) (by bugclerk) (#20241)
NQNs are used as directory names below /sys/kernel/config/nvmet, but
validation only checked the part before the first colon, so a hostnqn or
subnqn (or a subsystem name used to generate one) containing "/.." could
create entries outside of it.
Reject "/" and control characters in NQNs, validate subnqns generated
from the subsystem name, and check that each name is a single entry
before the kernel render uses it in a path.
Original PR: https://github.com/truenas/middleware/pull/20230
Original PR: https://github.com/truenas/middleware/pull/20237
Co-authored-by: bmeagherix <118192357+bmeagherix at users.noreply.github.com>
[LoongArch] Match BSTRINS when an OR operand is already a BSTRPICK
performANDCombine rewrites (and X, mask) into BSTRPICK, or into
(shl (BSTRPICK X, msb, lsb), lsb) for a shifted mask. When the OR is
combined after its operands, the AND operands are already rewritten.
This happens when the OR is created late, e.g. when a funnel shift is
expanded, and for any OR when the DAG combiner visits operands before
their users, as with -combiner-topological-sorting (#83422). All 8
BSTRINS patterns in performORCombine require ISD::AND, so none matches
and the OR is selected as separate bstrpick, shift and or instructions.
Add matchAndWithMask(), which matches (and X, mask) and the two BSTRPICK
forms performANDCombine produces from it, and use it in every pattern.
Both forms compute exactly the AND, so the existing checks stay valid.
In the default order this shortens the funnel shift tests. In a sample
of real-world bitcode compiled for loongarch64, 7 functions get shorter
and none longer, e.g. a byte inserted into the top of an i64 and vXi1
mask bitcasts with LSX.
[2 lines not shown]
[clang][deps] Fast path before the line-by-line walk (#239449)
`isPreprocessedModuleFile()` scans the whole source line by line,
looking for `__preprocessed_module` or `__preprocessed_import`
directives. This scan is pretty expensive.
Add a fast path by checking for the presence of the `__preprocessed_`
string. On `swiftlang/llvm-project`, a cache hit through `clang-cache`
with its default inline dependency scan drops
- from 201.4 to 189.8 ms (-5.7%) on Windows
- from 107.7 to 100.3 ms (-6.9%) on Linux
[bazel][SPIR-V] Pass -gisel-extended-llt for SPIRV GlobalISel tablegen (#243554)
Fixes d2a93dd549d0 (#240752).
Port the -gisel-extended-llt flag that #240752 added in CMake for
SPIRVGenGlobalISel.inc and SPIRVGenPreLegalizeGICombiner.inc.
Assisted-by: Gemini
NAS-145256 / 28.0.0-BETA.1 / Sync SMB pools before STCNITH so durable handles survive (#20228)
On failover, the other controller drops SMB durable handles that have
unflushed writes. Copies in progress then fail (Windows error
0x8007003B).
With SMB stateful failover on, become_passive now does this first:
- Block SMB and VIP traffic both ways.
- Run `zpool sync` on the pools that have SMB shares.
- Run `truenas_smbhad mark-synced` so the other controller keeps the
handles.
Each step has a timeout. If one fails, the rest are skipped and the
handles are dropped as before.
`failover.firewall.drop_all` gets a `replies` option for the first step.
Without it, the rules are as before.
[3 lines not shown]