platform/upstream/llvm.git
17 months ago[mlir][linalg] Make Linalg vectorizer lower affine.apply
Andrzej Warzynski [Mon, 23 Jan 2023 19:01:04 +0000 (19:01 +0000)]
[mlir][linalg] Make Linalg vectorizer lower affine.apply

It is possible that the input to the Linalg vectorizer contains
`affine.apply` ops (see the example in [1]). Such operations are not
vectarizable at the moment, but this can be fixed by simply converting
them to arithmetic operations. This is basically what this patch
introduces.

The IR change enabled in this patch could be part of a larger set of
"linalgOp pre-processing" transformations that happens right before
vectorization starts but after we know we can vectorize the op. I am
leaving this as a TODO.

[1] https://github.com/iree-org/iree/issues/10876.

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

17 months ago[clang][Interp][NFC] Print parent class name of methods
Timm Bäder [Thu, 26 Jan 2023 11:47:08 +0000 (12:47 +0100)]
[clang][Interp][NFC] Print parent class name of methods

in Function::dump().

17 months ago[clang][Interp][NFC] Remove an unnecessary isArray() check
Timm Bäder [Tue, 24 Jan 2023 18:58:09 +0000 (19:58 +0100)]
[clang][Interp][NFC] Remove an unnecessary isArray() check

We already do an isPrimitiveArray() check, so no need for the isArray()
check.

17 months ago[JT][CT] Preserve exisiting BPI/BFI during JumpThreading
Evgeniy Brevnov [Fri, 25 Nov 2022 10:29:27 +0000 (17:29 +0700)]
[JT][CT] Preserve exisiting BPI/BFI during JumpThreading

Currently, JT creates and updates local instances of BPI\BFI. As a result global ones have to be invalidated if JT made any changes.
In fact, JT doesn't use any information from BPI/BFI for the sake of the transformation itself. It only creates BPI/BFI to keep them up to date. But since it updates local copies (besides cases when it updates profile metadata) it just waste of time.

Current patch is a rework of D124439. D124439 makes one step and replaces local copies with global ones retrieved through AnalysisPassManager. Here we do one more step and don't create BPI/BFI if the only reason of creation is to keep BPI/BFI up to date. Overall logic is the following. If there is cached BPI/BFI then update it along the transformations. If there is no existing BPI/BFI, then create it only if it is required to update profile metadata.

Please note if BPI/BFI exists on exit from JT (either cached or created) it is always up to date and no reason to invalidate it.

Reviewed By: mkazantsev

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

17 months ago[clang][Interp][NFC] Add GetPtrBasePop opcode
Timm Bäder [Thu, 5 Jan 2023 11:55:29 +0000 (12:55 +0100)]
[clang][Interp][NFC] Add GetPtrBasePop opcode

Change GetPtrBase to *not* pop the base pointer and add a *Pop variant.
This will be used in later patches.

17 months ago[clang][Interp] Implement __builtin_assume
Timm Bäder [Sat, 7 Jan 2023 11:05:05 +0000 (12:05 +0100)]
[clang][Interp] Implement __builtin_assume

Just ignore it.

As part of this, move the Ret and RetVoid implementation to Interp.h, so
they can be shared with InterpBuiltin.cpp.

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

17 months ago[OpenMP] Fix stack overflow for test bug54082.c
Shilei Tian [Fri, 27 Jan 2023 04:45:02 +0000 (23:45 -0500)]
[OpenMP] Fix stack overflow for test bug54082.c

When `N` is 1024, `int result[N][N]` is obviously large stack that Windows cannot support...

Fix #60326.

Reviewed By: jdoerfert

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

17 months ago[lldb][Test][NFC] TestCreateClassTemplateDecl: make variable names more readable
Michael Buch [Fri, 27 Jan 2023 03:25:16 +0000 (03:25 +0000)]
[lldb][Test][NFC] TestCreateClassTemplateDecl: make variable names more readable

Suggested in https://reviews.llvm.org/D140030

17 months ago[lldb][NFC] Build fix: use TemplateParameterInfos public APIs instead of accessing...
Michael Buch [Fri, 27 Jan 2023 03:08:39 +0000 (03:08 +0000)]
[lldb][NFC] Build fix: use TemplateParameterInfos public APIs instead of accessing private members

Fixes build failures caused by a faulty rebase
in `a29e06bbeaad7012ac85b221f1aaba3fe1d5fd35`

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

17 months ago[ReleaseNotes] Add release notes for LLDB/Clang changes to handling of defaulted...
Michael Buch [Thu, 26 Jan 2023 17:52:09 +0000 (17:52 +0000)]
[ReleaseNotes] Add release notes for LLDB/Clang changes to handling of defaulted template arguments

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

17 months ago[lldb] Add support for DW_AT_default_value in template params
Michael Buch [Sun, 15 Jan 2023 03:26:41 +0000 (03:26 +0000)]
[lldb] Add support for DW_AT_default_value in template params

**Summary**

This patch makes LLDB understand the `DW_AT_default_value` on
template argument DIEs. As a result, type summaries will no
longer contain the defaulted template arguments, reducing
noise substantially. E.g.,

Before:
```
(lldb) v nested
(std::vector<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator <char> > > > > >) nested = size=0 {}
```

After:
```
(lldb) v nested
(std::vector<std::vector<std::basic_string<char> > >) nested = size=0 {}
```

See discussion in https://reviews.llvm.org/D140423

**Testing**

* Adjust API tests
* Added unit-test

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

17 months ago[lldb][TypeSystemClang][NFC] Make TemplateParameterInfos members private
Michael Buch [Sat, 17 Dec 2022 17:32:51 +0000 (17:32 +0000)]
[lldb][TypeSystemClang][NFC] Make TemplateParameterInfos members private

This patch makes the members of `TemplateParameterInfos` only accessible
via public APIs. The motivation for this is that
`TemplateParameterInfos` attempts to maintain two vectors in tandem
(`args` for the template arguments and `names` for the corresponding
name). Working with this structure as it's currently designed makes
it easy to run into out-of-bounds accesses later down the line.

This patch proposes to introduce a new
`TemplateParameterInfos::InsertArg` which is the only way to
set the `TemplateArgument` and name of an entry and since we
require both to be specified we maintain the vectors in sync
out-of-the-box.

To avoid adding non-const getters just for unit-tests a new
`TemplateParameterInfosManipulatorForTests` is introduced
that can be used to control internal state from tests.

