[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.
Hash the operand kind of a relation
Relational::kind() is the logical result kind, which is always 4, so
relations of different operand kinds hashed the same. Hash the operand
kind instead.
Grok finding another mistake by GPT/Claude
[Driver][SYCL] Link libclang_rt.builtins.bc for spirv64 at compile time via getDeviceLibs (#218528)
Add support for linking `libclang_rt.builtins.bc` for the `spirv64`
target at compile time by integrating it into the SYCL `getDeviceLibs`
mechanism. This ensures built-in runtime library functions are available
for SYCL device code targeting `SPIR-V` 64-bit.
Re-land of https://github.com/llvm/llvm-project/pull/212550 (Only Clang
Driver changes)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply at anthropic.com>
[libc] Modify NaN/payload functions for emulated float128 type (#221946)
Updated `nanf128`, `getpayloadf128`, `setpayloadf128`, and
`setpayloadsigf128` for emulated `float128`, including shared headers,
entrypoints, CMake/Bazel dependencies, wrappers, and tests.
closes #221574
[flang][acc] Name deviceptr objects on the exit of a local declare (#235089)
A structured `acc declare deviceptr(a)` inside a procedure lowers to an
`acc.declare_enter` whose data operands include the deviceptr op, but
the matching `acc.declare_exit` carried no operands for it. The runtime
therefore saw the region opened at the enter and never closed, and the
entry registered for `a` survived the end of the procedure. With a dummy
argument this leaks one present table entry per call.
Append the deviceptr entry ops to the `acc.declare_exit` operands in
`genDeclareInFunction`, the same way the present clause is handled. No
copyout or delete is generated for deviceptr. The runtime conversion
then emits the data end call for the exit.
The lowering test checks that the exit names the deviceptr object and
that no delete is produced.
[Flang] Restore real-only reciprocal retry in IntPower
The merged integer-power folder retried on every negative overflow and
kept the retry only when that retry did not overflow, including for
complex values. Real values again retry only when the base is nonzero
and its magnitude is greater than one, and that retry is kept. Complex
values do not retry.
Restore ConvertToType
FINDLOC compared elements with .EQV. and then read the folded result as
LOGICAL(4). The operation keeps the operand kind, so LOGICAL(1/2/8)
produced an empty optional and aborted. Compare the truth values directly.
[ARM] Replace reg in preheader when reverting WhileLoopStartLR (#229754)
As we revert a wls loop to a dls loop, we remove the t2WhileLoopStartLR
to a t2DoLoopStart at the start of the preheader. In finding the
t2WhileLoopStartLR we might have looked through a copy that is still
using the t2WhileLoopStartLR def. Make sure we replace the use with the
Src to remain valid.
Fixes #229400
[IR] Remove unused GEPOperator::countNonConstantIndices (NFC) (#235233)
The last callers of GEPOperator::countNonConstantIndices were removed
on April 26, 2024 in commit cbe1760f02882328c91e5764648f97fe644f44c9.
Assisted-by: Antigravity
[clang] Replace PointerUnion::dyn_cast with llvm::dyn_cast (NFC) (#235232)
PointerUnion::dyn_cast has been soft-deprecated in favor of
llvm::dyn_cast and llvm::dyn_cast_if_present. This patch replaces
PointerUnion::dyn_cast with llvm::dyn_cast at 17 call sites across 11
files under clang/.
All tests in check-clang pass with these changes, and LLM-based static
analysis of the surrounding data structures and call sites confirms that
the PointerUnion operand at each site is nonnull either by construction
or because callers ensure it is nonnull before reaching llvm::dyn_cast.
Assisted-by: Antigravity
Revert "[SelectionDAG] Implement SDTCisSameAs in verifyNode." (#235329)
M68k is failing on the bots. I'll need to fix it or waive the broken
node, but I need time to investigate.
Reverts #235157
[TLI][SimplifyLibCalls] Accept [2 x iN] return type for __size_returing_new (#234856)
On AArch64 (AAPCS64), Clang lowers `struct __sized_ptr_t { void *p;
size_t n; }` as `[2 x i64]` (`llvm::ArrayType`), whereas on x86_64 it is
lowered as `{ ptr, i64 }` (`llvm::StructType`).
Additionally, `emitHotColdSizeReturningNew` and
`emitHotColdSizeReturningNewAligned` in `BuildLibCalls.cpp` previously
hardcoded `StructType::get(B.getContext(), {B.getPtrTy(), SizeTTy})` as
the return type of the newly emitted `_hot_cold` call, which would fail
`replaceAllUsesWith` when replacing a call returning `[2 x i64]`.
Assisted-by: Gemini Argon