platform/upstream/llvm.git
21 months ago[NFC][DWARFLinker] Refactor address emitting code.
Alexey Lapshin [Fri, 20 Jan 2023 15:48:13 +0000 (16:48 +0100)]
[NFC][DWARFLinker] Refactor address emitting code.

As a preparation for implementing DWARFv5 address ranges generation,
this patch refactors existing address ranges generation code:
Split emitUnitRangesEntries into two functions emitDwarfDebugArangesTable
and emitDwarfDebugRangesTableFragment. Use AddressRanges to prepare linked
address ranges. Refactor Unit.getLowPc(), to use std::nullopt as undefined value.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D141943

21 months ago[NFC]Fix github identification.
Alexey Bataev [Fri, 20 Jan 2023 16:40:00 +0000 (08:40 -0800)]
[NFC]Fix github identification.

21 months ago[libc++][format] range-default-formatter for set.
Mark de Wever [Thu, 5 May 2022 16:57:32 +0000 (18:57 +0200)]
[libc++][format] range-default-formatter for set.

Implements the range-default-formatter specialization range_format::set.

Implements parts of
- P2286R8 Formatting Ranges
- P2585R0 Improving default container formatting

Depends on D140801

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D141195

21 months agoRecommit "[LoopUnroll] Directly update DT instead of DTU."
Florian Hahn [Fri, 20 Jan 2023 16:33:39 +0000 (16:33 +0000)]
Recommit "[LoopUnroll] Directly update DT instead of DTU."

This reverts commit c5ea42bcf48c8f3d3e35a6bff620b06d2a499108.

Recommit the patch with a fix for loops where the exiting terminator is
not a branch instruction. In that case, ExitInfos may be empty. In
addition to checking if there's a single exiting block also check if
there's a single ExitInfo.

A test case has been added in f92b35392ed8e4631.

21 months ago[mlir] use stable_sort for OperationLegalizer::computeOpLegalizationDepth
Xiang Li [Thu, 19 Jan 2023 14:23:30 +0000 (09:23 -0500)]
[mlir] use stable_sort for OperationLegalizer::computeOpLegalizationDepth

For https://github.com/llvm/llvm-project/issues/60070.
llvm::array_pod_sort will cause non-determinism when select pattern.
It is exposed by difference between windows build and linux build.

Differential Revision: https://reviews.llvm.org/D142110

21 months agoAdd support for clang-cl's option `-fexcess-precision`.
Zahira Ammarguellat [Tue, 17 Jan 2023 14:02:35 +0000 (09:02 -0500)]
Add support for clang-cl's option `-fexcess-precision`.

This option is useful for clang and clang-cl.

Differential Revision: https://reviews.llvm.org/D141929

21 months ago[RISCV][LSR] Precommit test coverage for an upcoming change
Philip Reames [Fri, 20 Jan 2023 16:19:04 +0000 (08:19 -0800)]
[RISCV][LSR] Precommit test coverage for an upcoming change

Main point of these is to show the difference between a loop with and without a use outside the loop.

21 months agoFix unused variable warning.
Johannes Reifferscheid [Fri, 20 Jan 2023 16:20:12 +0000 (17:20 +0100)]
Fix unused variable warning.

21 months ago[NFC] Reformat isBuiltinSupported with early exit
serge-sans-paille [Fri, 20 Jan 2023 10:33:25 +0000 (11:33 +0100)]
[NFC] Reformat isBuiltinSupported with early exit

21 months ago[modules] Allow parsing a duplicate Obj-C interface if a previous one comes from...
Volodymyr Sapsai [Wed, 14 Dec 2022 05:25:47 +0000 (21:25 -0800)]
[modules] Allow parsing a duplicate Obj-C interface if a previous one comes from a hidden [sub]module.

Instead of emitting a redefinition error, check that definitions are
equivalent and allow such scenario.

A few non-obvious implementation details:
* to avoid multiple definitions in the redeclaration chain we just drop
  the new definition after checking for equivalence;
* for checking definition equivalence use ODR hash instead of
  ASTStructuralEquivalence because it avoids excessive recursive
  deserialization. Though after detecting a mismatch we do deserialize
  multiple entities to provide a better error message.

rdar://82908223

