449159 Commits

Author SHA1 Message Date
OCHyams
4ece50737d [Assignment Tracking][NFC] Replace LLVM command line option with a module flag
Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is
still enabled from Clang with the command line -Xclang
-fexperimental-assignment-tracking which tells Clang to ask LLVM to run the
pass declare-to-assign. That pass converts conventional debug intrinsics to
assignment tracking metadata. With this patch it now also sets a module flag
debug-info-assignment-tracking with the value `i1 true` (using the flag conflict
rule `Max` since enabling assignment tracking on IR that contains only
conventional debug intrinsics should cause no issues).

Update the docs and tests too.

Reviewed By: CarlosAlbertoEnciso

Differential Revision: https://reviews.llvm.org/D142027
2023-01-20 14:24:15 +00:00
Nikita Popov
d49b842ea2 [SROA] Use copyMetadataForLoad() helper
Instead of copying just nonnull metadata, use the generic helper
to copy metadata to the new load. This helper is specifically
designed for the case where the load type may change, so it's
safe to use in this context.
2023-01-20 15:24:10 +01:00
Benjamin Kramer
fcd505d040 [arith] Allow integer casts of 0-D vectors
This just works, no reason to disallow it.

Differential Revision: https://reviews.llvm.org/D142137
2023-01-20 15:21:52 +01:00
Kadir Cetinkaya
ebd9a2477e
[clang] Fix typos in member initializers
This was regressed in ca619613801233ef2def8c3cc7d311d5ed0033cb. As we
attached InitExprs as-is to the AST, without performing transformations.

Differential Revision: https://reviews.llvm.org/D142187
2023-01-20 15:20:31 +01:00
Nikita Popov
269cfd3156 [SROA] Add additional metadata preservation tests (NFC) 2023-01-20 15:07:33 +01:00
Serge Pavlov
65cf77d218 [clang] Use FP options from AST for emitting code for casts
Differential Revision: https://reviews.llvm.org/D142001
2023-01-20 20:47:43 +07:00
Backl1ght
58751f943f [clang-format] SortUsingDeclarations support lexicographic order
fix https://github.com/llvm/llvm-project/issues/59930

Differential Revision: https://reviews.llvm.org/D141694
2023-01-20 21:34:57 +08:00
OCHyams
a5b457b778 [Assignment Tracking] Update test to use opaque pointers 2023-01-20 13:25:56 +00:00
Samuel Parker
714286f9e6 [NFC] Precommit tests
For (trunc (fp-to-int)).
2023-01-20 13:17:34 +00:00
Jean Perier
7531c87183 [flang][hlfir] Enable allocate, deallocate, pointer assignment lowering
The previous patches allowed lowering allocatable/and pointer designator
expressions with HLFIR.
This patch updates the bridge genExprMutableBox to use HLFIR lowering
when HLFIR flag is set. For allocate and deallocate lowering that use
genExprMutableBox, no other change is needed.

For pointer assignments, the code doing the pointer assignments in the
bridge can be reused and is simply moved so that it can be shared, and
the "explicit context" special cases of the previous lowering are
by-passed.

The code doing pointer assignment revealed that convertExprToAddress
did not match the previous genExprAddr behavior (that actually
does not create temps for "x" where x is not contiguous).
Instead of trying to copy the old behavior that is a bit weird (was
dictated by the implementation rather than design). Update
convertExprToAddress to do something sensible and that works with
the current genExprAddr usages (if anything, it should saves bogus
array section temps).

Differential Revision: https://reviews.llvm.org/D142197
2023-01-20 14:06:30 +01:00
David Sherwood
37f8ffc64c [AArch64][SME2] Add LLVM IR intrinsics for the vertical dot products
Adds intrinsics for the following SME2 instructions:

* BFVDOT (32-bit)
* FVDOT (32-bit)
* SVDOT (2-way) (32-bit)
* SVDOT (4-way) (32-bit and 64-bit)
* UVDOT (2-way) (32-bit)
* UVDOT (4-way) (32-bit and 64-bit)
* SUVDOT (32-bit)
* USVDOT (32-bit)

NOTE: These intrinsics are still in development and are subject to future changes.

Differential Revision: https://reviews.llvm.org/D142000
2023-01-20 13:01:03 +00:00
Guray Ozen
a3388f3e2a [mlir] Introduce a pattern to lower gpu.subgroup_reduce to nvvm.redux_op
This revision introduces a pattern to lower `gpu.subgroup_reduce` op into to the `nvvm.redux_sync` op. The op must be run by the entire subgroup, otherwise it is undefined behaviour.

It also adds a flag and populate function, because the op is not avaiable for every gpu (sm80+), so it can be used when it is desired.

