[offload][omp] Move OpenMP KLE to libomptarget
Move preparations related to OpenMP KLE and
dynamicCGroupMem fallback out of the plugins and
into libomptarget.
Resructure Device::launch as it grew too large.
[CIR] Fix assertion with pointer offset in ternary (#224724)
Ternary lowers into some blocks, so the values that come into it end up
being block arguments, so there is no defining op for them. As a result,
the 'optimization' of the zero/subtract isn't really possible. THis
patch uses a dyn_cast_if_present instead of a dyn_cast to make sure we
don't hit that.
[SelectionDAG] fold interleave of contiguous splats (#224318)
When operands of vector_interleave is splats and each splat's is from a
contiguous source , interleave operations can be folded to shuffles of
source of splat.
i.e.
interleave(splat(S[J]), splat(S[J+1]), splat(S[J+2]), ..., splat(S[J +
Factor - 1]))
can be folded to
shuffles (S[J], S[J+1], S[J+Factor -1], S[J]....)
[AMDGPU] Update no-modifier operand tests for the dropped align diagnostic
The no-modifier reg-or-inline operands routed through the HwMode
predicate now report a misaligned tuple as a plain invalid operand,
matching the diagnostic dropped earlier in the stack.
[AMDGPU] Route no-modifier reg-or-inline AsmParser operands through HwMode predicate
Convert the reg-or-inline operands with no modifiers (MFMA VGPR/AGPR
sources, VCSrc, v_pk_mov_b32, VOP scalar f64) from the fixed-class
isRegOrInlineNoMods to the HwMode-aware isRegOrInlineNoModsByHwMode, so an
odd-aligned tuple is rejected at the offending operand column instead of by
the validateVGPRAlign catch-all.
Co-Authored-By: Claude <noreply at anthropic.com>
[AMDGPU][InstCombine] Fold zero dot operands to accumulator
Fold AMDGPU dot intrinsics when either operand is zero.
`dot(a, 0) = 0` and `dot(0, b) = 0`, so replace the intrinsic with its accumulator.
This avoids unrelated clamp and add/sub reassociation cases.
[AMDGPU][InstCombine] Canonicalize dot constant operands
Move constant dot product source operands to the right hand side
and add tests for signed and unsigned dot intrinsics.
[AMDGPU][InstCombine] Fold constant add/sub into the dot accumulator
`amdgcn.{s,u}dot{2,4,8}(a, b, C) +/- K -> dot(a, b, C +/- K)` when both the
accumulator C and K are constants. The new constant is computed with
wrapping APInt arithmetic to match the non-clamping accumulate.
Only applies when clamp is false (the saturating accumulate does not
reassociate) and the dot has a single use. K - dot is left alone since it
would need the dot product negated.
workflows/release-binaries: Improve Windows installer (#220414)
The Windows WiX installer was missing two things for its setup:
1. The "product ID" which is used to uninstall any previous installed
LLVM versions. This avoids having versions living side-by-side with each
new release. I've reused the same GUID as the current 23.1.0 Win64
installer, to continue that "line" of product. The AArch64 installation
and any prior LLVM version (NSIS) before 23.1.0 will need to be
uninstalled manually, if we want to avoid side-by-side installatin.
2. A "per machine" scope which avoids messy installations which are
installed globally, but cannot be uninstalled globally, and available
only for the current user. After this PR, the installation is available
/ uninstallable to all users on the machine.
Since LLVM currently requires cmake 3.20 for building, and hasn't been
bumped yet to 3.31, also provide a workaround for the WiX scope setup.
[3 lines not shown]
[clang][flang][omp] Always generate a kernel environment (#223772)
Currently OpenMP doesn't generate a Kernel Enviroment for host kernels
or ompx_bare kernels. This causes the runtime to have special handling
for this cases.
This patch ensures that a Kernel Environment is always generated which
will allow to simplify the RTL handling.
Done mostly by Claude.
[MLIR][Remark] Emit final-policy remarks in deterministic order
RemarkEmittingPolicyFinal stores remarks in a DenseSet whose hash
includes the location pointer, so the output order depends on heap
layout and changes between runs. Twenty runs of
mlir/test/Pass/remark-final.mlir gave fourteen different orders, which
is why the test uses CHECK-DAG.
Store remarks in a MapVector keyed by a new Identity: location, remark
name, combined category name and kind, the same fields the DenseSet
compared. A repeated identity overwrites the stored remark in place, so
a remark is printed where its identity was first reported with the
content it last had. Root remarks come out in first-report order and
linked children still follow their parent.
Identity is a private nested type of the policy, since nothing outside
decides what that policy treats as the same remark. Its asTuple() is the
only place the field list appears and drives both hashing and equality,
so the two cannot disagree about which fields matter. IdentityInfo is
[14 lines not shown]
[libc][CPP][NFC] Remove unused cpp::vector container (#224976)
Removed cpp::vector (added in 5afbbd04803c) and its unit tests.
The group and password database entrypoints now pack auxiliary pointer
arrays into the trailing scratch space of DynamicBuffer (7252edd9aa82),
leaving cpp::vector with no callers in the codebase.
Assisted-by: Automated tooling, human reviewed.
[orc-rt] Implement Windows target triple detection (#224514)
Adds Windows target triple detection for ORC-RT.
Currently supports x86-64 MSVC targets only. ARM64 will be added once
tested on that platform.
[AMDGPU][InstCombine] Fold zero dot operands to accumulator
Fold AMDGPU dot intrinsics when either operand is zero.
`dot(a, 0) = 0` and `dot(0, b) = 0`, so replace the intrinsic with its accumulator.
This avoids unrelated clamp and add/sub reassociation cases.
[AMDGPU][InstCombine] Fold constant add/sub into the dot accumulator
`amdgcn.{s,u}dot{2,4,8}(a, b, C) +/- K -> dot(a, b, C +/- K)` when both the
accumulator C and K are constants. The new constant is computed with
wrapping APInt arithmetic to match the non-clamping accumulate.
Only applies when clamp is false (the saturating accumulate does not
reassociate) and the dot has a single use. K - dot is left alone since it
would need the dot product negated.
[AMDGPU][InstCombine] Canonicalize dot constant operands
Move constant dot product source operands to the right hand side
and add tests for signed and unsigned dot intrinsics.