17 months ago[clang][DebugInfo] Check TemplateArgument::IsDefaulted
Michael Buch [Sat, 21 Jan 2023 01:49:14 +0000 (01:49 +0000)]
[clang][DebugInfo] Check TemplateArgument::IsDefaulted

Since `ClassTemplateSpecializationDecl`s now set the
`TemplateArgument::IsDefaulted` bit, there's no need
to derive it here.

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

17 months ago[clang][TypePrinter] Test TemplateArgument::IsDefaulted when omitting default arguments
Michael Buch [Sun, 15 Jan 2023 03:37:09 +0000 (03:37 +0000)]
[clang][TypePrinter] Test TemplateArgument::IsDefaulted when omitting default arguments

**Summary**

This patch allows clients who can't properly construct
a `ClassTemplateDecl` to still benefit from the `clang::TypePrinter`s
ability to skip printing defaulted template arguments. The
clients simply have to call `TemplateArgument::setIsDefaulted`
in advance.

See discussion in https://reviews.llvm.org/D140423

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

17 months ago[clang][TemplateBase] Add IsDefaulted bit to TemplateArgument
Michael Buch [Sun, 15 Jan 2023 03:36:50 +0000 (03:36 +0000)]
[clang][TemplateBase] Add IsDefaulted bit to TemplateArgument

**Summary**

This patch adds a `IsDefaulted` field to `clang::TemplateArgument`.

To prevent memory footprint increase we still 1 bit from `ArgKind`.

**Changes**

1. `getIsDefaulted`/`setIsDefaulted` to allow clients to communicate
   an argument's defaulted-ness to the TypePrinter
2. The `TemplateArgument` properties description had to be changed
   to make sure we correctly mark the defaulted-ness of arguments
   that came from a deserialized AST (caught by the HLSL test-suite)
3. The `TemplateArgument` constructors now accept a `IsDefaulted`
   parameter to simplify construction from the tablegen description.
   Though if people don't want to clutter the constructors we can
   instead call `setIsDefaulted` from tablegen
4. When `clang::Sema` checks the template arguments against template
   parameters we now call `setIsDefaulted`. This makes sure that
   whenever a specialization decl gets constructed, the defaulted-ness
   of the associated `TemplateArgument`s has already been deduced.
   This preserves the immutability of `TemplateArgumentList`s

**Background**

In LLDB we construct ASTs from debug-info and hand it to clang
to perform actions such as printing/formatting a typenames.
Some debug formats, specifically DWARF, may only encode information
about class template instantiations, losing the structure of the generic
class definition. However, the `clang::TypePrinter` needs a properly
constructed `ClassTemplateDecl` with generic default argument decls
to be able to deduce whether a `ClassTemplateSpecializationDecl` was
instantiatiated with `TemplateArgument`s that correspond to the
defaults. LLDB does know whether a particular template argument was
defaulted, but can't currently tell clang about it.

This patch allows LLDB to set the defaulted-ness of a `TemplateArgument`
and thus benefit more from `clang::TypePrinter`.

See discussion in https://reviews.llvm.org/D140423

**Testing**

* Added unit-test
* LLDB/clang/llvm test-suite passes

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

17 months ago[clang][TypePrinter] Support expression template arguments when checking defaultedness
Michael Buch [Wed, 25 Jan 2023 17:09:06 +0000 (17:09 +0000)]
[clang][TypePrinter] Support expression template arguments when checking defaultedness

This patch adds support for `TemplateArgument`s of kind
`TemplateArgument::Expression` to `clang::isSubstitutedDefaultArgument`.
We do so by evaluating both the `Pattern` and `Arg` expression to an
`APInt`, if we can, and comparing the results.

This will be useful in an upcoming change where
`clang::isSubstitutedDefaultArgument` gets called from `clang::Sema`
where the `TemplateArgument`s are instantiated as expressions (without
being evaluted to `APInt` beforehand).

**Testing**

- Added unit-tests

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

17 months ago[test] Remove unused `unittest2` import from concurrent_base.py
Jordan Rupprecht [Fri, 27 Jan 2023 02:23:23 +0000 (18:23 -0800)]
[test] Remove unused `unittest2` import from concurrent_base.py

17 months ago[X86][ConstraintFP] Model `MXCSR` for function call
Phoebe Wang [Fri, 27 Jan 2023 01:24:57 +0000 (09:24 +0800)]
[X86][ConstraintFP] Model `MXCSR` for function call

This patch is inspired by D111433. It would affect the performance under
strict FP mode. But it preserves the correct rounding behavior accross
function calls.

Fixes #59305

Reviewed By: sepavloff

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

17 months ago[test] Remove unused `unittest2` import
Jordan Rupprecht [Fri, 27 Jan 2023 02:02:16 +0000 (18:02 -0800)]
[test] Remove unused `unittest2` import

17 months ago[clang-format] Disallow templates to be followed by literal
Emilia Dreamer [Fri, 27 Jan 2023 01:56:11 +0000 (03:56 +0200)]
[clang-format] Disallow templates to be followed by literal

There should not be any cases where the angle brackets of template
parameters are directly followed by a literal. It is more likely that a
comparison is taking place instead.

This patch makes the TokenAnnotator prefer to annotate < and > as
operators when directly followed by a literal. A similar check already
exists for literals directly *before* potential template args.

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

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

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

17 months ago[mlir][tensor] Add a tiling interface registration for pack/unpack only.
Hanhan Wang [Wed, 18 Jan 2023 00:44:32 +0000 (16:44 -0800)]
[mlir][tensor] Add a tiling interface registration for pack/unpack only.

Reviewed By: mravishankar

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

17 months ago[NFC] Optimize vector usage in lld
Jez Ng [Fri, 27 Jan 2023 01:28:58 +0000 (20:28 -0500)]
[NFC] Optimize vector usage in lld

By using emplace_back, as well as converting some loops to for-each, we can do more efficient vectorization.

Make copy constructor for TemporaryFile noexcept.

Reviewed By: #lld-macho, int3

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

17 months agotest-release.sh: Use parallel xz for packaging the binaries
Tom Stellard [Thu, 26 Jan 2023 23:18:58 +0000 (15:18 -0800)]
test-release.sh: Use parallel xz for packaging the binaries

Reviewed By: amyk, dim, hans

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