Differential Revision: https://reviews.llvm.org/D124286

21 months ago[ODRHash] Hash `ObjCInterfaceDecl` and diagnose discovered mismatches.
Volodymyr Sapsai [Fri, 9 Dec 2022 02:35:07 +0000 (18:35 -0800)]
[ODRHash] Hash `ObjCInterfaceDecl` and diagnose discovered mismatches.

When two modules contain interfaces with the same name, check the
definitions are equivalent and diagnose if they are not.

Differential Revision: https://reviews.llvm.org/D140073

21 months ago[Bitcode] Fix invalid !nonnull metadata in test (NFC)
Nikita Popov [Fri, 20 Jan 2023 16:12:13 +0000 (17:12 +0100)]
[Bitcode] Fix invalid !nonnull metadata in test (NFC)

21 months ago[libc++] Move iota_view::iterator and sentinel out of iota_view
Nikolas Klauser [Sun, 4 Dec 2022 15:13:53 +0000 (16:13 +0100)]
[libc++] Move iota_view::iterator and sentinel out of iota_view

This makes it a lot easier to specialize traits types for it, like __segmented_iterator_traits.

Reviewed By: var-const, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D141454

21 months ago[libc++] Enable clang-tidy from the buildkite pipeline instead of hard-coding it...
Nikolas Klauser [Mon, 9 Jan 2023 16:45:45 +0000 (17:45 +0100)]
[libc++] Enable clang-tidy from the buildkite pipeline instead of hard-coding it in run-buildbot

Reviewed By: ldionne, #libc, Mordante, emaste

Spies: emaste, Mordante, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D141294

21 months ago[InstCombine] Fixup check lines in test (NFC)
Nikita Popov [Fri, 20 Jan 2023 16:08:24 +0000 (17:08 +0100)]
[InstCombine] Fixup check lines in test (NFC)

These were broken by dfb0581bfa7b5fb9061876bd1b9af814408aaf95.

21 months ago[LoopUnroll] Add test case exposing crash with d0907ce7ed9f.
Florian Hahn [Fri, 20 Jan 2023 16:08:25 +0000 (16:08 +0000)]
[LoopUnroll] Add test case exposing crash with d0907ce7ed9f.

21 months ago[mlir] fix python types
Alex Zinenko [Fri, 20 Jan 2023 16:02:31 +0000 (16:02 +0000)]
[mlir] fix python types

21 months ago[Assignment Tracking] Fix tests for buildbot failure (2)
OCHyams [Fri, 20 Jan 2023 15:43:27 +0000 (15:43 +0000)]
[Assignment Tracking] Fix tests for buildbot failure (2)

Follow-up for 4ece50737d5385fb80cfa23f5297d1111f8eed39 (D142027).

Assignment Tracking Analysis now always runs and is skipped internally if
assignment tracking is disabled. Update these tests to expect to see the
pass run.

Buildbot failure: https://lab.llvm.org/buildbot/#/builders/57/builds/24094

21 months agoFix !nonnull syntax in test [NFC]
Nuno Lopes [Fri, 20 Jan 2023 15:57:58 +0000 (15:57 +0000)]
Fix !nonnull syntax in test [NFC]

21 months ago[lldb][test] Skip TestRerunAndExprDylib on Ubuntu 18.04
Dave Lee [Thu, 19 Jan 2023 18:38:21 +0000 (10:38 -0800)]
[lldb][test] Skip TestRerunAndExprDylib on Ubuntu 18.04

Disable this test on Ubuntu 18.04, where it fails for yet to be determined reasons.

Differential Revision: https://reviews.llvm.org/D142141

21 months ago[OpenMP] Only test kmp_atomic_float10_max_min.c on X86
Shilei Tian [Fri, 20 Jan 2023 15:52:47 +0000 (10:52 -0500)]
[OpenMP] Only test kmp_atomic_float10_max_min.c on X86

The test `openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c` uses a compiler
flag `-mlong-double-80` that might not be supported by all targets. Currently it
requires `x86-registered-target`, but that requirement can be true when LLVM
supports X86 while the actual `libomp` arch is not X86. For example, when LLVM
is built on AArch64 with all targets enabled, `x86-registered-target` can be met.
If `libomp` is built with native target, aka. AArch64, the test will still be enabled,
causing test failure.

