[CIR][SYCL] Emit attributes on the SYCL kernel caller (#224667)
Emit norecurse, mustprogress, and sycl-module-id.
This matches the classic behavior that is specific to the SYCL kernel
caller.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
[lldb/test] Register the addressable_bits_scripted_process module with the script interpreter (#224803)
`test_scripted_process_addressable_bits` imported
`addressable_bits_scripted_process` into the test process, which makes
the module's constants available to the test but tells lldb's own script
interpreter nothing about it, so
`SBLaunchInfo::SetScriptedProcessClassName()` had nothing to resolve:
```
error: failed to create ScriptedProcess: failed to create script object:
Could not find script class:
addressable_bits_scripted_process.AddressableBitsScriptedProcess
```
Import the file with `command script import` the way the other scripted
process tests in this file do.
[WebKit Checkers][NFC] Extract hasGuardian from isPtrOriginSafe in RawPtrRefLocalVarsChecker (#224726)
So an upcoming borrow checker can skip it.
(A guardian variable is an independent declaration that ensures a
lifetime. Borrow checking does not accept guardian variables because
they do not convey `lifetimebound` links.)
Assisted-by: Claude
[lldb] Bound DataExtractor::PeekCStr to the data it reads from (#224452)
PeekCStr only validated the first byte without checking for a terminator.
Every caller then treated the result as a C string, so an unterminated
string table let strlen run past the mapping, causing a crash or
security bug.
Return an optional StringRef, produced only when the terminator lies
within the data. The length comes along with it, so callers no longer
rescan, and an absent string stays distinct from an empty one.
ValueObject was the only caller that wanted an unterminated buffer. It
scans fixed size chunks of inferior memory, so it now asks for bytes with
PeekData and bounds its own scan.
rdar://186891223
[lldb][FreeBSDKernel] Support cross-architecture FreeBSD kernel cores (#223593)
FreeBSD's kvm_open(3) man page states that a valid resolver is required
to debug non-native kernel images as libkvm needs to map symbol names to
kernel virtual addresses. Since ProcessFreeBSDKernelCore aims to debug
kernel image and core dump from any architectures, pass a valid resolver
to kvm_open2().
Assisted-by: GPT
[lldb][FreeBSDKernel] Avoid null dereference probing FreeBSD kernels (#223590)
CheckForKernelImageAtAddress() accepts an optional read_error pointer,
but dereferenced it unconditionally in many code paths. If read_error is
null, point read_error to a dummy local variable to prevent null
dereference.
Fixes: b3cc4804d45d6b612ac9b3cc47ebbb0da44ebc60
[lldb][FreeBSDKernel] Load unrelocated FreeBSD kernel sections (#223589)
Even though displacement is zero, we need to mark the module as loaded.
Fixes: 62d06083ef186abe610de4742c62c84c2f97fcd0
[clang][bytecode] Flip a boolean flag meaning (#224649)
We only use this flag once, when passing it to
`setFoldFailureDiagnostic()` (where we invert it), so it doesn't make
sense to call it IsCCEDiag.
[Support] Only enable use of /proc/self/fd on Linux (#222497)
Only enable the use of /proc/self/fd on OSes that provide
the compatible /proc/self/fd interface.
[LFI][AArch64] Do not flush deferred LR guards on temporary labels (#224776)
In function epilogues with unwinding enabled, DWARF CFI directives
between restoring x30 and autiasp trigger
MCObjectStreamer::emitCFILabel, which emits temporary labels. onLabel
assumed all labels were branch targets and flushed DeferredLRGuard,
emitting `add x30, x27, w30, uxtw` before autiasp. Because w30
zero-extends, this stripped the PAC signature from x30 and caused PAC
exceptions on hardware with FEAT_FPAC.
Fix it by not flushing the deferred LR guard on temporary symbols in
onLabel. Also, update AArch64InstrInfo::getLFIInstSizeInBytes to return
8 for RET to fix the size assertion failure in +assertions builds, which
occurs because RET did not account for the deferred LR guard that can
precede the return instruction.
Assisted-by: Gemini
[ORC] Drive SharedMemoryMapper via proxies (#224786)
Add a SharedMemoryMapBindings handle (SharedMemoryMap.h) and its SPS
proxy specs (SharedMemoryMapSPS.h), mirroring SimpleMemoryMap, and bind
SharedMemoryMapper to it in place of its four callSPSWrapperAsync sites.
Dispatch and callee errors now share one channel, dropping the per-call
SerializationErr handling. Updates the llvm-jitlink and clang-repl
factories and the unit test.
[AMDGPU] Narrow provably-I32 address offsets
Add a `tryNarrowToI32()` function that uses KnowsBits to detect 64-bit
offests that could be in a 32-bit register, allowing us to match
base + offset cases that don't involve literal base + (ext offset)
nodes.
Apply this to global_* instructions and the scalar memory instructions
that take a scalar offset.
This does leave a few dead copies when we have to bail out of the SMEM
handling for creatining a negative offset, but those don't have
end-to-end effect and it looks like you could already get dead MOVs
from that codepath.
AI disclosure: Claude wrote the code, I looked at it.
[AMDGPU] Pre-commit tests for narrowing offsets in address matching
When trying to match either SADDR+VADDR global_* or the s_load_* that
takes a 32-bit offset, we don't check for cases where a 64-bit value
is trivially truncatable to 32 bits. Add tests for these cases.
AI disclosure: Claude wrote these tests
[llvm][timing] Reset recycled timer with different names. (#218492)
Legacy pass-manager timers are keyed by the pass instance pointer and
the map entry outlives the pass, so a pass allocated at a recycled
address inherits the previous pass's timer and reports its time under
that pass's name. When a recycled instance which has different name can
end up having leftover name comes from whichever target ran before.
Re-create the timer when the name no longer matches.
fixes: #218491
[Option] Emit the Info table from TableGen. NFC (#224508)
Each tool expands OPTION into an Info array and passes it with up to
five side tables to GenericOptTable or PrecomputedOptTable, so a new
side table touches every tool.
Emit the Info table from TableGen with numeric group and alias IDs and
bundle all tables into an OptTable::Tables aggregate under one
OPTTABLE_CODE block, so a tool just constructs OptTable(OptionTables).
Every table now uses the precomputed prefix union, which removes
GenericOptTable and PrecomputedOptTable.
Aided by Opus 5
[LowerTypeTests] Apply kill switch to CFI jump table reordering (#224782)
This is follow up to #221046, for which I failed to upload rebased
version.
* https://github.com/llvm/llvm-project/pull/221046
[LowerTypeTests] Reorder CFI jump table entries based on hotness (#221046)
Order CFI jump table entries by function hotness. We use `cfi.functions`
metadata in ThinLTO, or `BlockFrequencyInfo` / function entry counts in
full LTO.
We want the hottest function to be optimized by the last entry thing for
SHT_LLVM_CFI_JUMP_TABLE. The linker deletes the final branch in the jump
table and moves the table directly before that target function so it
falls through.
This also ensures the jump table lands in a hot section (.text.hot)
instead of a cold section (.text.unlikely). Type contiguity is
preserved.
This PR reliably improves the performance of our server binary by 0.2%,
and some smaller binaries up to 5%.
PR Stack:
[8 lines not shown]
[Clang][NFC] Move GH211943 test into existing builtin-dump-struct test file (#224421)
Follow-up to #212377 per post-commit review by @shafik.
Moves the regression test from a standalone GH211943.cpp into the
existing CodeGenCXX/builtin-dump-struct.cpp under a namespace GH211943
block, guarded by #ifdef TEST_WERROR with a second RUN line.
[NFC][LowerTypeTests] Add RUN line for -reorder-cfi-jump-tables-profiles=false (#224779)
Update CHECK lines to match the new jump table layout in
* https://github.com/llvm/llvm-project/pull/224779
Assisted-by: Gemini