17 months ago[test][lldb-vscode] Fix unclean shutdown in test_terminate_commands
Jordan Rupprecht [Thu, 26 Jan 2023 22:29:48 +0000 (14:29 -0800)]
[test][lldb-vscode] Fix unclean shutdown in test_terminate_commands

This test manually sends `terminateCommands` to shutdown, but then the test attempts another `terminateCommands` request in test tear down, which fails since it's already torn down. This error is ignored in LLDB's old fork of unittest2, but will be reported as a test failure in `unittest` from the Python standard library. Use `disconnectAutomatically` to avoid terminating twice.

17 months ago[bazel] Add missing dependency after 55cf0de35e
Benjamin Kramer [Thu, 26 Jan 2023 22:25:15 +0000 (23:25 +0100)]
[bazel] Add missing dependency after 55cf0de35e

17 months ago[flang] Fixed restrictions checking for OpenACC loop-associated constructs.
Slava Zakharin [Thu, 26 Jan 2023 22:20:47 +0000 (14:20 -0800)]
[flang] Fixed restrictions checking for OpenACC loop-associated constructs.

CheckDoConcurrentClauseRestriction and CheckTileClauseRestriction expect
that the construct has associated DoConstruct, while it is not set
when the do-loop has no loop control. The change is to skip the clauses
checks, when the do-loop does not have the loop control.

An alternative fix would be to associate the DoConstruct even when
the do-loop has no loop control and let Check*ClauseRestriction run their
checks, but I am not sure if associating invalid DoConstruct is a good idea.

This fixes failure in Semantics/OpenACC/acc-canonicalization-validity.f90
reported in D142279.

Reviewed By: clementval

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

17 months ago[flang] Fixed uninitialized std::unique_ptr dereference.
Slava Zakharin [Thu, 26 Jan 2023 22:17:13 +0000 (14:17 -0800)]
[flang] Fixed uninitialized std::unique_ptr dereference.

This fixes unittest failures reported in D142279:
  flang-Unit :: Frontend/./FlangFrontendTests/5/7
  flang-Unit :: Frontend/./FlangFrontendTests/6/7

17 months ago[mlir][Linalg] Adding a greedy packing transform dialect op.
Nicolas Vasilache [Thu, 26 Jan 2023 20:30:54 +0000 (12:30 -0800)]
[mlir][Linalg] Adding a greedy packing transform dialect op.

This PR adds a `pack_greedily` transform operation that infers the packing for gemm
subcomputations embedded within in any LinalgOp and packs accordingly.
A normalization step guarantees that we get the innermost op dimensions in one of `8`
possible `(m, n, k)` orders, specified as a parameter, from which we can emit all
packed forms.

The current implementation takes an arbitrary LinalgOp and tries to pack it along
the specified dimensions with specified sizes and inner dim permutation.

This achieves a new level of normalization and generalization for any `n-D`
LinalgOp that contains a gemm embedded within it:
we will always see a predictable packed form for any of these ops.

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

17 months ago[SYCL] Fix test to conform to SYCL2020
Elizabeth Andrews [Thu, 26 Jan 2023 21:51:56 +0000 (13:51 -0800)]
[SYCL] Fix test to conform to SYCL2020

17 months ago[OpenMP][OMPIRBuilder]Move SIMD alignment calculation to LLVM Frontend
Dominik Adamski [Tue, 17 Jan 2023 09:51:48 +0000 (03:51 -0600)]
[OpenMP][OMPIRBuilder]Move SIMD alignment calculation to LLVM Frontend

Currently default simd alignment is defined by Clang specific TargetInfo class.
This class cannot be reused for LLVM Flang. That's why default simd alignment
calculation has been moved to OMPIRBuilder which is common for Flang and Clang.

Previous attempt: https://reviews.llvm.org/D138496 was wrong because
the default alignment depended on the number of built LLVM targets.

If we wanted to calculate the default alignment for PPC and we hadn't specified
PPC LLVM target to build, then we would get 0 as the alignment because
OMPIRBuilder couldn't create PPCTargetMachine object and it returned 0 as
the default value.

If PPC LLVM target had been built earlier, then OMPIRBuilder could have created
PPCTargetMachine object and it would have returned 128.

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

Reviewed By: jdoerfert

17 months ago[LinkerWrapper] Fix `-Bsymbolic` being sent to the compiler and not the linker
Joseph Huber [Thu, 26 Jan 2023 21:00:24 +0000 (15:00 -0600)]
[LinkerWrapper] Fix `-Bsymbolic` being sent to the compiler and not the linker

Summary:
Clang doesn't warn on `-B` options passed to it. This one is not
forwarded to the linker which results in some tests failing when
offloading to x86_64 with the `bfd` linker.

17 months agoReland: [llvm-cov] Look up object files using debuginfod
Daniel Thornburgh [Mon, 24 Oct 2022 22:35:00 +0000 (15:35 -0700)]
Reland: [llvm-cov] Look up object files using debuginfod

Reviewed By: gulfem

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

17 months ago[RISCV] Add MC support of RISCV Zcb Extension
WuXinlong [Thu, 26 Jan 2023 20:54:00 +0000 (12:54 -0800)]
[RISCV] Add MC support of RISCV Zcb Extension

This patch add the instructions of Zcb extension.

Instructions in zcb extensions shorten part of bit manipulation instructions.

Co-authored-by: Craig Topper <craig.topper@sifive.com>
Reviewed By: craig.topper

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

17 months ago[Support] Remove findFirstSet and findLastSet
Kazu Hirata [Thu, 26 Jan 2023 20:29:48 +0000 (12:29 -0800)]
[Support] Remove findFirstSet and findLastSet

This patch removes findFirstSet and findLastSet as there are no uses
left in LLVM.

I am not aware of any uses of findFirstSet and findLastSet in the
open-source world outside LLVM, so I am skipping the deprecation step.

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

17 months ago[extract_symbols.py] Filter out more symbols for MSVC
Mike Hommey [Thu, 26 Jan 2023 20:28:09 +0000 (21:28 +0100)]
[extract_symbols.py] Filter out more symbols for MSVC

This strips out about 5k symbols.

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

Reviewed By: john.brawn

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

17 months ago[libc++] Add documentation for reproducing CI issues locally
Louis Dionne [Wed, 25 Jan 2023 18:09:39 +0000 (13:09 -0500)]
[libc++] Add documentation for reproducing CI issues locally

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