This patch only enables the test if the actual target is X86. The actual target
is determined by `LIBOMP_ARCH`.

Fix #53696.

Reviewed By: jlpeyton

Differential Revision: https://reviews.llvm.org/D142172

21 months ago[MLIR] Remove scf.if builder with explicit result types and callbacks
Frederik Gossen [Fri, 20 Jan 2023 15:51:16 +0000 (10:51 -0500)]
[MLIR] Remove scf.if builder with explicit result types and callbacks

Instead, use the builder and infer the return type based on the inner `yield` ops.
Also, fix uses that do not create the terminator as required for the callback builders.

Differential Revision: https://reviews.llvm.org/D142056

21 months ago[Mem2Reg] Only convert !nonnull to assume if !noundef present
Nikita Popov [Thu, 12 Jan 2023 13:57:34 +0000 (14:57 +0100)]
[Mem2Reg] Only convert !nonnull to assume if !noundef present

After D141386 !nonnull violation returns poison rather than
resulting in immediate undefined behavior. However, converting
it into an assume would result in IUB. As such, we can only
perform this transform if !noundef is also present.

21 months ago[MLIR] Address post-submit comments on scf.if's InferTypeOpInterface
Frederik Gossen [Fri, 20 Jan 2023 15:36:40 +0000 (10:36 -0500)]
[MLIR] Address post-submit comments on scf.if's InferTypeOpInterface

Differential Revision: https://reviews.llvm.org/D142155

21 months ago[DWARF][dsymutil][llvm-dwarfutil] Create a placeholder library DWARFLinkerParallel.
Alexey Lapshin [Fri, 20 Jan 2023 14:43:11 +0000 (15:43 +0100)]
[DWARF][dsymutil][llvm-dwarfutil] Create a placeholder library DWARFLinkerParallel.

This patch is extracted from D96035. It creates an empty library DWARFLinkerParallel.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D140787

21 months ago[mlir][LLVM] Add passthrough import support
Christian Ulmann [Fri, 20 Jan 2023 15:28:56 +0000 (16:28 +0100)]
[mlir][LLVM] Add passthrough import support

This commit extends the LLVMIR import to support function attributes by
adding them to the passthrough array attribute.

Depends on D142013

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D142098

21 months ago[MLIR][LLVM] Support inlining LLVM::CallOp to LLVM::FuncOp.
Johannes de Fine Licht [Fri, 20 Jan 2023 15:13:48 +0000 (16:13 +0100)]
[MLIR][LLVM] Support inlining LLVM::CallOp to LLVM::FuncOp.

Extend `LLVMInlinerInterface` to handle calls from an `LLVM::CallOp` to
an `LLVM::FuncOp` when there are no attributes present that require
special handling.

Depends on D141676

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D141682

21 months ago[clang][nfc] refactor Module::Header to use OptionalFileEntryRef
Richard Howell [Wed, 18 Jan 2023 22:58:15 +0000 (14:58 -0800)]
[clang][nfc] refactor Module::Header to use OptionalFileEntryRef

Refactor the `Module::Header` class to use an `OptionalFileEntryRef`
instead of a `FileEntry*`. This is preparation for refactoring the
`TopHeaderNames` to use `FileEntryRef` so that we preserve the
lookup path of the headers when serializing.

This is mostly based on https://reviews.llvm.org/D90497

Reviewed By: jansvoboda11

Differential Revision: https://reviews.llvm.org/D142113

21 months agosanmd: refine selection of functions for UAR checking
Dmitry Vyukov [Fri, 20 Jan 2023 09:26:20 +0000 (10:26 +0100)]
sanmd: refine selection of functions for UAR checking

There are no intrinsic functions that leak arguments.
If the called function does not return, the current function
does not return as well, so no possibility of use-after-return.
Sanitizer function also don't leak or don't return.
It's safe to both pass pointers to local variables to them
and to tail-call them.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D142190

21 months ago[Assignment Tracking] Fix tests for buildbot failure
OCHyams [Fri, 20 Jan 2023 15:16:39 +0000 (15:16 +0000)]
[Assignment Tracking] Fix tests for buildbot failure

Follow-up for 4ece50737d5385fb80cfa23f5297d1111f8eed39 (D142027).

