[Allocator] Cap MinAlign at alignof(max_align_t) (#235373)
alignof(std::max_align_t) is 4 on NetBSD/i386, whose <stddef.h> defines
max_align_t as a union of void *, long double, and long long.
Fix #230782
[BPF] Disambiguate CO-RE relocation globals (#234252)
The BPF backend encodes the relocation kind, local value and access path
in a global name. Type names such as `S<ns::Arg$>` can contain both
delimiters. Decode the fixed suffix from the right in instruction
folding and BTF emission. This fixes the compiler crash reported in
#233947.
Within a module, different debug types can produce the same name. A
pointer access and a 32-bit field-offset query can also have the same
name with different load types. Reuse an external relocation global only
when its debug root and load type match. Put any discriminator before
the suffix so both consumers read the original relocation.
Assisted-by: OpenAI Codex
[libunwind] Support extended amd64 segment registers (#229176)
Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
segment selectors, FS.base, and GS.base to the register model. Capture
the extended state and restore it when resuming, using sigreturn() on
FreeBSD to restore selectors and bases together. Pack the state into the
existing context buffers without changing their public sizes or the
Windows XMM offsets.
Add tests for register access, signal-frame CFI recovery, register
bounds, and resume behavior.
Assisted-by: GPT
[lldb][bazel] Add targets for the remaining unconditional plugins (#235325)
CMake builds these plugins on every host, but the Bazel overlay had no
targets for them:
- PluginABILoongArch
- PluginDynamicLoaderFreeBSDKernel
- PluginPlatformAIX
- PluginPlatformFreeBSD
- PluginPlatformNetBSD
- PluginPlatformOpenBSD
- PluginTypeSystemClike
I also added these to the DEFAULT_PLUGINS list.
For now, I'm still leaving out plugins that CMake only builds with an
optional dependency or on a specific host:
- ProcessFreeBSDKernelCore (FreeBSD hosts, libkvm)
[8 lines not shown]
[MemorySSA] Remove unused functions (NFC) (#235374)
Remove MemoryPhi::unorderedDeleteIncomingValue, upward_defs and
ClobberWalker::const_def_path, which have no callers, together with the
const_def_path_iterator alias only used by const_def_path.
[LAA] Avoid division by zero for zero-sized access types. (#235372)
Zero-sized access types lead to divide-by-zero in getStrideFromAddRec.
Bail out if that would be the case.
[libunwind] Unwind through AArch64 FreeBSD signal trampolines (#235065)
Retried from https://reviews.llvm.org/D155066.
Recognize signal trampolines using KERN_PROC_SIGTRAMP when unwind
metadata is unavailable. Restore the interrupted PC, LR, SP, general
registers, and valid floating-point registers.
Add coverage for unwinding out of an interrupted leaf function on both
regular and alternate signal stacks.
Assisted-by: GPT
[RISCV][TTI] Multiplication is high-cost without M extension (#235363)
This fixes a regression exposed in a future patch that came up when
working on LSR where suddenly we were emitting a multiplication libcall
in a test that didn't specify having the M extension because LSR thought
it was cheap.
I don't think lacking an M extension is common, but this is a pretty
small change and probably helps people compiling code to RISCV on really
small/cheap cores.
Assisted-by: LLM
[LLDB] Exclude exposed exe symbols from tests (#228645)
Same as what we have for normal lldb installation. A executable may
creates a copy of a symbol if it links to the archive. Exclude archive
symbols out from the exe itself.
[LLDB][FreeBSD] Fix file not exists detection (#235358)
A process can outlive the exact running binary inside. As a result, a
file fails to query should set unknow by default.
[AVR] Fix byte spills and stack args on AVRTiny
AVRTiny cores have no load/store with displacement, yet 8-bit spills,
reloads and stack arguments in functions without a reserved call frame
were still emitted as STDPtrQRr/LDDRdPtrQ. llc then aborted in the
AsmPrinter, so any function that spilled a byte failed to compile, also
with the default register allocator and at -O0, and builds without
assertions silently emitted std/ldd instead.
Expand both instructions on AVRTiny the same way as their 16-bit
counterparts: a plain st/ld when the displacement is zero, as it always
is for spill slots, and pointer adjustments around it otherwise.
[AVR] Address review comments on AVRTiny spills
Document that STDPtrQRr and LDDRdPtrQ are only treated as pseudo
instructions on AVRTiny, and check atmega328 instead of -O0 in
std-ldd-tiny.ll so the test contrasts the two kinds of cores.
[Passes] Make runCodeGenPipeline take raw_pwrite_stream for DwoOS (#235339)
The std::unique_ptr reference was mostly cargo-culting from clang/flang
that does not necessarily make sense for other frontends (case study
right now is rustc). Change to a raw_pwrite_stream given that makes more
sense internally and gives frontends more flexibility.
[LLDB][Minidump] Fix BSD's unsupport failure
BSD should also support Minidump naturally. For platform_id, we don't
see any difference between different BSD deriviatives. Set it to Unix
generic so that at least test works.
[LLDB][FreeBSD] Fix file not exists detection
A process can outlive the exact running binary inside. As a result, a
file fails to query should set unknow by default.
[WindowScheduler] Preserve loop-carried memory dependences (#231364)
The WindowScheduler clones the loop body into TripleMBB and advances the
base registers of memory accesses to later iterations, but the clones
keep the original iteration's memory operands. The per-window scheduler
could therefore treat a store and a load from different copies as
non-aliasing and reorder them, even though they touch the same address
in consecutive iterations, producing wrong code.
Detect loop-carried memory dependences on the original loop and enforce
them with a DAG mutation while list scheduling each window.
Fixes #209946
[Flang][test] Use x86 triple (#235354)
`REAL(10)` is only available on x86 targets. x86-registered-target
enabled in #235068 is insufficient, it also needs to be compiled to the
x86 target triple. Apply the same -triple as other tests such as
flang/test/Semantics/real10-x86-01.f90 do.
Note: Some constant foldings are only available if the flang compiler
itself runs under x86, but folding is not what is tested here.
Should fix the
[clang-aarch64-sve-vls-2stage](https://lab.llvm.org/buildbot/#/builders/4)
buildbot
[CIR][CUDA] Add host-side surface registration support (#225146)
Related: #179278.
This patch adds host-side registration support for CUDA built-in surface
references in CIR.
Previously, CIR recognized CUDA surface variables during registration,
but host-side surface handling was not implemented. This change
preserves the surface type information in CIR registration metadata and
emits the corresponding `__cudaRegisterSurface` runtime registration
call.
## Changes
- Internalize CUDA surface and texture host shadow variables to match
original CodeGen behavior
- Extend `CUDAVarRegistrationInfoAttr` with the CUDA surface type
- Extract the surface type from the CUDA surface template arguments
[11 lines not shown]
[VPlan] Drop poison-gen attributes & metadata on replicated clones. (#234613)
VPReplicateRecipe::execute clones the original instruction, carrying
over all metadata & attributes.
Clear poison-generating attributes & metadata, to make sure we only
apply the attributes & metadata carried by the recipe itself.
PR: https://github.com/llvm/llvm-project/pull/234613
[Flang] Reject unexpected REAL kinds when lowering literals
Kind 8 was the default arm of the real-literal switch, so any other kind
was parsed as an IEEE double. Handle kind 8 explicitly and abort on an
unsupported kind.