17 months ago[gn build] Port 36080434a885
LLVM GN Syncbot [Thu, 26 Jan 2023 19:41:53 +0000 (19:41 +0000)]
[gn build] Port 36080434a885

17 months ago[libc++] Move the definition of aligned allocation helpers outside of <new>
Louis Dionne [Fri, 2 Dec 2022 21:45:49 +0000 (13:45 -0800)]
[libc++] Move the definition of aligned allocation helpers outside of <new>

They are not needed in <new> -- in fact they are only needed in .cpp files.
Getting those out of the way makes the headers smaller and also makes it
easier to use the library on platforms where aligned allocation is not
available.

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

17 months ago[CMake] Support undefined LLVM_NATIVE_ARCH in llvm_map_components_to_libnames().
Ivan Kosarev [Thu, 26 Jan 2023 17:44:43 +0000 (17:44 +0000)]
[CMake] Support undefined LLVM_NATIVE_ARCH in llvm_map_components_to_libnames().

https://reviews.llvm.org/D142405 made this function relying on the
LLVM_NATIVE_ARCH be defined, which is not necessarily the case for
third-party projects that include LLVM as their part.

Reviewed By: beanz

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

17 months ago[llvm][docs] Update old metadata syntax in examples
Paul Kirth [Thu, 26 Jan 2023 17:53:19 +0000 (17:53 +0000)]
[llvm][docs] Update old metadata syntax in examples

This patch updates examples in the documentation to match the existing
convention. Calls to intrinsics that have metadata arguments were not
included.

Reviewed By: dexonsmith

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

17 months ago[NVPTX] Do not addrspacecast AS-specific kernel arguments.
Artem Belevich [Wed, 25 Jan 2023 20:12:32 +0000 (12:12 -0800)]
[NVPTX] Do not addrspacecast AS-specific kernel arguments.

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

The assumption that generic pointers passed to a CUDA kernel is CUDA-specific
and should not be applied to non-CUDA compilations.  Addrspacecasts to global AS
and back should never be applied to AS-specific pointers.

In order to make tests actually do the testing for non-CUDA compilation, we need
to get TargetMachine from the TargetPassConfig, instead of passing it explicitly
as a pass constructor argument.

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

17 months ago[OpenMP] Run an extra 'OpenMPOpt' pass in LTO-mode
Joseph Huber [Thu, 26 Jan 2023 17:23:21 +0000 (11:23 -0600)]
[OpenMP] Run an extra 'OpenMPOpt' pass in LTO-mode

The `OpenMPOpt` pass is pivotal to the performance of many OpenMP
offloading programs. When we perform non-LTO builds with OpenMP we used
to link the OpenMP deviceRTL individually for each TU. This lead to us
getting an additional attributor run on the combined runtime and user
code. When we used LTO we lost a run and suffered a large performance
degradation. This patch simply adds in the extra `OpenMPOpt` pass that
we miss into the LTO pipeline. This patch fixes the performance
regression shown in applications that used OpenMP offloading in LTO
mode.

Previously, this wasn't legal to do as we could emit new runtime calls
into the module. That was fixed by D142646.

Depends on D142646

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

Reviewed By: jdoerfert

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

17 months ago[OpenMP] Make OpenMPOpt aware of the OpenMP runtime's status
Joseph Huber [Thu, 26 Jan 2023 17:13:56 +0000 (11:13 -0600)]
[OpenMP] Make OpenMPOpt aware of the OpenMP runtime's status

The `OpenMPOpt` pass contains optimizations that generate new calls into
the OpenMP runtime. This causes problems if we are in a state where the
runtime has already been linked statically. Generating these new calls
will result in them never being resolved. We should indicate if we are
in a "post-link" LTO phase and prevent OpenMPOpt from generating new
runtime calls.

Generally, it's not desireable for passes to maintain state about the
context in which they're called. But this is the only reasonable
solution to static linking when we have a pass that generates new
runtime calls.

Reviewed By: jdoerfert

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

17 months ago__arithmetic_fence enforces ordering on expression evaluation when fast-math
Zahira Ammarguellat [Wed, 25 Jan 2023 22:11:07 +0000 (17:11 -0500)]
__arithmetic_fence enforces ordering on expression evaluation when fast-math
is enabled.
In fast math mode some floating-point optimizations are performed such as
reassociation and distribution.

For example, the compiler may transform (a+b)+c into a+(b+c). Although these
two expressions are equivalent in integer arithmetic, they may not be in
floating-point arithmetic. The builtin tells the compiler that the expression
in parenthesis can’t be re-associated or distributed.
__arithmetic_fence(a+b)+c is not equivalent to a+(b+c).

This patch adds the support of the builtin to SPIR target.

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

17 months ago[NFC][Concepts] Change the Source Range of Concepts ParamMatching
Erich Keane [Thu, 26 Jan 2023 19:11:29 +0000 (11:11 -0800)]
[NFC][Concepts] Change the Source Range of Concepts ParamMatching

As came up in the discussion on
https://reviews.llvm.org/rG12cb1cb3720de8d164196010123ce1a8901d8122

We were asserting because the attempt to print a note found that our
source range for a immediately declared constraint (as a part of
Parameter Mapping Substitution) wasn't in order.

However, it doesn't really make sense to have the location of this be
the whole list of template arguments, as that would result in the range
being:
bool func(std::thing<char*> auto foo) {}
                     ^^^^^^^^^^^^^^^

Even if done correctly.  Instead, this patch makes the range be just
'foo' in this case (or a pointer right after 'auto' if unnamed).

17 months ago[lld] Remove transitional legacy pass manager flags
Arthur Eubanks [Wed, 25 Jan 2023 19:25:35 +0000 (11:25 -0800)]
[lld] Remove transitional legacy pass manager flags

Reviewed By: asbirlea

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

17 months ago[Clang][NFC] Fix out-of-date comments on 'clang-offload-bundler'
Joseph Huber [Thu, 26 Jan 2023 19:02:22 +0000 (13:02 -0600)]
[Clang][NFC] Fix out-of-date comments on 'clang-offload-bundler'

Summary:
These comments are confusing as the `clang-offload-bundler` is no longer
used by these toolchains.

17 months ago[analyzer] Fix crash exposed by D140059
einvbri [Thu, 26 Jan 2023 14:23:22 +0000 (08:23 -0600)]
[analyzer] Fix crash exposed by D140059