Assignment Tracking Analysis now always runs and is skipped internally if
assignment tracking is disabled. Update these tests to expect to see the
pass run.

Buildbot failure: https://lab.llvm.org/buildbot/#/builders/216/builds/16085

21 months ago[flang] Add lowering of move_alloc to IntrinsicCall
David Truby [Fri, 20 Jan 2023 14:32:14 +0000 (14:32 +0000)]
[flang] Add lowering of move_alloc to IntrinsicCall

This patch relies on D141286 for the runtime implementation of
move_alloc.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D141616

21 months ago[mlir][Linalg] fix comparison of integers with different signs
Tom Eccles [Fri, 20 Jan 2023 12:14:10 +0000 (12:14 +0000)]
[mlir][Linalg] fix comparison of integers with different signs

Since https://reviews.llvm.org/D142053, building mlir with clang using -Werror
fails reporting comparison of integers with different signs.

Fix this by using unsigned return types for
RelayoutOp::getSourceRank,getDestRank

Differential Revision: https://reviews.llvm.org/D142201

21 months ago[mlgo] Stream the training data
Mircea Trofin [Fri, 20 Jan 2023 01:37:08 +0000 (17:37 -0800)]
[mlgo] Stream the training data

This leverages the new logging format in that we don't need to buffer
the training data, we can just write it out.

Differential Revision: https://reviews.llvm.org/D142168

21 months ago[DAG] visitINSERT_VECTOR_ELT - move mergeInsertEltWithShuffle / combineInsertEltToShu...
Simon Pilgrim [Fri, 20 Jan 2023 14:25:55 +0000 (14:25 +0000)]
[DAG] visitINSERT_VECTOR_ELT - move mergeInsertEltWithShuffle / combineInsertEltToShuffle folds after canonicalization

Noticed while triaging D127115 regressions - there's no need to attempt these costly folds until after the easy canonicalization cases have been addressed

21 months ago[DirectX] Fix i8 alignment in datalayout of lit test
Jannik Silvanus [Fri, 20 Jan 2023 14:40:49 +0000 (15:40 +0100)]
[DirectX] Fix i8 alignment in datalayout of lit test

An llc lit test used overaligned i8, apparently originating from the old DXIL data layout.
The new DXIL data layout uses naturally aligned i8.

llc ignores the data layout of a module and instead sets the data layout based
on the target. Change the data layout string in the test to match that target-derived
data layout.

21 months ago[Transforms] Fix i8 alignment in datalayout of lit test
Jannik Silvanus [Fri, 20 Jan 2023 14:38:28 +0000 (15:38 +0100)]
[Transforms] Fix i8 alignment in datalayout of lit test

A lit test used overaligned i8, apparently due to an old copy-paste
error, intending to specify i16 alignment.

Change the datalayout string to use naturally aligned i8.

21 months ago[X86] Fix i8 alignment in datalayout of lit test
Jannik Silvanus [Fri, 20 Jan 2023 14:37:25 +0000 (15:37 +0100)]
[X86] Fix i8 alignment in datalayout of lit test

A lit test used overaligned i8, apparently due to an old copy-paste
error, intending to specify i32 alignment.

Change the datalayout string to use naturally aligned i8.

21 months ago[polly] Fix i8 alignment in datalayout of lit test
Jannik Silvanus [Fri, 20 Jan 2023 14:36:13 +0000 (15:36 +0100)]
[polly] Fix i8 alignment in datalayout of lit test

Two lit test used overaligned i8, without the test case actually
depending on i8 alignment.
Change the datalayout string to use naturally aligned i8,
preparing for the upcoming requirement of naturally aligned i8.

21 months ago[docs] Update release notes to mention that LoongArch supports JITLink
wanglei [Fri, 20 Jan 2023 14:49:23 +0000 (22:49 +0800)]
[docs] Update release notes to mention that LoongArch supports JITLink

21 months ago[DebugInfo] Store instr-ref mode of MachineFunction in member
Jeremy Morse [Fri, 20 Jan 2023 14:14:39 +0000 (14:14 +0000)]
[DebugInfo] Store instr-ref mode of MachineFunction in member

