[CIR] Match OGCG noalias and memory effects on operator new
Sane replaceable operator new calls now get return noalias and
memory(inaccessiblemem: readwrite, errnomem: write), matching classic
codegen. -fno-assume-sane-operator-new drops both.
[analyzer] Fix crash destructing element of a sugared array type
ExprEngine::makeElementRegion falls short trying to determine the
element type of an array that involves a type aliasing a static array
type.
This leads to a crash in ExprEngine::ProcessMemberDtor where it assumes
that element type is a CXXRecordDecl, while it is still a type alias to
a static array type.
getBaseElementType is the canonical way to desugar and peel off the
array dimensions.
Assisted by Claude Opus 5
--
CPP-8838
[CIR] Add noalias on malloc-like function returns
Mirror classic RestrictAttr handling so __attribute__((malloc)) and
__declspec(restrict) stamp llvm.noalias on the return, matching OGCG.
[OMPIRBuilder] Restore the debug location after the reduction alloca (#221253)
`createReductions` emits the array of type-erased pointers to the
private reduction values in the alloca block, which means leaving the
current insertion point and coming back. The insertion point is
re-established but the debug location is not. Everything emitted
afterwards like the `__kmpc_reduce` and the matching __kmpc_end_reduce
inherits whatever the terminator happened to carry, which is usually
nothing. This could result in a verifier error if program is linked with
openmp runtime that has debug information.
Fix it by restoring the debug location along with the InsertPoint.
[RISCV] Fix infinite DAGCombine loop with SETCC and SIGN_EXTEND_INREG (#221593)
We generalized (X & -(1 << C1) & 0xffffffff) == C2 << C1 using `sraiw`.
The combine generates a `SIGN_EXTEND_INREG` when simplifying.
However, when C1 is 0 and the sign bit (bit 31) of X is already known to
be zero, `DAGCombiner` sees that `SIGN_EXTEND_INREG` is semantically
equivalent to `AND X, 0xFFFFFFFF` (zext). Because `DAGCombiner`
considers `AND` to be more canonical than `SIGN_EXTEND_INREG` in this
context, it immediately reverts the node back to `AND`.
This caused an infinite DAGCombine loop. This patch disables the folding
when the C1 is zero. That case is covered by a later combine that already
checks if bit 31 is known to be zero.
Fixes: https://github.com/llvm/llvm-project/issues/221521
[offload][omp] Manage memory allocation through liboffload
Migrate DeviceTy::allocData/deleteData off GenericPluginTy::data_alloc/
data_delete onto liboffload's olMemAlloc*/olMemFree, migrate
targetLockExplicit/targetUnlockExplicit off data_lock/data_unlock onto
olMemRegister/olMemUnregister (fixing a latent bug where these passed
the OpenMP-visible device number instead of the plugin device id), and
migrate DeviceTy::isAccessiblePtr onto a new olMemIsAccessible API
(added with a unit test) since liboffload had no equivalent for
querying accessibility of arbitrary, not-necessarily-liboffload-
allocated pointers. Removes the now-dead GenericPluginTy::data_alloc/
data_delete/data_lock/data_unlock/is_accessible_ptr wrappers and their
exports entries.
[AArch64] Prevent reuse of retired architecture names
Add explicit lists of retired AArch64 feature and system register names,
with TableGen validation preventing future definitions from reusing them.
This preserves names previously exposed by LLVM after their architectural
features or registers have been withdrawn or removed. Add coverage for
target features, architecture extension names and aliases, architectural
FEAT_* names, and system registers.