Depends on D142088

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D142103
2023-01-20 13:56:23 +01:00
Tom Eccles
b0d575310f [mlir][Linalg] Fix ignoring nodiscard return value
ff94419a287c changed the return value of appendMangledType() to
LogicalResult, which is marked as nodiscard. Ignoring the result
generates a warning when building with clang.

Reviewed By: nicolasvasilache, chelini

Differential Revision: https://reviews.llvm.org/D142202
2023-01-20 04:51:21 -08:00
Kevin Sala
097f42602d [OpenMP][libomptarget] Fix deinit of NextGen AMDGPU plugin
This patch fixes a segfault that was appearing when the plugin fails to
initialize and then is deinitialized. Also, do not call hsa_shut_down if
the hsa_init failed.

Differential Revision: https://reviews.llvm.org/D142145
2023-01-20 13:17:32 +01:00
Tobias Gysi
d148f8d7dd [mlir][llvm] Drop cyclic dependencies during debug metadata import.
This revision fixes the import of LLVM IR to handle debug metadata with
cyclic dependencies. It deletes the elements list of the composite type
if a cyclic dependency is detected. The revision is meant as a band aid
to avoid infinite recursion during the import of cyclic debug metadata.
Long term solutions are currently discussed here:
https://discourse.llvm.org/t/handling-cyclic-dependencies-in-debug-info/67526/4

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D142086
2023-01-20 13:14:29 +01:00
Sven van Haastregt
1495210914 [OpenCL] Always add nounwind attribute for OpenCL
Neither OpenCL nor C++ for OpenCL support exceptions, so add the
`nounwind` attribute unconditionally for those languages.

Differential Revision: https://reviews.llvm.org/D142033
2023-01-20 12:01:22 +00:00
Nikita Popov
06ade34c4b [InstCombine] Add multi-use tests for gep of gep fold (NFC) 2023-01-20 12:46:54 +01:00
Kerry McLaughlin
2e35d684d7 [AArch64][SME2] Add multi-vector multiply-add long intrinsics.
Adds (single, multi & indexed) intrinsics for the following:
 - bfmlal/bfmlsl
 - fmlal/fmlsl
 - smlal/smlsl
 - umlal/umlsl

This patch also extends SelectSMETileSlice to handle scaled vector select offsets.

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: CarolineConcatto

Differential Revision: https://reviews.llvm.org/D142004
2023-01-20 11:33:29 +00:00
Nikita Popov
bf23b4031e [ValueTracking] Take poison-generating metadata into account (PR59888)
In canCreateUndefOrPoison(), take not only poison-generating flags,
but also poison-generating metadata into account. The helpers are
written generically, but I believe the only case that can actually
matter is !range on calls -- !nonnull and !align are only valid on
loads, and those can create undef/poison anyway.

Unfortunately, this negatively impacts logical to bitwise and/or
conversion: For ctpop/ctlz/cttz we always attach !range metadata,
which will now block the transform, because it might introduce
poison. It would be possible to recover this regression by supporting
a ConsiderFlagsAndMetadata=false mode in impliesPoison() and clearing
flags/metadata on visited instructions.

Fixes https://github.com/llvm/llvm-project/issues/59888.

Differential Revision: https://reviews.llvm.org/D142115
2023-01-20 12:18:32 +01:00
Kerry McLaughlin
cfd3a0e04a [AArch64][SME2] Add multi-vector fused multiply-add/subtract intrinsics
Adds intrinsics for the following:
 - fmla (single, multi & indexed)
 - fmls (single, multi & indexed)

NOTE: These intrinsics are still in development and are subject
to future changes.

Reviewed By: CarolineConcatto

Differential Revision: https://reviews.llvm.org/D141946
2023-01-20 11:14:41 +00:00
Guray Ozen
36663626ee [mlir][nvvm] Introduce redux op
Ptx model has `redux.sync` that performs reduction operation on the data from each predicated active thread in the thread group. It only is available sm80+.

This revision adds redux as on op to nvvm dialect.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D142088
2023-01-20 12:14:24 +01:00
Nicholas Guy
02435a50f2 [ReleaseNotes] Add mention of complex number support for ARM and AArch64 backends.
Differential Revision: https://reviews.llvm.org/D142012
2023-01-20 10:57:43 +00:00
Anshil Gandhi
f61ee94470 [InstCombine] Add tests for constant memcpy with select (NFC)
Tests for D136524.
2023-01-20 11:53:25 +01:00
Marco Elver
ed9ef9b4f2 tsan: Consider SI_TIMER signals always asynchronous
POSIX timer can be configured to send any kind of signal, however, it
fundamentally does not make sense to consider a timer a synchronous
signal. Teach TSan that timers are never synchronous.