Change https://reviews.llvm.org/D140059 exposed the following crash in
Z3Solver, where bit widths were not checked consistently with that
change. This change makes the check consistent, and fixes the crash.

```
clang: <root>/llvm/include/llvm/ADT/APSInt.h:99:
  int64_t llvm::APSInt::getExtValue() const: Assertion
  `isRepresentableByInt64() && "Too many bits for int64_t"' failed.
...
Stack dump:
0. Program arguments: clang -cc1 -internal-isystem <root>/lib/clang/16/include
  -nostdsysteminc -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection
  -analyzer-config crosscheck-with-z3=true -verify reproducer.c

 #0 0x00000000045b3476 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
  <root>/llvm/lib/Support/Unix/Signals.inc:567:22
 #1 0x00000000045b3862 PrintStackTraceSignalHandler(void*)
  <root>/llvm/lib/Support/Unix/Signals.inc:641:1
 #2 0x00000000045b14a5 llvm::sys::RunSignalHandlers()
  <root>/llvm/lib/Support/Signals.cpp:104:20
 #3 0x00000000045b2eb4 SignalHandler(int)
  <root>/llvm/lib/Support/Unix/Signals.inc:412:1
 ...
 #9 0x0000000004be2eb3 llvm::APSInt::getExtValue() const
  <root>/llvm/include/llvm/ADT/APSInt.h:99:5
  <root>/llvm/lib/Support/Z3Solver.cpp:740:53
  clang::ASTContext&, clang::ento::SymExpr const*, llvm::APSInt const&, llvm::APSInt const&, bool)
  <root>/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h:552:61
```

Reviewed By: steakhal

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

17 months ago[InstSimplify] X && !(X || Y) --> false
Sanjay Patel [Thu, 26 Jan 2023 18:03:46 +0000 (13:03 -0500)]
[InstSimplify] X && !(X || Y) --> false

https://alive2.llvm.org/ce/z/7J8Exr

This is a commuted variant that was not included in:
D138853 / f2973327496fc966c4e89597

17 months ago[InstSimplify] add commuted variants of logical and/or pattern; NFC
Sanjay Patel [Thu, 26 Jan 2023 17:30:37 +0000 (12:30 -0500)]
[InstSimplify] add commuted variants of logical and/or pattern; NFC

Existing tests were added with D138853, but that patch failed
to handle all of the commutes. The poison-safety behavior is
symmetric, so I'm not duplicating all of the tests that were
added with that patch.

17 months ago[AMDGPU] Split dot7 feature
Stanislav Mekhanoshin [Wed, 25 Jan 2023 20:07:30 +0000 (12:07 -0800)]
[AMDGPU] Split dot7 feature

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

17 months ago[SystemZ] Add atomicrmw tests for i128 (NFC).
Jonas Paulsson [Thu, 19 Jan 2023 18:46:34 +0000 (12:46 -0600)]
[SystemZ] Add atomicrmw tests for i128 (NFC).

Review: Ulrich Weigand

17 months ago[CMake] Remove libLTO from Fuchsia toolchain
Alex Brachet [Thu, 26 Jan 2023 18:18:21 +0000 (18:18 +0000)]
[CMake] Remove libLTO from Fuchsia toolchain

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

17 months ago[clang-doc] Reduce duplicate code with template
Paul Kirth [Tue, 19 Jul 2022 22:55:41 +0000 (22:55 +0000)]
[clang-doc] Reduce duplicate code with template

Reviewed By: phosek

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

17 months ago[flang] Fix dereference of std::optional with no value
Jay Foad [Thu, 26 Jan 2023 17:27:56 +0000 (17:27 +0000)]
[flang] Fix dereference of std::optional with no value

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

17 months ago[MLIR][NFC] Fix a checked after used case in ReshapeOpsUtils.cpp
Shivam Gupta [Thu, 26 Jan 2023 17:21:44 +0000 (22:51 +0530)]
[MLIR][NFC] Fix a checked after used case in ReshapeOpsUtils.cpp

Found by PVS-Studio - https://pvs-studio.com/en/blog/posts/cpp/1003/, N18.
The value of the 'sourceDim' index is checked after it was used.

Reviewed By: zero9178

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

17 months ago[mlir][vector] Allow transposing multi_reduction when the parallel dim is in the...
Benjamin Kramer [Tue, 24 Jan 2023 17:01:26 +0000 (18:01 +0100)]
[mlir][vector] Allow transposing multi_reduction when the parallel dim is in the middle

The check for the outer lowering wasn't quite right.

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

17 months ago[AArch64][SME2] Add Multi-vector add vector intrinsics
Caroline Concatto [Thu, 26 Jan 2023 16:50:25 +0000 (16:50 +0000)]
[AArch64][SME2] Add Multi-vector add vector intrinsics

Add the following intrinsic:

 ADD vectors

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

Reviewed By: david-arm

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

17 months ago[MISched] Dump the execution trace of the schedule.
Francesco Petrogalli [Mon, 23 Jan 2023 16:35:52 +0000 (17:35 +0100)]
[MISched] Dump the execution trace of the schedule.

The traces are printed only for bottom-up and top-down scheduling
because the values of TopReadyCycle and BottomReadyCycle are
inconsistent when obtained via bidirectional scheduling (see
`BIDIRECTIONAL` checks in the test).

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

17 months ago[mlir][Linalg] Put a proper type on transform.structured.match op
Nicolas Vasilache [Thu, 26 Jan 2023 15:58:59 +0000 (07:58 -0800)]
[mlir][Linalg] Put a proper type on transform.structured.match op

This allows much better verification messages in consuming ops that properly declare
`TransformHandleTypeInterface` on their operands.

Downstream tests can be updated with a command resembling:

```
 git grep -l "structured\.match" mlir/test | xargs -i sed -i {} -e  "s/\(structured.match.*\)/\1 : (\!pdl.operation) -> \!pdl.operation/g"
