[lldb] Search for a kext once instead of three times (#229472)
Search for each kext once, through SymbolLocator, and register what it
finds with Target::GetOrCreateModule. A kext already in the shared
module list is not searched for at all. A new invoke_symbol_locators
parameter, passed on to ModuleList::GetSharedModule, keeps the Target
and the platform from searching a second and third time.
PlatformDarwinKernel now implements FindModuleFiles, so SymbolLocator
can answer from its kext index.
The kernel still asks the platform first. The index has to win over the
shared module list, and a kernel without a dSYM needs the forced
dsymForUUID call.
Since the located file is registered instead of a bundle ID, the
Target's path remappings now apply. The locate module callback also runs
for kexts found in the index and sees the binary's path.
rdar://122977780
[sanitizer_common] Intercept fortified __mem*_chk functions (#206702)
When compiled with glibc's `_FORTIFY_SOURCE` enabled, calls to `memcpy`,
`memmove`, `memset`, and `mempcpy` are lowered to their fortified
variants
(`__memcpy_chk`, `__memmove_chk`, `__memset_chk`, and `__mempcpy_chk`).
Clang's instrumentation passes do not lower these fortified calls to
`llvm.memcpy`/`llvm.memmove`/`llvm.memset` intrinsics. Without runtime
interceptors, sanitizers miss memory checks on fortified calls and MSan
fails to
propagate shadow and origin state, causing false-positive
use-of-uninitialized-value reports.
---------
Signed-off-by: Austin Schuh <austin.linux at gmail.com>
Co-authored-by: Vitaly Buka <vitalybuka at google.com>
[CIR] Handle destroying operator delete in deleting destructors (#229606)
When a class's operator delete is a destroying operator delete, the
deleting destructor must call it and must not call the complete
destructor, because the operator delete takes over destruction of the
object as well as deallocation of its storage. CIR previously reported
this case as not yet implemented.
Implementing this exposed a problem where we were guarding the complete
destructor call with `haveInsertPoint()` but that didn't really do what
it was meant to do because CIR doesn't use the absence of an insertion
point to indicate that we've branched through the return block the way
classic codegen does. Instead, I am sinking the code that emits the
complete destructor into enterDtorCleanups() and letting that function
decide when it should happen.
The deleting destructor that takes an implicit parameter is still NYI.
Assisted-by: Cursor / various models
[VPlan] Simplify (icmp ne X, false) -> X. (#229904)
Add a simplification for comparing an i1 value to false in
simplifyLogicalRecipe. Such compares can be created when narrowing to
minimal bitwidths, as in pr87407-trunc-with-intrinsic.ll, and when
creating the start value of i1 AnyOf reductions with a false start value
for the epilogue vector loop.
workflows/precommit: Use single shared job to compute projects (#224941)
This ports the existing macos-compute-projects job so it can be used on
all platforms. This will help eliminate a few minutes of runtime and
eliminate a machine reservation when there are no projects that need to
be tested.
[NewPM] Sync passes names between legacy and NewPM (#229775)
This is done so that -stop-after/before will accept the same spelling
for both legacy and NewPM. Changed names:
livedebugvalues -> live-debug-values
virtregrewriter -> virt-reg-rewriter
twoaddressinstruction -> two-address-instruction
slotindexes -> slot-indexes
postrapseudos -> post-ra-pseudos
processimpdefs -> process-imp-def
(NewPM spelling was picked every time)
[flang][mlir] Add DW_AT_type support to DIStringType MLIR attribute [2/3] (#229864)
Update the MLIR LLVM dialect's DIStringType attribute to include an
optional type field, matching the LLVM IR DIStringType change that adds
support for the DW_AT_type attribute on DW_TAG_string_type DIEs. (Issue
#95440)
[AMDGPU] Require wave ID masks to be constants
PR #177713 added some cases to the wave ID recognizer, such
as (ThreadID & Mask) >> log2(WaveSize) but, after it landed, Claude
noticed a bug. `Mask` in those types of expressions was an arbitrary
vale, which could be divergent, meaning that the "uniform" value of
that expression wouldn't actually be uniform.
The quick fix that preserves most of the cases we're worried about in
practice is to restrict these patterns to constant masks.
AI disclosure: Claude found the issue and created the patch, I wrote
this message.
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
AMDGPU: Remove no-op uses of -amdgpu-scalarize-global-loads from tests (#229897)
The flag has no effect on the output of these tests.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lldb][docs] Document testing LLDB with WebAssembly (#229242)
Describe how to run the API test suite against a Wasm runtime, using the
`wasm` platform. The new doc covers the platform settings, WAMR and
WasmKit as example runtimes, compiler choice, and the test suite
configuration.
[AMDGPU][NFC] Pre-commit tests to not match non-constant wave ID masks
Non-constant masks can cause divergences even if we're shifting the
divergent part of a thread ID, and we didn't account for that in the
pattern matches.
AI disclosure: Claude found these and wrote the tests
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
[Verifier] Strengthen type constraint (#229880)
When I asked the LLM to hack llubi, it created some inputs with an
invalid intrinsic like llvm.vscale.v2i64, bypassing the verifier. This
patch uses predicates introduced by
https://github.com/llvm/llvm-project/pull/204138 to specify
scalar-only/vector-only overload types.
Some redundant checks in Verifier.cpp are simplified. There are two
kinds of additional constraints in Verifier.cpp, as they cannot be
represented by existing predicates in tablegen:
1. matrix intrinsics now only accept fixed vectors.
2. vector.partial.reduce requires the accumulator vector and input
vector to share the same element type.
I have checked that the rejected form is either rejected by llc/opt
(e.g., instruction selection failures or direct use of
`cast<VectorType>`) or explicitly specified in LangRef.
Aided by DeepSeek-V4.1-Flash.
Add truncation detection to vmd's instruction decoder.
vmd(8) ultimately needs a way to deal with instructions that cross
page boundaries. This is a baby step to get there by fixing up the
decoder logic to detect when we're out of fetched instruction bytes
but not done decoding an instruction. Next steps will be to add in
cross-page fetching and injecting #PF if the next page is paged out
and we weren't able to decode with just the bytes from the first page.
These state machine changes uncovered some issues with 16-bit
addressing and decoding that got fixed along the way.
ok mlarkin@
AMDGPU: Use functions instead of kernels in f16 operation tests (#229899)
These tests used kernels with loads from pointer arguments to supply
operand values, relying on -amdgpu-scalarize-global-loads=false to keep
the loaded values in VGPRs. Use function arguments instead.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LLVMABI] Classify types at their ABI size (#227889)
The x86-64 classifier compared value widths against Clang type sizes, so
types with padding were misclassified. For example, `struct { long
double __attribute__((vector_size(16))) v; }` coerced to `<2 x double>`
instead of `<1 x x86_fp80>`.
getABISizeInBits() now gives every type the size Clang's getTypeSize()
gives it, and the classifier uses it wherever Clang uses getTypeSize().
This also applies to _BitInt and bool arrays and bit-fields, vectors
with a non-power-of-two element count, bool vectors, and vectors of
sub-byte _BitInt. isIllegalVectorType now sends only __int128 vectors to
memory, not _BitInt(128) ones, as Clang does. isSingleElementStruct is
shared, so AMDGPU picks up the fix too.
Assisted-by: Claude Code / Claude Opus 5.5
[CIR] Fix 'vague' linkage globals. (#228586)
Namespace scope globals with 'vague' (internal/linkonce ODR) need to be
'guarded' to prevent them from being initialized in multiple TUs, which
typically shows itself with multiple 'free' operations happening (since
it is registered to 'free' multiple times: the initial allocation just
leaks).
This patch gets that correct. Additionally, these have the idea of an
'associated variable' when added to teh Global Ctor/Dtor, so this
modifies that to make sure that is correct.
As this infrastructure reuses the
'static_local_guard'/'static_local_info', I've generalized that naming
with the help of Claude who hopefully isn't pulling a fast one on us :)
net/dnscap: Update dnscap from version 1.4.1 (from 2015) to 2.5.1
Prompted by jperkin's MacOS 27 bulk build results
10+ years of changes are too many to summarise here, but TL;DR is that
+ there are a lot more dependencies (on a lot of archivers/compression
libraries), openssl, and ldns,
+ the package name in pkgsrc is now dnscap2,
+ and dnscap now supports plugins (${PREFIX}/bin/dnscap-rssm-rssac002
is one such).
[Clang] Diagnose incompatible `weak` and `ifunc` attributes (#229393)
Clang previously accepted both `weak` and `ifunc` attributes on the same
function, but silently ignored `weak` when emitting the IFUNC. Since
`ifunc` functions must not have weak linkage, the new mutual exclusion
rule diagnoses the conflict during attribute processing and
redeclaration merging.
Using `#pragma weak` after an `ifunc` declaration adds an implicit
`weak` attribute directly, bypassing the normal mutual exclusion checks.
The pragma handler now checks attribute compatibility as well. If the
pragma follows a redeclaration, the check uses the original IFUNC
definition, because the redeclaration does not inherit the `ifunc`
attribute.
Link:
https://github.com/llvm/llvm-project/issues/220923#issuecomment-5993507925
Fixes #220923
[SimplifyLibCalls] Fix profiles in optimizeFFS (#229842)
We were creating a select with a condition that compares the input value
to the null value for that type. Mark that condition as being unlikely
as that should hold for most callsites in most applications.