Add a flag state (and a MIR key) to MachineFunctions indicating whether they
contain instruction referencing debug-info or not. Whether DBG_VALUEs or
DBG_INSTR_REFs are used needs to be determined by LiveDebugValues at least, and
using the current optimisation level as a proxy is proving unreliable.

Test updates are purely adding the flag to tests, in a couple of cases it
involves separating out VarLocBasedLDV/InstrRefBasedLDV tests into separate
files, as they can no longer share the same input.

Differential Revision: https://reviews.llvm.org/D141387

21 months ago[LLVM][OpenMP] Correct the function signature of `__kmpc_parallel_level`
Shilei Tian [Fri, 20 Jan 2023 14:46:24 +0000 (09:46 -0500)]
[LLVM][OpenMP] Correct the function signature of `__kmpc_parallel_level`

`__kmpc_parallel_level` used to be a function w/o any argument, but in the new
device runtime, it accepts two. This patch simply corrects it in `OMPKinds.def`.
```
uint16_t __kmpc_parallel_level(IdentTy *Loc, uint32_t);
```

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D141655

21 months ago[Mem2Reg] Add additional noundef variations to nonnull tests (NFC)
Nikita Popov [Fri, 20 Jan 2023 14:39:00 +0000 (15:39 +0100)]
[Mem2Reg] Add additional noundef variations to nonnull tests (NFC)

21 months ago[Assignment Tracking] Fix -fexperimental-assignment-tracking cc1 flag
OCHyams [Fri, 20 Jan 2023 14:30:58 +0000 (14:30 +0000)]
[Assignment Tracking] Fix -fexperimental-assignment-tracking cc1 flag

This change allows `-fexperimental-assignment-tracking` to be negated using the
negative equivalent `-fno-experimental-assignment-tracking`, and fixes the flag
so that the default behaviour can be changed (currently the default is still
false / disabled).

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D142029

21 months ago[ARM] Fix condition in cmov to csinc combine.
David Green [Fri, 20 Jan 2023 14:35:23 +0000 (14:35 +0000)]
[ARM] Fix condition in cmov to csinc combine.

This fixes the cmov fold from 90f24bef47227d58f2ccdcc481ca22eff32248ca,
where the condition needs to be inverted between the cmov and the csinc.

21 months ago[Assignment Tracking] Fix invalidated iterator usage
OCHyams [Fri, 20 Jan 2023 14:24:57 +0000 (14:24 +0000)]
[Assignment Tracking] Fix invalidated iterator usage

The iterator `FirstOverlap` is invalidated after the call to `insert` - avoid
dereferencing the iterator after the call to `insert`.

Reviewed By: CarlosAlbertoEnciso

Differential Revision: https://reviews.llvm.org/D141854

21 months ago[Local] Preserve range metadata if the type did not change
Nikita Popov [Fri, 20 Jan 2023 14:27:19 +0000 (15:27 +0100)]
[Local] Preserve range metadata if the type did not change

In copyRangeMetadata() and by extension copyLoadMetadata(),
handle the trivial case where the type did not change, in which
case we can simply preserve the range metadata as is.