```

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

17 months ago[unittests] Use GTEST_SKIP() instead of return when appropriate
Paul Robinson [Thu, 26 Jan 2023 15:47:37 +0000 (07:47 -0800)]
[unittests] Use GTEST_SKIP() instead of return when appropriate

Basically NFC: A TEST/TEST_F/etc that bails out early (usually because
setup failed or some other runtime condition wasn't met) generally
should use GTEST_SKIP() to report its status correctly, unless it
takes steps to report another status (e.g., FAIL()).

17 months ago[analyzer] Fix assertion failure in SMT conversion for unary operator on floats
Tomasz Kamiński [Thu, 26 Jan 2023 16:33:48 +0000 (17:33 +0100)]
[analyzer] Fix assertion failure in SMT conversion for unary operator on floats

In the handling of the Symbols from the RangExpr, the code assumed that
the operands of the unary operators need to have integral type.
However, the CSA can create SymExpr with a floating point operand, when
the integer value is cast into it, like `(float)h == (float)l` where
both of `h` and `l` are integers.

This patch handles such situations, by using `fromFloatUnOp()` instead
of `fromUnOp()`, when the operand have a floating point type.

I have investigated all other calls of `fromUnOp()`, and for one in:

 - `getZeroExpr()` is applied only on boolean types, so it correct
 - `fromBinOp()` is not invoked for floating points
 - `fromFloatUnOp()` I am uncertain about this case and I was not able
   to produce a test that would reach this point, as a negation of
   floating points numbers seem to produce `Unknown` symbols.

This issue exists since the introduction of `UnarySymExpr` in D125318
and their handling for Z3 in D125547.

Patch by Tomasz Kamiński.

Reviewed By: mikhail.ramalho

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

17 months agoFix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in...
Arseniy Zaostrovnykh [Thu, 26 Jan 2023 16:19:04 +0000 (17:19 +0100)]
Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions

Builtin functions (such as `std::move`, `std::forward`, `std::as_const`)
have a body generated during the analysis not related to any source file
so their statements have no valid source locations.
`ReturnPtrRange` checker should not report issues for these builtin
functions because they only forward its parameter and do not create any
new pointers.

Fixes #55347

Patch by Arseniy Zaostrovnykh.

Reviewed By: NoQ

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

17 months ago[clang] Fix sizeof of boolean vector
Mariya Podchishchaeva [Thu, 26 Jan 2023 15:43:27 +0000 (10:43 -0500)]
[clang] Fix sizeof of boolean vector

Ensure it is at least 8 bits.

Fixes #59801

Reviewed By: erichkeane

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

17 months ago[SCCP] Regenerate check lines for test.
Florian Hahn [Thu, 26 Jan 2023 15:28:49 +0000 (15:28 +0000)]
[SCCP] Regenerate check lines for test.

The auto-generated check lines for the test are missing `align`.
Re-generate the check lines to avoid unrelated changes in upcoming
change.

17 months ago[SelectionDAG] Add missing setValue calls in visitIntrinsicCall
Martin Fink [Thu, 26 Jan 2023 14:25:58 +0000 (15:25 +0100)]
[SelectionDAG] Add missing setValue calls in visitIntrinsicCall

Add missing setValue calls in SelectionDAGBuilder for mem-transfer
intrinsic calls. These setValue calls are required in order to propagate
pcsections metadata from IR to MIR.

Reviewed By: melver

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

17 months ago[SelectionDAG] Add pcsections recursively on SDNode values
Martin Fink [Thu, 26 Jan 2023 14:25:58 +0000 (15:25 +0100)]
[SelectionDAG] Add pcsections recursively on SDNode values

When adding pcsections to SDNodes, recursively add them to all values of
the node as well.

Reviewed By: melver

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

17 months ago[15/15][Clang][RISCV][NFC] Set data member under Policy as constants
eopXD [Sun, 15 Jan 2023 17:56:23 +0000 (09:56 -0800)]
[15/15][Clang][RISCV][NFC] Set data member under Policy as constants

The object is now correct by construction.

This is the 15th commit of a patch-set that aims to change the default policy
for RVV intrinsics from TAMU to TAMA.

Please refer to the cover letter in the 1st commit (D141573) for an
overview.

Depends on D141793.

Reviewed By: craig.topper

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

17 months agoRe-apply "[OpenMP][Archer] Use dlsym rather than weak symbols for TSan annotations"
Joachim Protze [Thu, 26 Jan 2023 14:31:24 +0000 (15:31 +0100)]
Re-apply "[OpenMP][Archer] Use dlsym rather than weak symbols for TSan annotations"

Explicitly link libdl this time.

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

17 months ago[WebAssembly] Trying to fix expensive buildbot
Samuel Parker [Thu, 26 Jan 2023 14:25:38 +0000 (14:25 +0000)]
[WebAssembly] Trying to fix expensive buildbot

17 months ago[MLIR][LLVM] Support inlining of LLVM::AllocaOp.
Johannes de Fine Licht [Thu, 26 Jan 2023 14:03:41 +0000 (15:03 +0100)]
[MLIR][LLVM] Support inlining of LLVM::AllocaOp.

If inlining into an LLVM function, move allocas of constant size from
the callee's entry block to the new entry block, as this will fold into
the prologue/epilogue code during code generation.

We still allow inlining allocas even if we cannot do this
post-processing (i.e., when we are not inlining into an `LLVM::FuncOp`),
since this is an optimization (and thus not necessary for correctness).

Depends on D141682

Reviewed By: gysit

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

17 months ago[LVI] Use !range metadata for supported intrinsics
Nikita Popov [Thu, 26 Jan 2023 14:09:48 +0000 (15:09 +0100)]
[LVI] Use !range metadata for supported intrinsics

Even if the intrinsic is supported by ConstantRange, we should
still make use of !range metadata. This doesn't matter much now,
but is important if we want to support ctlz style intrinsics,
which always have KnownBits-based !range metadata attached, which
might be better than what we can compute using ranges.

17 months ago[CVP] Add test for !range being ignored on supported intrinsic (NFC)
Nikita Popov [Thu, 26 Jan 2023 14:06:19 +0000 (15:06 +0100)]
[CVP] Add test for !range being ignored on supported intrinsic (NFC)

17 months ago[InstCombine] reduce compare of signbits of 2 values, signed variant
Sanjay Patel [Wed, 25 Jan 2023 21:27:29 +0000 (16:27 -0500)]
[InstCombine] reduce compare of signbits of 2 values, signed variant

(X s>> BitWidth - 1) == sext (Y s> -1) --> (X ^ Y) < 0
(X s>> BitWidth - 1) != sext (Y s> -1) --> (X ^ Y) > -1

This is the same logic as:
7cbfc39c77ca
...extended to deal with "signed" cast+shift instructions.

https://alive2.llvm.org/ce/z/LLidya

17 months ago[InstCombine] improve description of not+shift transform; NFC
Sanjay Patel [Wed, 25 Jan 2023 20:10:41 +0000 (15:10 -0500)]
[InstCombine] improve description of not+shift transform; NFC

This was added recently with:
e44a305690add9f75

17 months ago[InstCombine] add tests for cmp-of-signbits using sext+ashr; NFC
Sanjay Patel [Wed, 25 Jan 2023 20:08:17 +0000 (15:08 -0500)]
[InstCombine] add tests for cmp-of-signbits using sext+ashr; NFC

These are copied from the zext+lshr variants from:
e76c95fb40b108
d1511ed8d19ac

17 months ago[llvm][TableGen][Jupyter] Add notebook links to README
David Spickett [Thu, 26 Jan 2023 13:54:38 +0000 (13:54 +0000)]
[llvm][TableGen][Jupyter] Add notebook links to README

This folder contains the kernel and notebooks
so let's make that obvious and list them in the
readme.

17 months ago[Docs] Add best practices for regression tests
Nikita Popov [Tue, 24 Jan 2023 09:43:40 +0000 (10:43 +0100)]
[Docs] Add best practices for regression tests

There are a lot of conventions for writing tests that don't seem
to be documented anywhere right now, so this takes a stab at
writing down some "best practices".

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

17 months agoRevert "ARM: skip debug instructions when matching jump-table patterns."
Tim Northover [Thu, 26 Jan 2023 13:26:10 +0000 (13:26 +0000)]
Revert "ARM: skip debug instructions when matching jump-table patterns."

This reverts commit ce4fcea59e1d5829b4355b6401d7265be23f617a.

I committed it accidentally.

17 months agoAArch64: remove SM4 support from Apple CPUs.
Tim Northover [Thu, 26 Jan 2023 12:52:59 +0000 (12:52 +0000)]
AArch64: remove SM4 support from Apple CPUs.

The CPUs never supported SM4 instructions, but until recently I think crypto
was folded into the baseline architecture as a monolithic feature so it was
difficult to represent that. Now it's split we can, and the CPUs that support
v8.4 onwards only handle AES, SHA2, SHA3 by way of crypto instructions.

17 months agoARM: skip debug instructions when matching jump-table patterns.
Tim Northover [Wed, 18 Jan 2023 15:12:29 +0000 (15:12 +0000)]
ARM: skip debug instructions when matching jump-table patterns.

When working out whether we can see a compressible jump-table pattern during
ConstantIslands, we were stopping when we saw a debug instruction. Instead it's
better to keep iterating backwards to the first real instruction.

17 months ago[DAGCombine] fp_to_sint isSaturatingMinMax
Samuel Parker [Thu, 26 Jan 2023 11:52:24 +0000 (11:52 +0000)]
[DAGCombine] fp_to_sint isSaturatingMinMax

Check for single smax pattern against zero when converting from a
small enough float.

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

17 months ago[SVE] Move isel for casting between NEON and SVE vector types into tablegen.
Paul Walker [Thu, 26 Jan 2023 12:33:10 +0000 (12:33 +0000)]
[SVE] Move isel for casting between NEON and SVE vector types into tablegen.

This is purely refactoring to remove some unecessary C++ code.

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

17 months ago[LLVM][TableGen] Notebook describing how to write a Python backend
David Spickett [Wed, 14 Dec 2022 13:46:27 +0000 (13:46 +0000)]
[LLVM][TableGen] Notebook describing how to write a Python backend

This tutorial uses the dump json option to write a backend for
SQL queries.

It is based on the work of Min-Yih Hsu:
* https://github.com/mshockwave/SQLGen
* https://www.youtube.com/watch?v=UP-LBRbvI_U

I hope that having the same concepts in 3 forms will allow people
to choose the style that fits them.

The main drawback here being that it's in Python. C++ can be used
in a notebook (https://github.com/jupyter-xeus/xeus-cling) but I
decided against it for a few reasons:

* Python is the default for Jupyter, no extra installs needed.
* Having the code in a second language may help people who
  know one or the other.
* There is no upstream example of a JSON powered backend.
  (and although we would be unlikely to accept one upstream,
  I think it's a great option for quick development before
  translating into C++)

Reviewed By: myhsu

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

17 months ago[SVE] Fix incorrect lowering of predicate permute builtins.
Paul Walker [Wed, 18 Jan 2023 16:33:42 +0000 (16:33 +0000)]
[SVE] Fix incorrect lowering of predicate permute builtins.

When lowering predicate permute builtins we incorrectly assume only
the typically "active" bits for the specified element type play a
role with all other bits zero'd.  This is not the case because all
bits are significant, with the element type specifying how they
are grouped:

  b8  - permute using a block size of 1 bit
  b16 - permute using a block size of 2 bits
  b32 - permute using a block size of 4 bits
  b64 - permute using a block size of 8 bits

The affected builtins are svrev, svtrn1, svtrn2, svuzp1, svuzp2,
svzip1 and svzip2.

This patch adds new intrinsics to support these operations and
changes the builtin lowering code to emit them.  The b8 case remains
unchanged because for that operation the existing intrinsics work
as required and their support for other predicate types has been
maintained as useful if only as a way to test the correctness of
their matching ISD nodes that code generation relies on.

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

17 months ago[SCCP] Adjust test after cdeaf5f28c3dca.
Florian Hahn [Thu, 26 Jan 2023 12:04:20 +0000 (12:04 +0000)]
[SCCP] Adjust test after cdeaf5f28c3dca.

17 months agoRevert "[LoopVectorize] Enable integer Mul and Add as select reduction patterns"
Matt Devereau [Thu, 26 Jan 2023 12:02:16 +0000 (12:02 +0000)]
Revert "[LoopVectorize] Enable integer Mul and Add as select reduction patterns"

This reverts commit f90103851f9a381bbf7ed6da250217577afd00d2.

17 months agoRecommit "[SCCP] Use range info to prove AddInst has NUW flag."
Florian Hahn [Thu, 26 Jan 2023 11:45:10 +0000 (11:45 +0000)]
Recommit "[SCCP] Use range info to prove AddInst has NUW flag."

This reverts commit 531756b9544b3e164b9ab998292fce3ebbc7c746.

The recommitted version fixes a crash when one of the operands is a
constant other than a ConstantInt. Test for that case have been added
in 5b16cd97b8e1c273.

It splits off the new logic into a separate function because setting the
flags is quite different compared to the other cases handled in replaceSignedInst
which all require replacing an existing instruction.

It also guards makeGuaranteedNoWrapRegion by `if (!Inst.hasNoUnsignedWrap())`
as discussed in the review.

Fixes #60280.
Fixes #60278.

Original message:
    This patch updates SCCP to use the value ranges of AddInst operands to
    try to prove the AddInst does not overflow in the unsigned sense and
    adds the NUW flag. The reasoning is done with
    makeGuaranteedNoWrapRegion (thanks @nikic for point it out!).

    Follow-ups will include adding NSW and extension to more
    OverflowingBinaryOperators.

    Reviewed By: nikic

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

17 months ago[Coroutine] Fix typos in comment
Jannik Silvanus [Thu, 26 Jan 2023 11:42:08 +0000 (12:42 +0100)]
[Coroutine] Fix typos in comment

17 months ago[clang] Add test for CWG1960
Vlad Serebrennikov [Thu, 26 Jan 2023 11:07:30 +0000 (14:07 +0300)]
[clang] Add test for CWG1960

P1787: "CWG1960 (currently closed as NAD) is resolved by removing the rule in question (which is widely ignored by implementations and gives subtle interactions between using-declarations)."
Wording: "In a using-declarator that does not name a constructor, every declaration named shall be accessible."

Reviewed By: #clang-language-wg, erichkeane, shafik

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

17 months ago[RISCV][NFC] Rename narrowing patterns to use W suffix
Luke Lau [Wed, 25 Jan 2023 16:19:11 +0000 (16:19 +0000)]
[RISCV][NFC] Rename narrowing patterns to use W suffix

To match up with the pseudo instruction names

Reviewed By: craig.topper

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

17 months ago[AArch64][SME2] Add multi-vector saturating rounding shift right intrinsics
Kerry McLaughlin [Thu, 26 Jan 2023 10:55:06 +0000 (10:55 +0000)]
[AArch64][SME2] Add multi-vector saturating rounding shift right intrinsics

Adds IR intrinsics for the following SME2 instructions:
 - sqrshr (2 and 4 vector)
 - uqrshr (2 and 4 vector)
 - sqrshru (2 and 4 vector)
 - sqrshrn (4 vector)
 - uqrshrn (4 vector)
 - sqrshrun (4 vector)

Also adds intrinsics for the following SVE2p1 instructions:
 - sqrshrn (2 vector)
 - uqrshrn (2 vector)
 - sqrshrun (2 vector)

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

Reviewed By: CarolineConcatto

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

17 months ago[MLIR][OpenMP] Add Lowering support for OpenMP Target Data, Exit Data and Enter Data...
Akash Banerjee [Tue, 24 Jan 2023 11:29:50 +0000 (11:29 +0000)]
[MLIR][OpenMP] Add Lowering support for OpenMP Target Data, Exit Data and Enter Data directives

This patch adds Fortran Lowering support for the OpenMP Target Data, Target Exit Data and Target Enter Data constructs.
operation.

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

17 months ago[SPIRV] Fix build warnings
Jay Foad [Wed, 25 Jan 2023 12:02:54 +0000 (12:02 +0000)]
[SPIRV] Fix build warnings

Fix these build warnings:

SPIRVBuiltins.cpp:1590:30: warning: 'getPrefTypeAlignment' is deprecated: use getPrefTypeAlign instead [-Wdeprecated-declarations]
SPIRVUtils.cpp:209:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]

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

17 months ago[AArch64][SME2] Add multi-vector saturating doubling multiply high intrinsics
Kerry McLaughlin [Thu, 26 Jan 2023 09:56:39 +0000 (09:56 +0000)]
[AArch64][SME2] Add multi-vector saturating doubling multiply high intrinsics

Adds intrinsics for the following SME2 instructions:
 - sqdmulh, 2 vector (single & multi)
 - sqdmulh, 4 vector (single & multi)

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

Reviewed By: david-arm

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

17 months ago[SROA] Break typed pointer support
Nikita Popov [Thu, 26 Jan 2023 09:10:01 +0000 (10:10 +0100)]
[SROA] Break typed pointer support

This removes typed pointer support in a prominent place in the
optimization pipeline, to ensure that any non-trivial consumers
of tip-of-tree LLVM are aware that this is no longer a supported
configuration.

17 months agoRevert "[clang] Build UsingType for elaborated type specifiers."
Haojian Wu [Thu, 26 Jan 2023 09:46:51 +0000 (10:46 +0100)]
Revert "[clang] Build UsingType for elaborated type specifiers."

This reverts commit e70ca7b35319a3621f9d9c6475926428f8c5c000 and the
followup patch "[clang] Fix the location of UsingTypeLoc"
(ebbeb164c25a40cb6ba9c6b18dce5dcd06c0bb07).

The patch causes an incorrect lookup result:

```
namespace ns { struct Foo { };}