The tricky bit here is correctly defining compiler-rt's siginfo
replacement, which is a rather complex struct. Extend it in a limited
way that is mostly cross-platform compatible and add offset tests in
sanitizer_platform_limits_posix.cpp.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D142117
2023-01-20 11:47:30 +01:00
Jean Perier
b3bb4dd348 [flang][hlfir] Lower pointer and allocatable sub-part references
The previous patches dealt with allocatable and pointer symbol
and component whole references.
This one deals with the remaining sub-part case where a dereference
must be created before applying the sub-part reference on the target.

With this patch the support to designate allocatable and pointer in
HLFIR is complete, but some use points will need to be updated to
use HLFIR designator lowering (at least allocate/deallocate statement
and whole allocatable assignment).

The partInfo.base had to be turned into an std::optional<hlfir::Entity>
because loads of allocatable/pointers do create a
fir::FortranVariableOpInterface (there is no need to). The optional part
comes from the fact that the partInfo.base is not set when creating the
partInfo, but later when visiting the designator parts.

They are three cases when dereferences must be inserted:
- The pointer/allocatable is a symbol followed by a sub-part that is not
a component ref. This is done in visit(Symbol).
- The pointer/allocatable is a component followed by a sub-part that is
not another component ref. This is done in visit(Component).
- The pointer/allocatable is followed by a component ref. This case is
special since it does not call the above "visit" but instead calls "gen"
to break the visit and generate an hlfir.designate for the component
base (since one hlfir.designate can only represent one Fortran part-ref,
and must be chained to implement a Fortran designator with several part
refs). This is done in visitComponentImpl().

Differential Revision: https://reviews.llvm.org/D142124
2023-01-20 11:31:11 +01:00
Benjamin Kramer
044ed6e09f [bazel] Add missing dependencies for 790f237012 2023-01-20 11:05:29 +01:00
LLVM GN Syncbot
afa8291422 [gn build] Port 0e13ccc69cf2 2023-01-20 09:52:08 +00:00
Florian Hahn
0e13ccc69c
[VPlan] Add initial VPDT test. (NFC) 2023-01-20 09:51:07 +00:00
Nikita Popov
1b4fdf18bc [libomp] Explicitly include <string> header (NFC)
This is required to build against libstdc++ 13. Debug.h uses
std::stoi() from <string> without explicitly including it.
2023-01-20 10:39:27 +01:00
v1nh1shungry
ea4fd668c2 [clang] fix crash on generic lambda with lambda in decltype
Relevant issue: https://github.com/llvm/llvm-project/issues/59771

During the instantiation of a generic lambda, a non-generic lambda in
the trailing `decltype` is a `DeclContext` but not a dependent context,
so we shouldn't call `PerformDependentDiagnostics` on it.

Differential Revision: https://reviews.llvm.org/D140838
2023-01-20 17:11:07 +08:00
Matthias Springer
87e345b1bd [mlir] GreedyPatternRewriteDriver: Add new strict mode option
There are now three options:
* `AnyOp` (previously `false`)
* `ExistingAndNewOps` (previously `true`)
* `ExistingOps`: this one is new.

The last option corresponds to what the `applyOpPatternsAndFold(Operation*, ...)` overload is doing. It is now also supported on the `applyOpPatternsAndFold(ArrayRef<Operation *>, ...)` overload.

Differential Revision: https://reviews.llvm.org/D141904
2023-01-20 10:08:11 +01:00
Timm Bäder
b7894ebf84 [clang][Interp] Initialize remaining InlineDescriptor fields
for local variables. Hoping this will please msan.
2023-01-20 10:04:16 +01:00
Nikita Popov
08ce89d308 [Flang] Explicitly include cstdint (NFC)
This header uses std::int8_t, but does not include cstdint.

This fixes the build against libstc++ 13, where some indirect
header includes have been removed.
2023-01-20 10:03:21 +01:00
Sergey Kachkov
e1a702db2f [GVN] Refactor findDominatingLoad function
Improve findDominatingLoad implementation:
1. Result is saved into gvn::AvailableValue struct
2. Search is done in extended BB (while there is a single predecessor or
   limit is reached)

Differential Revision: https://reviews.llvm.org/D141680
2023-01-20 11:54:11 +03:00
Viktoriia Bakalova
e74f9e7885 [include-mapping] Parse zombie_names.html into a removed symbols map.
Differential Revision: https://reviews.llvm.org/D141855
2023-01-20 08:53:31 +00:00
Kristof Beyls
3557621453 Add security group 2022 transparency report. 2023-01-20 09:49:30 +01:00
Craig Topper
f4fa34c359 Revert "[X86][WIP] Change precision control to FP80 during u64->fp32 conversion on Windows."
This reverts commit 928a1764d6bdf84073c9d85875f45c1716d6ff12.

