[AMDGPU][GlobalISel] Don't give GDS globals a relocation (#247363)
Stops GlobalISel from giving GDS globals the relocation that's meant
only for LDS globals and thus avoid a GlobalISel crash for external GDS
globals.
[clang][RISCV] Diagnose an invalid -march when selecting a multilib (#247480)
A link-only command with an -march that cannot be parsed gets no error
and silently uses the default multilib. The multilib code ignores the
parse error, which is only reported for compile jobs.
Report the same error in both RISC-V multilib paths, like ARM and
AArch64 do.
Assisted-by: Claude
[llvm-mca][x86] Add missing AVX-NE-CONVERT instruction tests (#246691)
Adds missing xmm and ymm instruction tests for the AVX-NE-CONVERT ISA
extension to the Machine Code Analyzer.
Generates baseline (generic) and Alder Lake scheduling models.
Fixes #246300
Revert "[Analysis] Improve isGuaranteedNotToBeUndefOrPoison for global variables" (#247651)
This caused assertion failures:
llvm/lib/IR/DataLayout.cpp:50:
llvm::StructLayout::StructLayout(StructType *, const DataLayout &):
Assertion `!ST->isOpaque() && "Cannot get layout of opaque structs"'
failed.
See comment on the original PR for reproducer.
Reverts llvm/llvm-project#247136
[X86] LowerFunnelShift - apply modulo mask to the vXi16 amount splat source directly (#247649)
vXi16 lowering was being handled by the TLI expansion, but it was
suffering from the same issue as #247146 - we should prefer
SPLAT(AND(AMT,BW-1)) to AND(SPLAT(AMT),BW-1)) - we're unwrapping the
SPLAT anyhow, and getTargetVShiftNode does a good job of merging the AND
with inner elements.
This patch replicates the TargetLowering::expandFunnelShift, and adjusts
the splat modulo ordering - the FSHR codegen was re-ordered as I altered
the order of node creation to reduce code duplication.
Avoids a use case for the AND(X,0) SimplifyDemandedVectorElts fold that
is causing so many POISON issues.
Add the truesearch.status event
This commit adds a subscribable event so that the UI can get status
updates as truesearchd does indexing passes on datasets. Middlewared
uses the python client library provided by the truesearchd package and
creates a single process-wide subscription for indexing / truesearch
events and then forwards them along to any subscribers.
[RISCV] Fold vmerge_vl m0, (vselect m1, t, f), f -> vmerge_vl (m0 && m1), t, f
Removing the inner vselect allows the vmerge_vl to be folded into the true operand by RISCVVectorPeephole.
We emit this pattern of vmerge_vl + vselect in vectorized reductions like this:
```c
for (int i = 0; i < n; i++)
if (a[i] == x && b[i] != y)
cnt++;
```
Extending this to `vmerge_vl m0, (vmerge_vl m1 ...)` doesn't catch any more cases in practice.
Assisted-by: Opus 5.5
[AMDGPU] Add MFMA co-exec rows for gfx942 MFMAs (#245294)
Add MFMA co-exec rows for gfx942 MFMAs for both gfx942 and gfx950.
Gfx950 support gfx942 mfma opcodes as well as others.
Add rows for:
XDL_2Pass:
v_mfma_f32_4x4x4_16b_{f16,bf16}
v_mfma_i32_4x4x4_16b_i8
XDL_4Pass:
v_mfma_f32_16x16x16_{f16,bf16}
v_mfma_i32_16x16x32_i8
v_mfma_f32_16x16x8_xf32 (gfx942 only)
v_mfma_f32_16x16x32_{bf8,fp8}_{bf8,fp8}
XDL_8Pass:
v_mfma_f32_16x16x4_4b_{f16,bf16}
[42 lines not shown]
[X86] Add VMTRUNC/VMTRUNCS/VMTRUNCUS upper elements handling
computeKnownBitsForTargetNode - the masked truncations zero the
elements above the truncated ones, like VTRUNC/VTRUNCS/VTRUNCUS.
isGuaranteedNotToBeUndefOrPoisonForTargetNode - these upper elements
are never undef/poison. #245048 adds the same handling for VTRUNC.
Assisted-by: Claude Code (Claude Opus 5.5)
[CIR] Handle integers wider than 64 bits in the vector constant folders
`cir::IntAttr::getUInt()` and `getSInt()` assert when the value needs
more than 64 bits. The folders of `cir.vec.cmp`, `cir.vec.ternary` and
`cir.vec.shuffle.dynamic` read constant elements through them, so they
asserted on a vector of `__int128` with such an element. C++ reaches
all three at -O0. The verifier of `cir.vec.shuffle` read its indices the
same way and asserted while parsing an index wider than 64 bits.
They now work on the `APInt` values:
- `cir.vec.cmp` compares the elements at their full width.
- `cir.vec.ternary` tests whether the condition element is zero.
- `cir.vec.shuffle.dynamic` masks the index before narrowing it.
- The `cir.vec.shuffle` verifier recognizes the -1 index by all of its
bits being set and range-checks the other indices without narrowing
them.
Folds of integers up to 64 bits are unchanged.
[2 lines not shown]
[CIR] Fix crashes in the vector constant folders
A constant vector can hold elements that are not integer or
floating-point literals, such as undef and poison. Folding a
`cir.vec.shuffle` with a -1 index produces one. The folders of
`cir.vec.cmp`, `cir.vec.fcmp`, `cir.vec.ternary` and
`cir.vec.shuffle.dynamic` cast every element they evaluate to a literal
and asserted on such a vector. They now leave the operation alone. This
also covers a `cir.vec.ternary` whose condition is a constant vector of
bool, which is still not folded.
Two more assertions in the same folders are fixed the same way:
- The `true` and `false` shortcut of `cir.vec.fcmp` built a constant
from the fixed size of the result type and asserted on a scalable
vector.
- `cir.vec.shuffle.dynamic` indexed past the end of a vector whose
element count is not a power of two.
[14 lines not shown]
powerpc: zero the FPU save area in set_fpregs() when it was not valid
set_fpregs() marks the saved FPU registers valid and fills in the FP
registers and the FPSCR, which are only half of each of VSR0-31. The
other halves are left alone, and on a thread that hasn't used the FPU
since exec they still hold whatever the previous program left there:
exec only resets pcb_flags, and enable_fpu() zeroes the save area only
when PCB_FPREGS is clear.
So a PT_SETFPREGS on such a thread, even one that just writes back what
PT_GETFPREGS returned, hands the new program VSX register contents of
the program that ran before the exec.
Zero the save area first when it wasn't valid, like enable_fpu() does.
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D62037
[VPlan] Return nullopt for irregular types in getConstantStride (NFC). (#247643)
Instead of asserting that the access type is not irregular, return
std::nullopt from vputils::getConstantStride. Callers no longer need to
guard the call with hasIrregularType themselves.
[AArch64] Implement ACLE intrinsics for FPv2 SVE min/max instructions
ACLE PR: https://github.com/ARM-software/acle/pull/480
Implements the following intrinsics:
- svmaxmg / svminmg
- svmaxinm / svmininm
- svmaxmginm / svminmginm
Includes f16, f32, and f64 types, _m, _z, and _x predication and _n variants
AI assistance: Codex used for generating test cases
[mlir][x86] Lower F16 `contract` to FMA using AVX2 F16 packed ops and BF16 fallback. (#245914)
Extend the `VectorContractBF16ToFMA.cpp` pass to:
1. lower `F16` type `vector.contract` to `vector.fma` using `AVX2` F16
packed operations:
- `vbcstnesh2ps` - Broadcasts F16 into packed F32,
- `vcvtneeph2ps` - Convert packed F16 even-indexed elements into packed
F32,
- `vcvtneoph2ps ` - Convert packed F16 odd-indexed elements into packed
F32.
2. fallback case for `bf16` type (both avx2 and avx512).
[VPlan] Use vputils::getLoadStoreValueType in more places (NFC). (#247639)
Replace manual computations of the loaded/stored type from operands or
the underlying IR instruction with vputils::getLoadStoreValueType. Make
the helper take a const pointer, so it can be used from const methods.
[Clang] Add regression test for #161196 (#247438)
Add a regression test for #161196 (an undeduced variable template type
used in decltype)
The test file is renamed to undeduced-variable-template.cpp since it now
contains tests for three different issues.
Fixes #161196
[clang][Driver] Add the OpenACC offloading kind
Add the OpenACC offloading kind to the flang driver. -fopenacc with
--offload-targets= or --offload-arch= creates the offloading toolchain. OpenACC
will have no device compilation job. There is a single host compilation job,
which will also generate and embed the device image. The link then goes through
the offloading linker wrapper as usual. Initially, OpenACC will support only a
single offloading architecture, thus, an error is emitted if more are given.
Assisted-by: Claude Sonnet 5.5