using ns::Foo;
void test() {
  struct Foo {
  } k; // the type of k refers to ns::Foo, rather than the local Foo!
}
```

17 months ago[Clang] Convert some tests to opaque pointers (NFC)
Nikita Popov [Thu, 26 Jan 2023 09:18:42 +0000 (10:18 +0100)]
[Clang] Convert some tests to opaque pointers (NFC)

These are all tests that end up running SROA.

17 months ago[NFC][WebAssembly] Updated tests
Samuel Parker [Thu, 26 Jan 2023 10:26:24 +0000 (10:26 +0000)]
[NFC][WebAssembly] Updated tests

Run update_llc_test_checks on a number of codegen tests.

17 months agoAllow getRawCommentForDecl to find comments in macros
Dana Jansens [Thu, 26 Jan 2023 08:53:59 +0000 (09:53 +0100)]
Allow getRawCommentForDecl to find comments in macros

The key part of getRawCommentForDecl() required to find a comment
is determining where to look for it. The location of the decl
itself is usually right, except when macros get involved. The
comment in the macro is stored in RawCommentList at the spelling
location of the decl, not at the place where the decl comes into
being as the macro is instantiated.

getDeclLocForCommentSearch() already contained to branches to try
handle comments inside macros, and we are able to replace them
and handle more cases as well, by returning the spelling location
of the decl's begin location. That is:
  SourceMgr.getSpellingLoc(D->getBeginLoc())

Reviewed By: gribozavr2

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