21 months ago[Assignment Tracking][NFC] Replace LLVM command line option with a module flag
OCHyams [Fri, 20 Jan 2023 14:19:14 +0000 (14:19 +0000)]
[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

21 months ago[SROA] Use copyMetadataForLoad() helper
Nikita Popov [Thu, 19 Jan 2023 16:04:06 +0000 (17:04 +0100)]
[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.

21 months ago[arith] Allow integer casts of 0-D vectors
Benjamin Kramer [Thu, 19 Jan 2023 17:44:31 +0000 (18:44 +0100)]
[arith] Allow integer casts of 0-D vectors

This just works, no reason to disallow it.

Differential Revision: https://reviews.llvm.org/D142137

21 months ago[clang] Fix typos in member initializers
Kadir Cetinkaya [Fri, 20 Jan 2023 08:43:48 +0000 (09:43 +0100)]
[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

21 months ago[SROA] Add additional metadata preservation tests (NFC)
Nikita Popov [Fri, 20 Jan 2023 14:07:18 +0000 (15:07 +0100)]
[SROA] Add additional metadata preservation tests (NFC)

21 months ago[clang] Use FP options from AST for emitting code for casts
Serge Pavlov [Tue, 17 Jan 2023 14:38:00 +0000 (21:38 +0700)]
[clang] Use FP options from AST for emitting code for casts

Differential Revision: https://reviews.llvm.org/D142001

21 months ago[clang-format] SortUsingDeclarations support lexicographic order
Backl1ght [Fri, 20 Jan 2023 12:22:51 +0000 (20:22 +0800)]
[clang-format] SortUsingDeclarations support lexicographic order

fix https://github.com/llvm/llvm-project/issues/59930

Differential Revision: https://reviews.llvm.org/D141694

21 months ago[Assignment Tracking] Update test to use opaque pointers
OCHyams [Fri, 20 Jan 2023 13:07:12 +0000 (13:07 +0000)]
[Assignment Tracking] Update test to use opaque pointers

21 months ago[NFC] Precommit tests
Samuel Parker [Fri, 20 Jan 2023 13:17:12 +0000 (13:17 +0000)]
[NFC] Precommit tests

For (trunc (fp-to-int)).

21 months ago[flang][hlfir] Enable allocate, deallocate, pointer assignment lowering
Jean Perier [Fri, 20 Jan 2023 13:05:42 +0000 (14:05 +0100)]
[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

21 months ago[AArch64][SME2] Add LLVM IR intrinsics for the vertical dot products
David Sherwood [Wed, 18 Jan 2023 09:02:15 +0000 (09:02 +0000)]
[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

21 months ago[mlir] Introduce a pattern to lower `gpu.subgroup_reduce` to `nvvm.redux_op`
Guray Ozen [Fri, 20 Jan 2023 11:44:03 +0000 (12:44 +0100)]
[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

21 months ago[mlir][Linalg] Fix ignoring nodiscard return value
Tom Eccles [Fri, 20 Jan 2023 12:51:11 +0000 (04:51 -0800)]
[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

21 months ago[OpenMP][libomptarget] Fix deinit of NextGen AMDGPU plugin
Kevin Sala [Thu, 19 Jan 2023 18:47:57 +0000 (19:47 +0100)]
[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

21 months ago[mlir][llvm] Drop cyclic dependencies during debug metadata import.
Tobias Gysi [Fri, 20 Jan 2023 12:03:36 +0000 (13:03 +0100)]
[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

21 months ago[OpenCL] Always add nounwind attribute for OpenCL
Sven van Haastregt [Thu, 19 Jan 2023 13:42:43 +0000 (13:42 +0000)]
[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

21 months ago[InstCombine] Add multi-use tests for gep of gep fold (NFC)
Nikita Popov [Fri, 20 Jan 2023 11:46:31 +0000 (12:46 +0100)]
[InstCombine] Add multi-use tests for gep of gep fold (NFC)

21 months ago[AArch64][SME2] Add multi-vector multiply-add long intrinsics.
Kerry McLaughlin [Fri, 20 Jan 2023 11:17:17 +0000 (11:17 +0000)]
[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

21 months ago[ValueTracking] Take poison-generating metadata into account (PR59888)
Nikita Popov [Thu, 19 Jan 2023 14:34:35 +0000 (15:34 +0100)]
[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

21 months ago[AArch64][SME2] Add multi-vector fused multiply-add/subtract intrinsics
Kerry McLaughlin [Fri, 20 Jan 2023 10:44:39 +0000 (10:44 +0000)]
[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

21 months ago[mlir][nvvm] Introduce redux op
Guray Ozen [Thu, 19 Jan 2023 09:09:02 +0000 (10:09 +0100)]
[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

21 months ago[ReleaseNotes] Add mention of complex number support for ARM and AArch64 backends.
Nicholas Guy [Wed, 18 Jan 2023 14:03:56 +0000 (14:03 +0000)]
[ReleaseNotes] Add mention of complex number support for ARM and AArch64 backends.

Differential Revision: https://reviews.llvm.org/D142012

21 months ago[InstCombine] Add tests for constant memcpy with select (NFC)
Anshil Gandhi [Fri, 20 Jan 2023 10:52:17 +0000 (11:52 +0100)]
[InstCombine] Add tests for constant memcpy with select (NFC)

Tests for D136524.

21 months agotsan: Consider SI_TIMER signals always asynchronous
Marco Elver [Fri, 20 Jan 2023 09:20:41 +0000 (10:20 +0100)]
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

21 months ago[flang][hlfir] Lower pointer and allocatable sub-part references
Jean Perier [Fri, 20 Jan 2023 10:30:39 +0000 (11:30 +0100)]
[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

21 months ago[bazel] Add missing dependencies for 790f237012
Benjamin Kramer [Fri, 20 Jan 2023 10:05:29 +0000 (11:05 +0100)]
[bazel] Add missing dependencies for 790f237012

21 months ago[gn build] Port 0e13ccc69cf2
LLVM GN Syncbot [Fri, 20 Jan 2023 09:52:08 +0000 (09:52 +0000)]
[gn build] Port 0e13ccc69cf2

21 months ago[VPlan] Add initial VPDT test. (NFC)
Florian Hahn [Fri, 20 Jan 2023 09:51:06 +0000 (09:51 +0000)]
[VPlan] Add initial VPDT test. (NFC)

21 months ago[libomp] Explicitly include <string> header (NFC)
Nikita Popov [Fri, 20 Jan 2023 09:11:01 +0000 (10:11 +0100)]
[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.

21 months ago[clang] fix crash on generic lambda with lambda in decltype
v1nh1shungry [Mon, 2 Jan 2023 05:13:38 +0000 (13:13 +0800)]
[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

21 months ago[mlir] GreedyPatternRewriteDriver: Add new strict mode option
Matthias Springer [Fri, 20 Jan 2023 09:01:27 +0000 (10:01 +0100)]
[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

21 months ago[clang][Interp] Initialize remaining InlineDescriptor fields
Timm Bäder [Fri, 20 Jan 2023 08:09:55 +0000 (09:09 +0100)]
[clang][Interp] Initialize remaining InlineDescriptor fields

for local variables. Hoping this will please msan.

21 months ago[Flang] Explicitly include cstdint (NFC)
Nikita Popov [Thu, 19 Jan 2023 13:28:58 +0000 (14:28 +0100)]
[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.

21 months ago[GVN] Refactor findDominatingLoad function
Sergey Kachkov [Fri, 13 Jan 2023 13:02:21 +0000 (16:02 +0300)]
[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

21 months ago[include-mapping] Parse zombie_names.html into a removed symbols map.
Viktoriia Bakalova [Mon, 16 Jan 2023 16:17:47 +0000 (16:17 +0000)]
[include-mapping] Parse zombie_names.html into a removed symbols map.

Differential Revision: https://reviews.llvm.org/D141855

21 months agoAdd security group 2022 transparency report.
Kristof Beyls [Fri, 20 Jan 2023 08:49:16 +0000 (09:49 +0100)]
Add security group 2022 transparency report.

21 months agoRevert "[X86][WIP] Change precision control to FP80 during u64->fp32 conversion on...
Craig Topper [Fri, 20 Jan 2023 08:41:14 +0000 (00:41 -0800)]
Revert "[X86][WIP] Change precision control to FP80 during u64->fp32 conversion on Windows."

This reverts commit 928a1764d6bdf84073c9d85875f45c1716d6ff12.

Committed accidentally

21 months ago[RISCV][TableGen] Use getAllDerivedDefinitions in RISCVTargetDefEmitter to simplify...
Craig Topper [Fri, 20 Jan 2023 08:20:13 +0000 (00:20 -0800)]
[RISCV][TableGen] Use getAllDerivedDefinitions in RISCVTargetDefEmitter to simplify the code. NFC

21 months ago[X86][WIP] Change precision control to FP80 during u64->fp32 conversion on Windows.
Craig Topper [Fri, 20 Jan 2023 05:34:23 +0000 (21:34 -0800)]
[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

21 months ago[mlir][Linalg] Add a structured.pack_transpose transform op
Nicolas Vasilache [Wed, 18 Jan 2023 20:26:13 +0000 (12:26 -0800)]
[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

21 months ago[mlir][Linalg] Fix crash in LinalgToStandard
Nicolas Vasilache [Fri, 20 Jan 2023 08:06:34 +0000 (00:06 -0800)]
[mlir][Linalg] Fix crash in LinalgToStandard

Properly handle `appendMangledType` failure instead of asserting.

Fixes #59986.

21 months ago[mlir][Linalg] Add missing test
Nicolas Vasilache [Fri, 20 Jan 2023 08:06:34 +0000 (00:06 -0800)]
[mlir][Linalg] Add missing test

c3f0efe753e27105b519ae9283796d41fe574741 lacked a test, added here.

21 months ago[clangd] Fix shared lib builds
Kadir Cetinkaya [Fri, 20 Jan 2023 07:57:08 +0000 (08:57 +0100)]
[clangd] Fix shared lib builds

21 months agoNFC. Refactor affine fusion code for readability
Uday Bondhugula [Fri, 20 Jan 2023 06:53:32 +0000 (12:23 +0530)]
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

21 months ago[mlir][Linalg] Fix crash in LinalgToStandard
Nicolas Vasilache [Fri, 20 Jan 2023 07:29:16 +0000 (23:29 -0800)]
[mlir][Linalg] Fix crash in LinalgToStandard

Use rewriter.notifyMatchFailure instead of assert.

Fixes #59986.

21 months ago[gn build] Port 21f4232dd963
LLVM GN Syncbot [Fri, 20 Jan 2023 06:58:57 +0000 (06:58 +0000)]
[gn build] Port 21f4232dd963

21 months ago[libc++] Enable segmented iterator optimizations for join_view::iterator
Nikolas Klauser [Mon, 21 Nov 2022 11:41:15 +0000 (12:41 +0100)]
[libc++] Enable segmented iterator optimizations for join_view::iterator

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D138413

21 months ago[ADT,Support] Include compiler.h
Kazu Hirata [Fri, 20 Jan 2023 06:49:31 +0000 (22:49 -0800)]
[ADT,Support] Include compiler.h

This restores builds with gcc-9, which does not have __has_builtin.

21 months ago[ORC][ORC-RT] Add support for callback-based lookup of JIT'd MachO unwind info.
Lang Hames [Fri, 20 Jan 2023 05:33:41 +0000 (21:33 -0800)]
[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.

21 months ago[libc++] Mark LWG3349 as complete
Nikolas Klauser [Fri, 20 Jan 2023 06:06:40 +0000 (07:06 +0100)]
[libc++] Mark LWG3349 as complete

21 months agoRevert "[X86] Avoid converting u64 to f32 using x87 on Windows"
Craig Topper [Fri, 20 Jan 2023 05:36:07 +0000 (21:36 -0800)]
Revert "[X86] Avoid converting u64 to f32 using x87 on Windows"

This reverts commit a6e3027db7ebe6863e44bafcfeaacc16bdc88a3f.

Chrome and Halide are both reporting issues with importing builtins.

Maybe the better direction is to manually adjust FPCW for the inline
sequence on Windows.

21 months ago[llvm] Move bit counting functions to bit.h (NFC)
Kazu Hirata [Fri, 20 Jan 2023 05:15:39 +0000 (21:15 -0800)]
[llvm] Move bit counting functions to bit.h (NFC)

This patch provides C++20-style countl_zero, countr_zero, countl_one,
and countr_one in bit.h.  Existing functions like countLeadingZeros
become wrappers around the new functions.

Note that I cannot quite declare countLeadingZeros as:

  template <class T> using countLeadingZeros = countl_zero<T>;

because countl_zero returns int, whereas countLeadingZeros returns
unsigned.

Differential Revision: https://reviews.llvm.org/D142078

21 months ago[gn build] Port b40a3d73dc9c
LLVM GN Syncbot [Fri, 20 Jan 2023 05:06:41 +0000 (05:06 +0000)]
[gn build] Port b40a3d73dc9c

21 months ago[libc++] Remove old CI configurations and update the supported compiler versions
Nikolas Klauser [Tue, 6 Sep 2022 17:01:17 +0000 (19:01 +0200)]
[libc++] Remove old CI configurations and update the supported compiler versions

`_LIBCPP_REMOVE_TRANSITIVE_INCLUDES` doesn't do anything anymore in C++23 mode, so it's now just a duplicate of the C++23 configuration.
Also add new steps to the post-release checklist for updating the supported compilers.

Reviewed By: ldionne, #libc

Spies: arichardson, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D133364