488718 Commits

Author SHA1 Message Date
Florian Hahn
8cb2de7fae
[VPlan] Implement type inference for ICmp.
This fixes a crash in the attached test case due to missing type
inference for ICmp VPInstructions.
2024-02-05 15:42:07 +00:00
Timm Baeder
4881cbd407
[clang][Interp] Fix MemberExpr initializing an existing value (#79973)
This is similar to c1ad363e6eba308fa94c47374ee98b3c79693a35, but with
the additional twist that initializing an existing value from a
`MemberExpr` was not working correctly.
2024-02-05 16:41:55 +01:00
cor3ntin
41ea022612
[Clang] Fix crash when recovering from an invalid pack indexing type. (#80652)
If the pattern of a pack indexing type did not contain a pack, we would
still construct a pack indexing type (to improve error messages) but we
would fail to make the type as dependent, leading to infinite recursion
when trying to extract a canonical type.
2024-02-05 16:28:05 +01:00
elhewaty
2614672cc1
[InstCombine] Fold ((cst << x) & 1) --> x == 0 when cst is odd (#79772)
Fold ((cst << x) & 1) to zext(x == 0) when cst is odd.

Fixes: https://github.com/llvm/llvm-project/issues/73384
Alive2: https://alive2.llvm.org/ce/z/5RbaK6
2024-02-05 16:27:53 +01:00
David Spickett
ae92f6e8ae [lldb][Docs] Remove unnecessary colon in title 2024-02-05 15:25:16 +00:00
Joseph Huber
d1722868d3 [Clang] Make AMDGPU OpenCL tests require AMD registered target
Summary:
These tests likely always failed but was hidden by the expected return
value. Simply make them require AMDGPU as a registered target so they
don't fail on other machines.
2024-02-05 09:08:31 -06:00
Timm Baeder
e524ada6cb
[clang][Interp] Support zero init for complex types (#79728)
Initialize both elements to 0.
2024-02-05 15:56:06 +01:00
Natalie Chouinard
de46dc97b1
[SPIR-V] Include SPIRV-Tools tests in CI (#80479) 2024-02-05 09:51:13 -05:00
Timm Bäder
e4f1ef85fd [clang][Interp] Reject bitcasts to atomic types
The current interpreter does this, so follow suit to match its
diagnostics.
2024-02-05 15:45:26 +01:00
Joseph Huber
5249379d74
[AMDGPU] Allow w64 ballot to be used on w32 targets (#80183)
Summary:
Currently we cannot compile `__builtin_amdgcn_ballot_w64` on non-wave64
targets even though it is valid. This is relevant for making library
code that can handle both without needing to check the wavefront size.
This patch relaxes the semantic check for w64 so it can be used
normally.
2024-02-05 08:42:28 -06:00
Joseph Huber
3bf881635c [Offload] Fix entry global names on NVPTX target
Summary:
The PTX language rejects globals with `.` in the name. We need to change
the global name if we are targeting NVPTX to prevent the toolchain from
complaining.
2024-02-05 08:42:02 -06:00
Kevin P. Neal
d15c454bed [FPEnv][AMDGPU] Correct strictfp tests.
Correct AMDGPU strictfp tests to follow the rules documented in the
LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

These tests needed the strictfp attribute added to function calls and
some declarations.

Some of the tests now pass with D146845, others get farther along and
fail with D146845. The tests revealed that further work is required
in mostly AMDGPU atomics to get the tests passing.

Since I was here anyway I removed the strictfp attribute from some
constrained intrinsic declarations. They have this attribute by default.

Test changes verified with D146845.
2024-02-05 09:29:31 -05:00
Simon Pilgrim
1af05363d6 [X86] getShuffleComment - use MI description to determine AVX512 masked predicates instead of src index offsets. 2024-02-05 14:22:46 +00:00
Louis Dionne
daea082082 [libc++] Add missing include of <string.h> in POSIX fallbacks for locale 2024-02-05 09:21:01 -05:00
Jay Foad
abea3b2799
[RDF] Skip over NoRegister. NFCI. (#80672)
This just avoids useless work of adding NoRegister to BaseSet, for
consistency with other places that iterate over all physical registers.
2024-02-05 14:15:55 +00:00
Cullen Rhodes
5f5b3bb22b
[mlir][ArmSME] Add rewrites to swap extract of extend (#80407)
In mixed matmul lowering (e.g., i8 to i32) we're seeing the following
sequence:

  %0 = arith.extsi %src : vector<4x[8]xi8> to vector<4x[8]xi32>
  %1 = vector.extract %0[0] : vector<[8]xi32> from vector<4x[8]xi32>
%lhs = vector.scalable.extract %1[0] : vector<[4]xi32> from
vector<[8]xi32>

  ... (same for rhs)

%2 = vector.outerproduct %lhs, %rhs, %acc vector<[4]xi32>,
vector<[4]xi32>

  // x4 chained by accumulator

This chain of 4 outer products can be fused into a single 4-way widening
variant but the pass doesn't match on the IR, as it expects the source
of the inputs to be an extend and it can't look through the extracts.

This patch fixes this with two rewrites that swaps extract(extend) into
extend(extract).

Related to #78975, #79288.
2024-02-05 14:13:53 +00:00
Cullen Rhodes
8e00fc33eb [mlir][ArmSME][nfc] Fix docs for 2-way ops
The "Refer to" and table shouldn't be in the example code sequence.
2024-02-05 14:07:43 +00:00
Schrodinger ZHU Yifan
a40d68b6de
[libc] tiny fix for doc (#80512) 2024-02-05 09:01:04 -05:00
Hui
825658856d
[libc++] fix counting_semaphore lost wakeups (#79265)
Fixes #77659
Fixes #46357

Picked up from https://reviews.llvm.org/D114119
2024-02-05 13:59:48 +00:00
Mats Petersson
992d852758
[flang]Add support for -moutline-atomics and -mno-outline-atomics (#78755)
This adds the support to add the target-feature to outline atomic operations (calling the
runtime library instead).
2024-02-05 13:54:12 +00:00
Simon Pilgrim
bc6370abd3 [X86] addConstantComments - split VPERMILPS/VPERMILPD handling to reduce repeated switch cases etc. NFC. 2024-02-05 13:48:15 +00:00
Simon Pilgrim
66397435ed [X86] Add common getSrcIdx helper to determine source index after AVX512 masked predicates. NFC. 2024-02-05 13:48:15 +00:00
Shih-Po Hung
a826a0c234
[RISCV] Add tests for reduce.fmaximum/fminimum. NFC (#80553)
This is to add test coverage for crash report in #80340
2024-02-05 21:41:24 +08:00
Matt Arsenault
a5d206df79
AMDGPU: Set max supported div/rem size to 64 (#80669)
This enables IR expansion for i128 divisions. The vector case is still
broken because ExpandLargeDivRem doesn't try to handle them.

Fixes: SWDEV-426193
2024-02-05 19:09:38 +05:30
Pierre van Houtryve
4e958abf2f
[AMDGPU][PromoteAlloca] Support memsets to ptr allocas (#80678)
Fixes #80366
2024-02-05 14:36:15 +01:00
Nikita Popov
ff9af4c43a [CodeGen] Convert tests to opaque pointers (NFC) 2024-02-05 14:07:09 +01:00
Petar Avramovic
06f711a906
AMDGPU/GlobalISelDivergenceLowering: select divergent i1 phis (#80003)
Implement PhiLoweringHelper for GlobalISel in DivergenceLoweringHelper.
Use machine uniformity analysis to find divergent i1 phis and select
them as lane mask phis in same way SILowerI1Copies select VReg_1 phis.
Note that divergent i1 phis include phis created by LCSSA and all cases
of uses outside of cycle are actually covered by "lowering LCSSA phis".
GlobalISel lane masks are registers with sgpr register class and S1 LLT.

TODO: General goal is that instructions created in this pass are fully
instruction-selected so that selection of lane mask phis is not split
across multiple passes.

patch 3 from: https://github.com/llvm/llvm-project/pull/73337
2024-02-05 14:07:01 +01:00
Christudasan Devadasan
89ec940b4a
[AMDGPU] Insert spill codes for the SGPRs used for EXEC copy (#79428)
The SGPR registers used for preserving EXEC mask while lowering the
whole-wave register spills and copies should be preserved at the prolog
and epilog if they are in the CSR range. It isn't happening when there
is only wwm-copy lowered and there are no wwm-spills. This patch
addresses that problem.
2024-02-05 18:32:23 +05:30
Nikita Popov
b31fffbc7f [ARM] Convert tests to opaque pointers (NFC) 2024-02-05 13:56:59 +01:00
Nikita Popov
7bdc80f35c [AVR] Convert tests to opaque pointers (NFC) 2024-02-05 13:55:50 +01:00
lntue
d4ef4b8189
[libc] Fix generated float128 header for aarch64 target. (#78017) 2024-02-05 07:44:51 -05:00
lntue
6ba9d2988b
[libc][math] Add float128 rounding functions (ceilf128, floorf128, roundf128, truncf128). (#80634) 2024-02-05 07:37:57 -05:00
Timm Bäder
c391f285af [clang][Interp][NFC] Add simple test case for atomic types 2024-02-05 13:36:03 +01:00
Sergio Afonso
bc82d1a6b7
[OpenMPIRBuilder][MLIR] Pass target-cpu and target-features to outlined functions (#80283)
This patch adds support for forwarding the target-cpu and
target-features attributes to functions outlined in the OpenMPIRBuilder.
This, in turn, results in the addition of these attributes for functions
created during the translation of the `omp.parallel`, `omp.task` and
`omp.teams` operations, and for the `omp.wsloop` operation when doing
codegen for an OpenMP target device.
2024-02-05 12:22:56 +00:00
Simon Pilgrim
69ffa7be3b
[X86] X86FixupVectorConstants - load+zero vector constants that can be stored in a truncated form (#80428)
Further develops the vsextload support added in #79815 / b5d35feacb7246573c6a4ab2bddc4919a4228ed5 - reduces the size of the vector constant by storing it in the constant pool in a truncated form, and zero-extend it as part of the load.
2024-02-05 12:17:58 +00:00
Timm Bäder
60732c0fae [clang][Interp][NFC] Remove superfluous return statement 2024-02-05 13:05:52 +01:00
Nikita Popov
6e83c0a1cb [X86] Convert tests to opaque pointers (NFC) 2024-02-05 12:43:44 +01:00
Nikita Popov
00a4e248dc [AMDGPU] Convert tests to opaque pointers (NFC) 2024-02-05 12:42:23 +01:00
Yi Wu
1d3d8936ba
[flang] Fix for atand(Y,X), and implment atan2d(Y,X), atanpi(X), atanpi(Y,X), atan2pi(Y,X) (#79002)
Fix: https://github.com/llvm/llvm-project/issues/78568

---------

Co-authored-by: jeanPerier <jean.perier.polytechnique@gmail.com>
2024-02-05 11:41:14 +00:00
Nikita Popov
1ee315ae79 [AArch64] Convert tests to opaque pointers (NFC) 2024-02-05 12:39:51 +01:00
David Green
84ea236af9
[BasicAA] Handle scalable type sizes with constant offsets (#80445)
This is a separate, but related issue to #69152 that was attempting to improve
AA with scalable dependency distances. This patch attempts to improve when
there are scalable accesses with a constant offset between them. We happen to
get a report of such a thing recently, where so long as the vscale_range is
known, the maximum size of the access can be assessed and better aliasing
results can be returned.

The Upper range of the vscale_range, along with known part of the typesize are
used to prove that Off >= CR.upper * LSize. It does not try to produce
PartialAlias results at the moment from the lower vscale_range. It also enables
the added benefit of allowing better alias analysis when the RHS of the two
values is scalable, but the LHS is normal and can be treated like any other
aliasing query.
2024-02-05 11:20:50 +00:00
Alex Bradbury
13e52b3279 [docs][RISCV] Add missed release note for Zimop codegen support 2024-02-05 11:11:59 +00:00
Matthias Springer
0940be1581
[mlir][bufferization] Never pass ownership to functions (#80655)
Even when `private-function-dynamic-ownership` is set, ownership should
never be passed to the callee. This can lead to double deallocs (#77096)
or use-after-free in the caller because ownership is currently passed
regardless of whether there are any further uses of the buffer in the
caller or not.

Note: This is consistent with the fact that ownership is never passed to
nested regions.

This commit fixes #77096.
2024-02-05 12:11:49 +01:00
Nikita Popov
1aee1e1f4c [Analysis] Convert tests to opaque pointers (NFC) 2024-02-05 12:04:39 +01:00
Alex Bradbury
9dd40f8c85 [docs][RISCV] Update release notes to include Zalasr and S* extensions from profiles spec
Also reflow the line for Zabha, as we normally line-wrap this file.
2024-02-05 11:00:35 +00:00
Orlando Cazalet-Hyams
ddd95b15d1
[RemoveDIs] Handle DPValues in hoistCommonCodeFromSuccessors (#79476)
Hoist DPValues attached to each instruction being considered for hoisting if
they are identical in lock-step. This includes the final instructions which
are considered but not hoisted, because the corresponding dbg.values would
appear before those instruction and thus hoisted if identical.

Identical debug records hoisted:
llvm/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll

Non-identical debug records not hoisted:
llvm/test/Transforms/SimplifyCFG/X86/pr39187-g.ll

Debug records attached to first not-hoisted instructions are hoisted:
llvm/test/Transforms/SimplifyCFG/hoist-dbgvalue-inlined.ll
2024-02-05 10:58:46 +00:00
Nikita Popov
2d69827c5c [Transforms] Convert tests to opaque pointers (NFC) 2024-02-05 11:57:34 +01:00
Anatoly Trosinenko
7d879bc851
[AArch64][PAC] Refine authenticated pointer check methods (#74074)
Align the values of the immediate operand of BRK instruction with those
used by the existing arm64e implementation.

Make AuthCheckMethod::DummyLoad use the requested register
instead of LR.
2024-02-05 13:53:26 +03:00
Alex Bradbury
04c1cce33c [docs][RISCV] Remove Zicond from release notes now it was backported
Zicond's graduation to non-experimental was backported to 18.x in #80018,
so remove the release note.
2024-02-05 10:50:42 +00:00
Guillaume Chatelet
b05ba231bf
[libc] Add next_toward_inf fo FPBits (#80654)
It is needed to provide correct rounding when building FPRep from
greater precision representations.
2024-02-05 11:50:45 +01:00