[Liveness][analyzer] Fix liveness of binary logical operators and their subexpressions (#231419)
Issue #227349 reported a clang static analyzer false negative, where a
division by zero error is not found in the following code:
```
int f(bool b) {
bool condition = (b && b || b && b);
int y = condition ? 0 : 1;
return 1 / y;
}
```
It turned out, that the expressions `b` were prematurely considered dead
and, as a result, their associated values were getting purged from the
environment. This caused the path where the denominator `y` is zero to
be lost.
This patch makes sure that the children of binary logical operators have
their liveness properly handled.
[flang][OpenMP] Ignore DECLARE_SIMD and warn about missing implementation
DECLARE_SIMD is a hint to the compiler and ignoring it is technically
speaking a conforming implementation (although obviously not desirable).
Do not abort compilation when DECLARE_SIMD is encountered, but emit
a warning that it's currently ignored.
[libc] Use a syscall wrapper for `sched_getparam` (#232689)
This PR move `sched_getparam` behind the centralized syscall wrappers,
following `libc/docs/dev/syscall_wrapper_refactor.md`.
[AMDGPU] Remove some uses of std::get. NFC. (#232655)
This is just stylistic. I find it much nicer to read `.first` (for a
pair) or structured bindings.
[lldb] Keep qSymbol test artifacts in the build directory
Use a relative source fixture path so createTarget does not resolve its output into the source tree.
Assisted-by: OpenAI Codex
[lldb] Resolve dispatch qSymbol requests by exact linkage name
Use the opt-in linkage-name lookup for dispatch_queue_offsets while preserving generic matching for other remote requests and existing address and symbol-type handling. Cover C++ basename decoys and an absent dispatch data symbol with the mock server.
Assisted-by: OpenAI Codex
[lldb] Use linkage names for primary JIT symbol lookup
Resolve original JIT symbol requests with the exact linkage-name path while retaining source-name lookup for function-call-label and alternate C++ fallbacks. Preserve module order, platform exclusions, weak-symbol handling, and trampoline filtering.
Assisted-by: OpenAI Codex
[lldb] Register the Bounds runtime fixture shared library
Supply the harness library search environment when launching, so Linux can load Unrelated before reaching main.
Assisted-by: OpenAI Codex
ARM: Don't duplicate implicit operands when expanding t2CALL_BTI (#232459)
The expansion built a new tBL, which already has the LR def and SP use
from its descriptor, and then copied all of the pseudo's operands
duplicating the LR def and SP use. Mutate the pseudo in place since
both opcodes have identical operands. This avoids failing a future
verifier check.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[clang][Driver] Use the Windows ARM64 defaults for aarch64-unknown-uefi
Match the Windows ARM64 driver defaults for aarch64-unknown-uefi, which
follows the same ABI:
* char is signed, so do not pass -fno-signed-char,
* the frame chain must stay valid even when frame pointers are omitted,
so -fomit-frame-pointer yields -mframe-pointer=reserved rather than
none, as the backend reserves the frame pointer for UEFI as well.
Assisted-by: Claude
[clang] Add aarch64-unknown-uefi target
Add the aarch64-unknown-uefi target to clang, building on the backend
support added in the preceding patches. Like x86_64-unknown-uefi it
follows the Microsoft ABI conventions, matching the Windows ARM64 target
which is the only way EFI applications for AArch64 can be built with
Clang/LLVM today:
* add UEFIAArch64TargetInfo: LLP64 types, Microsoft C++ ABI, char*
based va_list and the Win64 calling convention kind,
* use the Windows AArch64 ABI info in CodeGen for UEFI,
* accept aarch64 for *-uefi triples in the driver.
The UEFI toolchain already handles the linker invocation (lld-link with
/subsystem:efi_application), so no further driver changes are needed.
Assisted-by: Claude
[AArch64] Apply the Windows SEH and CRT codegen constraints to UEFI
aarch64-unknown-uefi uses SEH unwind information and has no C runtime
library, so the remaining Windows specific codegen decisions that follow
from this apply to it too:
* do not align loops or basic blocks, since SEH unwind info generation
needs the exact function layout before alignment padding is inserted,
* sign return addresses with the B key by default and reject A key
signing, matching the pac_sign_lr unwind code used by the unwinder,
* do not lower wide shifts to libcalls at -Oz, as those helpers are not
available.
The corresponding Windows tests gain aarch64-unknown-uefi run lines and
the LLVM release notes announce the new target, which completes the
backend side of aarch64-unknown-uefi support.
Assisted-by: Claude
[AArch64] Classify global references on UEFI like Windows COFF
Apply the Windows COFF rules for global references to
aarch64-unknown-uefi, which produces the same PE/COFF images:
* classify dllimport and non-dso-local globals with MO_DLLIMPORT /
MO_COFFSTUB, so extern_weak symbols are referenced through a stub that
can be resolved to zero by the linker,
* keep the existing SelectionDAG, FastISel and GlobalISel handling of
calls and tail calls to extern_weak functions in sync with that,
* default to the PIC relocation model, so jump tables and other
references stay position independent in relocatable PE images,
* lower ifuncs on UEFI as COFF has no support for them.
The extern weak and jump table tests gain aarch64-unknown-uefi run lines.
Assisted-by: Claude
[AArch64] Use Windows style stack probing on UEFI
Like Windows, and like x86_64-unknown-uefi already does, probe large
stack frames and dynamic allocas through the __chkstk helper on
aarch64-unknown-uefi instead of the inline stack probe loop:
* make the __chkstk STACK_PROBE libcall available for AArch64 UEFI,
* select the Windows stack probe paths in frame lowering,
LowerDYNAMIC_STACKALLOC and the SME state buffer allocation, honouring
the "no-stack-arg-probe" attribute as on Windows,
* fall back from GlobalISel to SelectionDAG for dynamic allocas, as is
done for Windows, since the IRTranslator does not implement the probing.
The existing chkstk and alloca tests gain aarch64-unknown-uefi run lines.
Assisted-by: Claude
[AArch64] Reserve x18 as the platform register on UEFI
Both the Windows ARM64 ABI, which UEFI follows, and the firmware
ecosystem (EDK2 builds AArch64 with -ffixed-x18) treat x18 as a reserved
platform register. Reserve it by default for aarch64-unknown-uefi, as is
already done for Windows, Darwin, Android, Fuchsia and OHOS.
Assisted-by: Claude
[AArch64] Use the Windows ARM64 ABI for UEFI targets
UEFI follows the Windows ARM64 procedure call standard (the UEFI
specification defines AArch64 EFI images in terms of the Microsoft
toolchain, and that is how EDK2 and clang-built firmware are linked
today), and x86_64-unknown-uefi likewise uses the Win64 ABI. Introduce
AArch64Subtarget::isTargetUEFI() and isTargetWindowsOrUEFI() and use the
latter for the core ABI decisions that currently key off
isTargetWindows():
* the Win64 calling convention for C/Fast/Swift calls, including the
Windows variadic convention which homes all argument registers and
passes floating point variadic arguments in GPRs,
* the char* based va_list (va_copy size and getVaListSizeInBits),
* the Windows callee saved register list and the matching frame record
pairing rules in AArch64FrameLowering, which have to agree so that the
SEH save_regp/save_fplr unwind codes describe consecutive registers,
* the requirement that the frame chain stays valid in every function.
[11 lines not shown]
wifi: atk9k: Revert "wifi: ath9k: reject short WMI command responses"
This reverts commit 93ce8ea70451e800601bc9444aa33043de15d67b.
Mehmet reported that the offending commit breaks his AR9271 USB adapter
which uses zero-length replies to commands that don't return a value.
Revert the whole thing to restore the functionality.
Cc: stable at vger.kernel.org # the offending commit is in 6.12.113
Reported-by: Mehmet Fide <mehmet.fide at gmail.com>
Signed-off-by: Toke Høiland-Jørgensen <toke at toke.dk>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
[AArch64] Use the Microsoft COFF MCAsmInfo for UEFI targets
UEFI follows the MSVC toolchain conventions and lld-link is used to
produce the PE/COFF images, so aarch64-unknown-uefi should use the
Microsoft COFF MCAsmInfo like the X86 backend already does for
x86_64-unknown-uefi, rather than the GNU (MinGW) flavour it currently
gets by virtue of being a non-MSVC COFF triple. This enables associative
COMDATs and COMDAT constant pool entries (which AsmPrinter already
expects for UEFI, see GetCPISymbol).
Also relax the AArch64MCInstLower assertion that only Windows COFF
targets exist.
This is the first in a series of patches adding aarch64-unknown-uefi
support to the AArch64 backend and clang.
Assisted-by: Claude
[lldb] Use linkage names for primary JIT symbol lookup
Resolve original JIT symbol requests with the exact linkage-name path while retaining source-name lookup for function-call-label and alternate C++ fallbacks. Preserve module order, platform exclusions, weak-symbol handling, and trampoline filtering.
Assisted-by: OpenAI Codex
health: use logarithmic mbuf reporting, separate formatting responsibilities
Let the y-axis use compact metric formatting such as 10K or 1M.
Since a tooltip should be able to contain more detailed information, allow
separation through a tooltip_formats structure.