[AMDGPU] Implement CFI for CSR spills
Introduce new SPILL pseudos to allow CFI to be generated for only CSR
spills, and to make ISA-instruction-level accurate information.
Other targets either generate slightly incorrect information or rely on
conventions for how spills are placed within the entry block. The
approach in this change produces larger unwind tables, with the
increased size being spent on additional DW_CFA_advance_location
instructions needed to describe the unwinding accurately.
Change-Id: I9b09646abd2ac4e56eddf5e9aeca1a5bebbd43dd
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[AMDGPU] Implement -amdgpu-spill-cfi-saved-regs
These spills need special CFI anyway, so implementing them directly
where CFI is emitted avoids the need to invent a mechanism to track them
from ISel.
Change-Id: If4f34abb3a8e0e46b859a7c74ade21eff58c4047
Co-authored-by: Scott Linder scott.linder at amd.com
Co-authored-by: Venkata Ramanaiah Nalamothu VenkataRamanaiah.Nalamothu at amd.com
[AMDGPU] Implement CFI for non-kernel functions
This does not implement CSR spills other than those AMDGPU handles
during PEI. The remaining spills are handled in a subsequent patch.
Change-Id: I5e3a9a62cf9189245011a82a129790d813d49373
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[MC][Dwarf] Add custom CFI pseudo-ops for use in AMDGPU
While these can be represented with .cfi_escape, using these pseudo-cfi
instructions makes .s/.mir files more readable, and it is necessary to
support updating registers in CFI instructions (something that the
AMDGPU backend requires).
Change-Id: I763d0cabe5990394670281d4afb5a170981e55d0
[AMDGPU] Emit entry function Dwarf CFI
Entry functions represent the end of unwinding, as they are the
outer-most frame. This implies they can only have a meaningful
definition for the CFA, which AMDGPU defines using a memory location
description with a literal private address space address. The return
address is set to undefined as a sentinel value to signal the end of
unwinding.
Change-Id: I21580f6a24f4869ba32939c9c6332506032cc654
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[Clang] Default to async unwind tables for amdgcn
To avoid codegen changes when enabling debug-info (see
https://bugs.llvm.org/show_bug.cgi?id=37240) we want to
enable unwind tables by default.
There is some pessimization in post-prologepilog scheduling, and a
general solution to the problem of CFI_INSTRUCTION-as-scheduling-barrier
should be explored.
Change-Id: I83625875966928c7c4411cd7b95174dc58bda25a
[MIR] Error on signed integer in getUnsigned
Previously we effectively took the absolute value of the APSInt, instead
diagnose the unexpected negative value.
Change-Id: I4efe961e7b29fdf1d5f97df12f8139aac12c9219
[MC][Dwarf] Add custom CFI pseudo-ops for use in AMDGPU (#183151)
While these can be represented with .cfi_escape, using these pseudo-cfi
instructions makes .s/.mir files more readable, and it is necessary to
support updating registers in CFI instructions (something that the
AMDGPU backend requires).
Change-Id: I763d0cabe5990394670281d4afb5a170981e55d0
CI: Allow testing with a newer GCC on ARM builder
Add a text box to specify a custom GCC version (like '16') when
running the zfs-arm builder. This allows you to test with a newer
GCC than the Ubuntu default.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18540
zstream: init/fini refcount tracking
When compiled with ZFS_DEBUG and reference_tracking_enable is enabled,
ABD alloc/free will have real refcount tracking, which will crash if the
reference cache hasn't been initialised. Adding it to the init & fini
lists is the quickest way to get that going again.
Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18535
zstream: dump backtrace on crash
Same method as zdb and ztest. zstream doesn't get touched much, and
plays a bit fast-and-loose with some core code. Its not hard for a
change to make it crash; this makes debugging easier when it does.
Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18535
[LSV] Add SCEV unsigned range safety check for zero-extend (#197599)
Add a fourth safety check in the `getConstantOffsetComplexAddrs`, that
uses SCEV's unsigned range to prove that the addition doesn't cause
unsigned overflow. This is needed for the case, where the KnownBits
analysis can't prove the safety, but SCEV has tighter range information.
The new check allows to vectorize more cases, where the offset is
zero-extended from a smaller type.
Assisted-by: Claude Opus 4.6 <noreply at anthropic.com>
[clang][NFC] Disentangle `MacroState` from `Preprocessor`
`Preprocessor` contains a map of `IdentifierInfo` to `MacroState`; this is reasonable -- the macro state is part of the overall preprocessor state. `MacroState` depends on `Preprocessor`; this is less reasonable and means that to understand `MacroState` you must first understand `Preprocessor`, but to understand `Preprocessor` you must first understand `MacroState`.
Move `MacroState` to its own file. This pulls along `FullModuleMacroInfo` since a `MacroState` is either a `MacroDirective` or a `FullModuleMacroInfo`.
Replace all `Preprocessor` parameters with only the components of `Preprocessor` that we actually need. This gives us a simpler layering where `Preprocessor` code knows about `MacroState` but `MacroState` code does not know about `Preprocessor`.
`updateModuleMacroInfo` used to be a private member function of `Preprocessor`, but its purpose is to manage `MacroState`. Instead have `MacroState` use it as an implementation detail function.
Add a new type, `PPReferences`, to bundle up references to state that `MacroState` needs as read-only other than the `IdentifierInfo` (since that's conceptually a different kind of thing).
This change also required changing `MacroInfo::isIdenticalTo` to accept the useful components of `Preprocessor` rather than the whole `Preprocessor`.
[flang-rt][test] Skip Driver/safe-trampoline-gnustack.f90 on Solaris (#197963)
The `flang-rt :: Driver/safe-trampoline-gnustack.f90` test `FAIL`s on
Solaris. It checks for a `GNU_STACK` section, however that isn't used
and not emitted on Solaris, so this patch just skips the test.
Tested on `x86_64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
[flang] Enforce F2018 C1221: ADVANCE and REC specifiers are mutually exclusive (#195170)
## Summary
Add a semantic check and test for Fortran 2018 constraint C1221, which
prohibits the `REC` specifier from appearing in a READ or WRITE
statement that also specifies `ADVANCE`.
Added a semantic test to verify error report.
_Assisted by: Claude Sonnet 4.6_
[lldb] Use os_unfair_lock for the string pool on Darwin (#197851)
The ConstString pool guards each shard with a SmartRWMutex<false>, which
on Darwin maps to pthread_rwlock and incurs heavy syscall overhead under
contention. os_unfair_lock is a userspace fast path that's significantly
faster for the write path and roughly on par for reads, but it's
exclusive-only and not available off Apple platforms.
On a 32-thread machine, hyperfine reports the benchmark unit test binary
running 4.07x faster (365.6 ms +/- 3.9 ms -> 89.8 ms +/- 5.1 ms), with
system time dropping from 4.35 s to 0.39 s as the kernel pthread_rwlock
path is replaced by the userspace fast path.
[lldb] Assert that CommandObject::DoExecute sets a return status (#197796)
Change the default value of CommandReturnObject::m_status from
eReturnStatusStarted to eReturnStatusInvalid, and add a debug-only RAII
check in CommandObjectParsed::Execute and CommandObjectRaw::Execute that
asserts the status is no longer Invalid after DoExecute returns.
This catches commands that forget to call SetStatus on a success or
failure path. Succeeded() still returns true when the status is Invalid
(0 sorts below eReturnStatusSuccessContinuingResult), so helpers that
read result.Succeeded() as a precondition before any explicit SetStatus
(e.g. StopProcessIfNecessary) continue to work.
This is a re-land of #196589.
rdar://176506732
CI: Remove deprecated Fedora 42
Fedora 42 was deprecated on May 13 2026. Remove it from CI tests.
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #18545
nss: the previous commit was an unintended update to 3.124
Changes:
Bug 2032562 - Add test for PKCS7 digest array alignment.
Bug 2030093 - Add test for rejection of excessively large ASN.1 SEQUENCE OF in quickder.
Bug 2030994 - Add test for CMS content size validation.
Bug 2030995 - Add regression tests for DSAU signature decoding.
Bug 2031030 - Add test for S/MIME profile lookup on temp certs.
Bug 2031343 - Test case for post-handshake auth and many certificate requests.
Bug 2019233 - Add test for intra-arena ASan redzones.
Bug 2033058 - update nss_status flags one at a time.
Bug 2029803 - add defensive info->len check in PK11_HPKE_SetupS and PK11_HPKE_SetupR.
Bug 2029403 - avoid PORT_Strdup in ssl_DecodeResumptionToken.
Bug 2020596 - add runtime check on decoded resumption token session id.
Bug 2035882 - improve mach try error handling.
Bug 2030798 - clang format.
Bug 2030798 - add comprehensive SECItem and SECItemArray tests.
Bug 2033058 - add bugzilla_cf_status_nss.py script.
Bug 2033057 - regenerate some recent release notes.
[22 lines not shown]
*: switch to glib2-introspection
The gobject-introspection package installed _some_ of the introspection
files needed for glib2, but not all - some of them are built from the glib2
sources. glib2-introspection now contains all glib2-related introspection
files.
Add a tool dependency on the new package where needed.
Remove gobject-introspection from buildlink3.mk files - this is usually
a tool and should not be forwarded via buildlink3.
Some cleanups/fixes for -current while here.
[CIR] Honor explicit-object parameter in CXX method arrangement
CIRGen's CXX method-arrangement and prolog paths use `md->isInstance()` to decide whether to prepend a CXXABI-supplied `this` to the parameter list. `isInstance()` is positive for *any* non-static member, including C++23 explicit-object member functions (P0847R7, `void f(this Self&&)`), where the explicit object parameter takes the place of the implicit `this` at the AST level and appears as the first parameter of the `FunctionProtoType`.
For these methods the existing path produces a `CIRGenFunctionInfo` with one more argument than `convertType(fd->getType())` gives the matching `cir.func` type, so `setCIRFunctionAttributes` runs `setArgAttrs` off the end of the cir.func arg list and crashes with `"invalid argument number"`. The same off-by-one shows up on the prolog side, where `buildFunctionArgList` prepends a `this` `ParmVarDecl` that doesn't actually exist and `emitInstanceFunctionProlog` sets up `CXXThisValue` from a cir.func argument that is really the explicit-object parameter. The crash hits 29 tests in the libcxx `std/utilities/format/**` and `std/containers/**/format/**` subtrees on the current four-fix integration baseline, plus `std/utilities/function.objects/func.bind.partial/bind_front.nttp.pass.cpp`.
Switch three sites in `CIRGenCall.cpp` and `CIRGenFunction.cpp` to the positive predicate `isImplicitObjectMemberFunction()`, matching how classic CodeGen distinguishes the two cases in `CGCall.cpp`. Explicit-object members now flow through `arrangeFreeFunctionType`, are entered into `localDeclMap` as regular parameters, and lower to the same LLVM IR that classic CodeGen produces for the same source.
New `cxx23-explicit-object-member.cpp` test (CIR + a shared `LLVM` prefix that covers both the CIR-to-LLVM and OGCG runs) covers `operator()(this Self const& self, int)` with and without `self`-side member access, a `[](this auto const&, int){...}` lambda invocation, and a control implicit-`this` instance method whose CIR signature still begins with `!cir.ptr<!rec_*>`.