[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.
Revert "[CodeGen] Use RegisterClassInfo for remaining allocation-order users" (#221749)
Reverts llvm/llvm-project#216510
breaks tests MIOpen/CK shard 1-4 in CI
queueing this up in case we want to save a bit of time
[SCEV] Add test coverage for ext-nusw/nsuw inference (#218943)
Complete the existing incorrect-nsw test, showing that zext-addrec nusw
is not implied by nw on the pre-inc AR, and that sext-addrec nsuw is not
implied by nw on the pre-inc AR. See also: #217405 and #217362.
Assisted-by: AI
[offload][omp] Remove data_fence
All supported backends execute enqueued work on a given queue in
submission order (CUDA, AMDGPU, and Host queues are always in-order;
Level Zero's default and non-default in-order/synchronous command
modes are as well), so the explicit data-fence used to order a
pointer-attachment after prior data transfers is unnecessary. Remove
the DeviceTy/GenericDeviceTy/GenericPluginTy dataFence chain and the
now-unused olQueueBarrier liboffload API added to support it.
[SimplifyCFG] Preserve !unpredictable when forming a switch (#221580)
SimplifyCFG turns a chain of equality comparisons into a switch in two
places, performValueComparisonIntoPredecessorFolding() and
simplifyBranchOnICmpChain(), and neither propagated !unpredictable. The
hint was therefore dropped even though it is valid on a switch and the
reverse transform, simplifySwitchOfCmpIntrinsic(), already preserves it.
Propagate the metadata in both. Folding a comparison into a predecessor
merges two decisions into a single switch, so the result is only marked
unpredictable when both of the folded comparisons were. That also makes
chains longer than two blocks work: the fold runs once per predecessor
and reads the metadata back off the switch it built on the previous
iteration.
simplifyBranchOnICmpChain() also emits a range check instead of a switch
when the case values are contiguous. That branch is an exact replacement
for the original one, so it inherits the metadata unconditionally, and
the flag now survives into the machine IR.
Fixes #42658.