[DebugInfo] Print the record in the salvage debug line (#215903)
The line takes the record pointer, so -debug prints an address rather
than the record.
Changes -debug output only.
[flang][OpenACC] Handle declare actions on CUF allocation ops (#214568)
Recover the typed descriptor from cuf.allocate and cuf.deallocate when
inserting calls to OpenACC declare-action recipes. Add conversion and
lowering coverage for pinned allocations.
[ProfileData] Remove OnDiskMode from SecFuncOffsetTable (#215876)
This patch removes code related to OnDiskMode on both the reader and
writer sides.
Originally, I was going to use OnDiskChainedHashTable in
SecFuncOffsetTable, but I have decided to go with Eytzinger-based
tables. Note that we have never deployed OnDiskChainedHashTable-based
SecFuncOffsetTable.
RFC:
https://discourse.llvm.org/t/rfc-faster-sample-profile-loading/90957/8
Assisted-by: Antigravity
RuntimeLibcalls: Stop improperly reporting fp128 long double calls on ARM
32-bit ARM's long double is IEEE double, so l suffixed calls do not have fp128
type. Additionally, the f128 typed / suffixed functions are not built in glibc as
__HAVE_FLOAT128 is defined to 0 in the arch config. Remove the testcases
which emitted nonexistent or wrongly typed calls and replace with error
tests.
Related: #44744
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
RuntimeLibcalls: Fix reporting incorrectly typed fp128 long double functions
l-suffixed long double math functions are fp128 only when the target's
long double is fp128. The default set provided them on every target that was
not x87 or ppc_fp128, so targets using double as long double wrongly reported
the fp128 l-suffixed functions.
Update tests that were reliant on phantom fp128 calls. These are only available
with glibc on select targets. In cases where the target supports the calls in
some triple, split the tests. In cases where the target has no fp128 library
support, delete the tests.
Related: #44744
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DAG: Gracefully diagnose missing FP conversion libcalls when softening
Diagnose the missing libcall and return poison instead.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[HLSL][DirectX] Implement lowering of texture stores (#212364)
Fixes https://github.com/llvm/llvm-project/issues/194930
This PR implements the DirectX lowering of texture stores via the
subscript operator (`.operator[]`).
Also adds missing frontend tests exercising stores to textures via the
subscript operator.
Also fixes an issue with `lowerTextureLoad` incorrectly supplying a mip
level to texture loads on UAV textures (except multisampled UAV
textures) which caused validation errors.
An UndefValue is used in the lowering because DXIL is based on an older
version of LLVM that requires the use of undef.
Assisted by: Claude Opus 5
[DWARFLinker] Consider module units when creating the type unit (#215731)
The parallel linker creates the artificial type unit only when some
compile unit uses an ODR language, but it looks for that language in the
compile units of the object files alone. A clang module unit decides its
own ODR availability from its own DW_AT_language, so a module built as
C++ or ObjC++ imported from an object file whose units are all C, ObjC
or Swift places DIEs in the type table which does not exist, asserting
in CompileUnit::cloneDIE and dereferencing null without assertions.
Scan the languages of the module units as well, so a module which
deduplicates types always has a type unit to hold them.
rdar://182719465
[lldb] Search for a corefile's images before loading any of them
A userland or kernel corefile can list hundreds of images, and searching for
one can shell out to a symbol server or fetch over the network. Searching for
them one at a time is where loading such a corefile spends its time.
Add a batch form of SymbolLocator::Locate that runs the searches on the
debugger's thread pool, gated on target.parallel-module-load. Results come
back in the order the requests were given, since that order decides the
Target's module order. Only the results are ordered, and anything a search
reports to the user arrives in whatever order the searches finish in.
Only the plugin searches run concurrently, so a platform hook does not have to
be thread safe to take part, and reading a binary's UUID out of memory stays
on the calling thread.
Setting up a platform binary can replace the Target's platform and dynamic
loader, and now happens for every image before any of them is searched for, so
the platform a corefile asks for is the one all of its images are searched
[4 lines not shown]
[lldb] Consult the platform before the symbol locator plugins (NFC)
A symbol locator plugin has no Platform to consult, so a platform that knows
where its binaries live cannot take part in a search. The only way to reach
one is Platform::GetSharedModule, which also creates the module and registers
it, so the lookup cannot be reused by a caller that wants to search for many
binaries before creating any.
Add a hook that only answers where the files are. An answer ends the search,
so an override owns what the plugins would otherwise have been asked for.
No platform overrides it yet. A follow-up moves PlatformDarwinKernel's kext
and kernel index lookups behind it.
Assisted-by: Claude
[MSP430] Add AsmPrinter names
So that -stop-before=msp430-asm-printer works, which is used in some
DebugInfo tests.
Reviewers: aeubanks, asl
Pull Request: https://github.com/llvm/llvm-project/pull/215909
[lldb] Add a unified entry point for locating a binary and its symbols
The three-plugin composition that finds a binary and its symbol file is open
coded in several places. Give it one home, as a pure function of a module
spec, so that a caller holding several binaries can search for all of them
before creating any.
Nothing on this path takes a lock, where ModuleList::GetSharedModule holds the
shared module list's lock across the plugin search. That is what will make
searching for several binaries at once worth doing.
A miss that nothing could explain gets its own error type rather than an error
code, because a Status carrying an errno converts to the same llvm::ECError,
and a caller composing its own message for a plain miss must not swallow a
failure to reach a symbol server.
DynamicLoader's search no longer runs twice for a binary that is not already
known, and a module created from a located binary is now registered in the
shared module list, so a second Target asking for the same binary reuses it.
[2 lines not shown]
[NewPM] Unconditionally add AsmPrinter
Otherwise -stop-before=<target>-asm-printer does not work. We should
never be running it if we print MIR, so adding it unconditionally
doesn't change any behavior.
Reviewers: paperchalice, arsenm, aeubanks
Pull Request: https://github.com/llvm/llvm-project/pull/215908
[CIR] Search the feature list once and assert on multiversioning
Review feedback on #215118.
funcAvxLevel walked the whole feature list once per name and was called
twice, so it now makes a single pass.
It also has no equivalent of the `hasAttr<TargetAttr>()` gate classic
uses. A multiversioned function's feature list carries the same `+avx`
entry a plain `target` attribute produces, so this would take a raised
level where classic keeps the module's. CIRGen rejects multiversioning
today, so an assert on opFuncMultiVersioning marks the gate that has to
go in when that changes.
Comments naming a function or file in classic CodeGen came out. They go
stale when that code moves, and one already had, claiming a declaration
carries no features. x86TargetAttrAvx is now allowsX86TargetAttrAvx,
after the function that produces it.
Assisted-by: Cursor / claude-opus-5
HashingTest.cpp: Prune `StructWithHashBuilderAndHashValueSupport::hash_value()` [-Wunused-template] (#215561)
The customized version of `hash_value()` won't use it.
[LLVMOffload] Fix LLVMOffloadKernel dylib dependency (#215902)
LLVMOffloadKernel was linking Offload through LINK_COMPONENTS, which
does not preserve the required LLVMOffload target dependency in dylib
builds. Match the other `offload/` libraries by selecting LLVM deps via
`LLVM_LINK_LLVM_DYLIB`, then link LLVMOffload explicitly.
[clang][SYCL] Enable GPURelocatableDeviceCode and predefine __CLANG_RDC__ (#215437)
SYCL device compilation defaults to RDC. The driver now passes -fgpu-rdc
to the SYCL device -cc1 invocation by default (disabled with
-fno-gpu-rdc), setting the GPURelocatableDeviceCode LangOpt.
Expose RDC to source code for SYCL through the `__CLANG_RDC__`
predefined macro, similar to CUDA and HIP.
---------
Co-authored-by: Claude <noreply at anthropic.com>
Co-authored-by: Nick Sarnie <nick.sarnie at intel.com>
[CIR] Test the atomic wrapper's rejection at the pass level
CIRGen wraps an atomic narrower than its lock-free size in an anonymous padded
record whose trailing member is pad. The x86_64 classifier rejects padded
records. That rejection is pass behavior, so it belongs with the other cases
in x86_64-aggregate-nyi.cir rather than in a driver test of its own.
It also covers the anonymous record path, which every case in that file had
missed.
Assisted-by: Cursor / claude-opus-5