Committed accidentally
2023-01-20 00:41:14 -08:00
Craig Topper
e62ffd3fd6 [RISCV][TableGen] Use getAllDerivedDefinitions in RISCVTargetDefEmitter to simplify the code. NFC 2023-01-20 00:34:05 -08:00
Craig Topper
928a1764d6 [X86][WIP] Change precision control to FP80 during u64->fp32 conversion on Windows.
This is an alternative to D141074 to fix the problem by adjusting
the precision control dynamically.

This isn't quite complete yet. I want to support fadd with an load
folded into it too. That's the code we will usually generate.

Posting for early review so we can do some testing of this solution.

Differential Revision: https://reviews.llvm.org/D142178
2023-01-20 00:34:05 -08:00
Nicolas Vasilache
790f237012 [mlir][Linalg] Add a structured.pack_transpose transform op
This transform is complementary to the `structured.pack` op which
allows packing a whole op but does not allow transposes on the individual
operands.

`structured.pack_transpose` allows transposing single operands connected to
pack or unpack ops after the fact.

This makes the system overall more composable than e.g. a giant transform
op with all permutation specified at once.

Differential Revision: https://reviews.llvm.org/D142053
2023-01-20 00:30:16 -08:00
Nicolas Vasilache
ff94419a28 [mlir][Linalg] Fix crash in LinalgToStandard
Properly handle `appendMangledType` failure instead of asserting.

Fixes #59986.
2023-01-20 00:17:55 -08:00
Nicolas Vasilache
02fb5aae11 [mlir][Linalg] Add missing test
c3f0efe753e27105b519ae9283796d41fe574741 lacked a test, added here.
2023-01-20 00:16:33 -08:00
Kadir Cetinkaya
2133e8b9f9
[clangd] Fix shared lib builds 2023-01-20 08:57:21 +01:00
Uday Bondhugula
6b2e29c508 NFC. Refactor affine fusion code for readability
Replace a couple of check instances with llvm::any_of (clang-tidy
warnings).  Factor out "canCreatePrivateMemRef" and
"performFusionsIntoDest" into separate methods to reduce the
length/indent of the containing methods. Add doc comments and debug messages.

Mark some of the methods that should have been const const.

NFC.

Reviewed By: vinayaka-polymage

Differential Revision: https://reviews.llvm.org/D142076
2023-01-20 13:17:10 +05:30
Nicolas Vasilache
c3f0efe753 [mlir][Linalg] Fix crash in LinalgToStandard
Use rewriter.notifyMatchFailure instead of assert.

Fixes #59986.
2023-01-19 23:29:19 -08:00
LLVM GN Syncbot
6ab938cddc [gn build] Port 21f4232dd963 2023-01-20 06:58:57 +00:00
Nikolas Klauser
21f4232dd9 [libc++] Enable segmented iterator optimizations for join_view::iterator
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D138413
2023-01-20 07:55:58 +01:00
Kazu Hirata
dddcf3014a [ADT,Support] Include compiler.h
This restores builds with gcc-9, which does not have __has_builtin.
2023-01-19 22:49:31 -08:00
Lang Hames
3507df9c20 [ORC][ORC-RT] Add support for callback-based lookup of JIT'd MachO unwind info.
In LLVM the MachOPlatform class is modified to identify unwind info sections
and the address ranges of the functions these sections cover. These address
ranges are then communicated to the ORC runtime by attaching them to the
register-object-platform-sections allocation action.

In the ORC runtime the unwind-info section addresses are recorded and used to
support lookup of unwind info via the new `findDynamicUnwindSections` function.
At bootstrap time the ORC runtime checks for the presence of new
unwind-info-lookup-registration functions in libunwind (see
https://reviews.llvm.org/D142176), and if available uses them to register the
`findDynamicUnwindSections` function with libunwind to enable callback-based
lookup. If the new unwind-info-lookup-registration functions are not available
then the ORC runtime falls back to using the existing libunwind registration
APIs.

The callback-based scheme is intended to address three shortcomings in the
current registration scheme for JIT'd unwind info on Darwin: (1) Lack of
compact-unwind support, (2) inability to describe the subarchitecture of JIT'd
frames, and (3) lack of efficient address-based lookup data structures in
libunwind.

For more details see the proposed libunwind changes in
https://reviews.llvm.org/D142176.
2023-01-19 22:37:57 -08:00
Nikolas Klauser
79b917b6e8 [libc++] Mark LWG3349 as complete 2023-01-20 07:06:50 +01:00