[CIR] Add abstract delete operation without AST attribute (#185538)
This introduces the cir.delete_array operation, adds code to emit that
operation during CIR codegen, and adds lowering of the operation to the
CXXABILowering pass.
In order to handle possible variations in the delete representation, we
add the name of the delete function, the usual delete parameters, and,
optionally, the name of the element destructor function.
During the CXXABILoweringPass, the cir.delete_array operation is
expanded to call the delete function. This will be extended in a future
change to handle reading the array cookie, if required, and calling
element destructors.
[AMDGPU][GlobalIsel] Add register bank legalization rules for amdgcn atomic fminmax num (#184564)
This patch adds register bank legalization rules for amdgcn global/flat
atomic fmin/fmax num operations in the AMDGPU GlobalISel pipeline.
[clang][CUDA] Define _NV_RSQRT_SPECIFIER for glibc-2.42/cuda-13.2 compatibility (#185701)
CUDA-13.2 defines _NV_RSQRT_SPECIFIER to make its headers compileable
with glibc 2.42+. However, clang does not include the header that
defines the macro, and has to define it by itself.
[flang][OpenMP] Allow parsing ODS as directive-specification list item
Normally a directive specification may use commas between the directive
name and the clauses, and between the clauses. There are some instances,
however, when a directive-specification is treated as a list item.
Specifically in arguments to the APPLY clause and as an argument to WHEN,
OTHERWISE, and the now-deprecated DEFAULT when used on a METADIRECTIVE.
In those cases, use of commas is prohibited to avoid confusion between
commas being part of the directive-specification, and the argument list
separators.
[SPIR-V] Add lowering for G_FPOWI (#185454)
This fixes an assertion I was hitting in the fragment density map sample
in Vulkan Samples. In starfield.frag.hlsl, we have
float starCol = pow((rnd - threshhold) / (1.0 - threshhold), 16.0);
The optimizer recognizes 16.0 as a whole number and converts the call to
`llvm.powi`. The backend goes on to fail with:
fatal error: error in backend: cannot select: %46:fid(s64) = nnan ninf
nsz arcp afn reassoc G_FPOWI %44:fid, %45:iid(s64) (in function:
_Z9starFieldDv3_f)
On Vulkan, there is no integer-exponent for pow. This patch lowers it by
converting the exponent to float and calling GLSL.std.450's Pow.
---------
Co-authored-by: Steven Perron <stevenperron at google.com>
[lldb] Have ObjectFile::FindPlugin send a copy of the DE (#185727)
ObjectFile::FindPlugin iterates over plugins to find one that can handle
the binary provided. It is currently sending the one DataExtractorSP to
each subclass, but some subclasses may modify this DataExtractor during
their processing, e.g. calling DataExtractor::SetData on it, and I think
it is safer to isolate these with a copy of the DataExtractor so the
order the plugins are tried cannot possibly change behavior.
[clang] fix explicit incomplete enum (#184210)
stop BuildConvertedConstantExpression early for already-broken
expressions to prevent crashes in the constant conversion
fixes #183887
[mlir][acc] Add ACCComputeLowering pass (#185501)
Introduce a pass that lowers OpenACC compute constructs to a
representation that separates the data environment from the compute body
and prepares for parallelism assignment and privatization at the right
granularity.
- Decompose acc.parallel, acc.serial, and acc.kernels into
acc.kernel_environment and acc.compute_region. Launch arguments
(num_gangs, num_workers, vector_length) are turned into acc.par_width
and passed as compute_region launch operands.
- Convert acc.loop to SCF based on context: unstructured loops to
scf.execute_region; sequential (serial or seq) to scf.parallel with
par_dims=sequential; auto loops to scf.for (with collapse when
multi-dimensional); orphan loops to scf.for; independent loops in
parallel/kernels to scf.parallel with par_dims from the GPU mapping.
---------
Co-authored-by: Scott Manley <rscottmanley at gmail.com>
libclc: Add div_cr utility function
This is a workaround for the modal div operator precision. The
OpenCL default is not correctly rounded, so this provides a backdoor
to get a correctly rounded fdiv. Ideally clang would have a builtin
or some other mechanism to control the precision.
[ssaf][UnsafeBufferUsage] Add JSON serialization for UnsafeBufferUsage
Implemented and registered a JSONFormat::FormatInfo for
UnsafeBufferUsage analysis
rdar://171920065
Use findAllocaInsertPoint when possible and move the affinity packing logic to OpenMPToLLVMIRTranslation
- Move the omp.affinity_list packing logic from OMPIRBuilder to
OpenMPToLLVMIRTranslation so that we have all the omp.affinity_list
allocating logic inside the lambda defined in buildAffinityData
- all the allocation logic for affinity list is now using
findAllocaInsertPoint when possible (static count)
- `task_affinity_iterator_dynamic_tripcount` in
openmp-iterator.mlir is a regression test add previously for
dynamic tripcount
[lld][WebAssembly] Restore inactive checks relocatable.ll test. NFC (#185569)
Back in 6474d1b20 this test was updated, removing the NORMAL vs SHARED
distinction in the output checking. However many of the NORMAL-NEXT
lines were left unmodified, making them effectively disabled.
This restores and updates the expectations.
[copmiler-rt] Initial support for building profile library on the GPU (#185552)
Summary:
As suggested in https://github.com/llvm/llvm-project/pull/177665, we
should build a GPU version of the compiler-rt profile library instead of
writing it in-line in the lowering. This PR does not define anything GPU
specific, it simply re-uses the baremetal handling. Later PRs will
prevent the GPU specific handling we would want to do to optimize
counter handling on the GPU.
Note that this will require using the cache file, or setting these
options
manually for existing users. Hopefully if people are using the cache
file
as they should it won't break anything.
[AMDGPU] Adds AGPR pressure during candidate init in GCN scheduler.
Scheduling heuristics automatically will consider AGPR pressure.
AGPRExcessLimit and AGPRCriticalLimit are added. Some of the VGPR
bias and error limits are reused. Helpers added mostly mirror the
existing VGPR logic. A ConsiderAGPR boolean controls whether AGPRs
should at all be factored in during candidate initialization, e.g.
on targets with allocatable AGPRs.
Verified that updated LIT tests use AGPRs.
Originally Authored-by: Nicholas Baron
(https://github.com/llvm/llvm-project/pull/150288)
Modified-by: Dhruva Chakrabarti
Assisted-by: Cursor
[SystemZ][z/OS] Remove use of subsections.
HLASM has no notion of subsections. There are several possible solutions
how to deal with this. However,
- using a different section introduces a lot of relocations, which slows
down the binder later
- emitting the PPA1 after the code changes the location which may break
existing tools
The choosen solution is to record the PPA1 data, and emit them at the
end of the assembly into the code section. This solves both issues,
at the expense of having to do some bookkeeping.
This change moves the position of the PPA2, too, but this is less
critical.
Add sancov support for large AArch64 binaries. (#185374)
In AArch64 calls have a +/-128MB range
(https://developer.arm.com/documentation/ddi0602/2025-12/Base-Instructions/BL--Branch-with-link-).
In cases where the .text is larger than that, the linker adds functions
that just jumps to the sanitizer functions and places them to some code
location where the rest of the binary can call it. These functions have
the prefix __AArch64ADRPThunk__.
This commit marks calls to this function as coverage points.
[AArch64][GlobalISel] Add G_SQDMULL node
Previously, GISel was failing to lower the sqdmulls.scalar intrinsic. This is just a variation of sqdmull, but on two 32-bit S registers.
To fix this, create a G_SQDMULL node, and lower sqdmulls.scalar to that. This node is linked to the SD patterns for sqdmull, which allow this version of the intrinsic to lower.
[AArch64][PAC] Don't skip global legalization for AUTH_TCRETURN (#182513)
The 77bcab835aca1 folds llvm.ptrauth.resign intrinsic in case intrinsic
discriminant and key match those in call ptrauth bundle. However
assertion is now fired in AArch64AsmPrinter when PAC is enabled and
we're tail calling a global, because AUTH_TCRETURN expects address to be
stored in register.