[Offload][Omp] Finish removing Plugin Interface from libomptarget (#239525)
This PR is mostly NFC and removes all remaining usages of the Plugin
Interface from libomptarget:
* Headers from the Plugin Interface are removed
* Remaining Plugin::Error usages were substituted by createError
* RecordReplay files were moved out of the plugins common directory
* Removed GenericPlugin from PluginManager and DeviceTy
* Changed usages of RTLDeviceID to use the OpenMP DeviceID. This is the
only change in behavior, but the previous value was probably not correct
if there were more than one plugin.
* Removed helpers to get GenericPlugin and RTLDeviceID. We still have 3
helpers remaining to transition.
Assisted by Claude.
[X86][APX] Test the relocation of an NF add
test_regclass_not_updated_by_regalloc_2 only produced an NDD/NF add
with a GOT operand because the allocator happened to give the add a
destination different from its source. With SlotIndexes compaction it
picks the same register, so the add is compressed to the legacy form
and the CODE_6 TODO lost its test.
Add a function whose add keeps its source live, so it stays NDD and
becomes NF under any allocation.
[X86] Enable SlotIndexes compaction by default
Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.
Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.
Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for.
[LAA] Fix missing RT checks for unknown deps via non-header phis. (#230292)
Keep track of MemAccesses so we can map dependence source/sink directly
to them, instead of going through the pointers of the source and dest
instructions.
This allows correctly removing dependences.
Previously, pointers to non-header phis were not handled correctly: the
MemAccess in the map would refer to the translated pointer, which is
different to the pointer phi.
[LLDB] Clarify packet search state comments (#239415)
Document the buffer size recorded with the packet search cursor and
clarify that compression causes the search to restart. Address the
comment nits from the review of #238530.
[Clang] Fix new initializer list mangling (#232629)
Clang was adding the initializer-list marker twice when mangling an
expression such as `new std::initializer_list<int>{1}`.
Unwraped the compiler created init list expression and mangled its
elements only once.
Fixes #232531
Increase the limit for ctor initializers (#239011)
The below bug reports that we 'assert'/silently fail when given too many
initializers. Also, that the limit of 2^^16 was too small in some
generated code.
This patch promotes the 'constructor initializer' limit from a bitfield
to a member of the
CXXConstructorDecl, providing 32 bits for storage.
Additionally, it moves the DeductionCandidateKind into the decl type
itself, which adds
an additional couple of bits to the available list for FunctionDecl and
its derivatives (since it
was easy, and was harder to remove from this patch after a large
refactor).
Fixes: #219366
[2 lines not shown]
[clang][bytecode] Always check the source pointer in `Memcpy()` (#239563)
Loading from an uninitialized pointer will otherwise cause us problems
later.
Make empty record fields be initialized by default, so we don't diagnose
those. Also add the initialization state to `Pointer::operator<<`.
This fixes `SemaCXX/ext-int-vector.cpp`.
[mlir][vector] Consistently name Vector op results (#238070)
This continues the cleanup tracked in #131602.
Use result consistently in Vector op definitions, replacing names such
as dest and res. For DeinterleaveOp, rename res1 and res2 to resultEven
and resultOdd, respectively, to reflect their contents.
[AMDGPU] Exercise replay warning across inline asm blocks
Use the recognized EXEC-zero B8 workaround in the later block so the
fixture distinguishes per-block recognition from a combined sequence.
[clang-repl] Accept the 32-bit NVPTX triple in the CUDA emit-llvm test (#239329)
The CUDA device triple is nvptx-nvidia-cuda on 32-bit host. emit-llvm.cu
currently fails on its check for nvptx64-nvidia-cuda. Accept both
triples, as done in clang/test/Driver/cl-options.cu.
[Offload][OMPT] Use omptest for unit testing OMPT events (#239394)
We had developed omptest to be able to write tests that are very close to
writing gtest unit tests but being able to assert on OMPT events.
omptest has been in-tree for some time now but was not used to actually
test any OMPT events (afaik).
With this patch, we add omptest to the offload wiring for testing
libomptarget and introduce a new directory for omptest-based unit tests.
Having OMPT enabled and omptest being build in the default gtest-based
flavor to pick-up the in-tree gtest is the prerequisite for those unit
tests to be enabled.
The configuration of omptest is picked up from the buildtree and
omptests generated CMake config, and made available to the lit runner.
I am always a bit afraid of the CMake as I don't like it and easily get
confused with it.
AI-assisted: Claude Opus 5.5 / Sonnet 5
[lldb-dap] Rename StackFrame.compileUnitId to $__lldb_compileUnitId (#239565)
use the `$__lldb_` prefix in the the compileUnitId field to match the
existing convention.
The attribute is not used yet in public releases.
[SelectionDAG] Refactor WidenVecRes_BinaryCanTrap to improve scalable vector support. (#239330)
The core change is to use ElementCount in place of unsigned, at which
point the original algorithm just works.
Special handling is required for `<vscale x 1 x Ty>`. When legal the
algorithm cannot assume a known-min-value of 1 implies scalarisation.
When not legal the algorithm cannot work and a failure is reported.
[CIR] Introduce `cir.vec.fcmp` op and floating comparison kinds (#235843)
Currently CIR uses the same operation and a set of comparison kinds for
both floating and integer comparisons which results in multiple
workarounds. For example: there are currently no unordered comparision
kinds and instead inversion is applied to ordered ones. This PR only
brings a new op and new comparison kinds that include unordered kinds
and true/false and uses it in one of the places (X86 builtins) where it
allows to remove a workaround. The intention is to do the whole split
between floating and integer comparisons at least for vector variant of
cir cmp op and this PR is the first step.
Assisted-by: claude
[libc++] Mark LWG4269 as Complete and test unique_copy argument order (#239085)
LWG4269 changes the specification of unique_copy so that the predicate
is called with the earlier element as the first argument, consistent
with unique.
libc++ already conforms to this in all three implementation strategies
of std::unique_copy and in ranges::unique_copy, so no library code
changes are needed. This is considered completed together with
ranges::unique{_copy} in 62f1e6638158d8848777a29d9d142bb5481c7b67 (LLVM
15, backported from 72f57e3a30d597346feec74cf626796b0055680f in LLVM
16).
This adds regression tests verifying that the earlier element is passed
first across iterator categories, ranges, and projections, and marks
LWG4269 as complete in Cxx26Issues.csv.
Fixes #171326
Signed-off-by: anant <anant1234466 at gmail.com>
[MLIR][Vector] Keep the kind and fast-math flags when rebuilding vector.contract (#236855)
Several patterns rebuild a `vector.contract` with the builder that takes
only the operands, the indexing maps and the iterator types. That
builder sets the default combining kind (`add`) and no fast-math flags.
So these patterns turn, for example, a `kind<maxnumf>` contract into a
`kind<add>` contract, which computes a different result, and they drop
the fast-math flags of the contract:
- `CombineContractABTranspose`, `CombineContractResultTranspose` and
`CombineContractBroadcastMask` (the reduction-to-contract patterns)
- `CanonicalizeContractMatmulToMMT`
- `FoldArithExtIntoContractionOp`
- `PrepareContractToGPUMMA` (VectorToGPU; `convert-vector-to-xegpu` uses
it too)
`castAwayContractionLeadingOneDim` keeps the kind, but drops the flags.
This patch gives the new contract the kind and the flags of the old one
[24 lines not shown]
[Flang][NFC] Remove unnecessary template instantiations (#239182)
Since #216960, the `Expr<>` specializations are not partial
specializations anymore, hence they do not need explicit instantiations
that tell the compiler which instances it needs to instantiate. Remove
the explicit instantiations that do nothing. Some other explicit
instantiations were unnecessary even before #216960.
Suggested by @eugeneepshteyn
(https://github.com/llvm/llvm-project/pull/238748#discussion_r4468788352)
[libc++][pstl] Add serial implementations of partitioning algorithms to PSTL (#234598)
This PR adds serial implementations of the partitioning algorithms to
PSTL.
They are added to the serial backend only, such that any other backend
can fall back to these implementations.
Currently there's no intent to provide parallel versions of these
algorithms, but later they can be added as well.
These are the added algorithms:
- `std::partition`
- `std::stable_partition`
- `std::partition_copy`
Included tests check that:
- Semantics of the functions is correct.
- The functions correctly SFINAE out when the first argument is not an
execution policy.
- The `nodiscard` policy is followed.
[3 lines not shown]