Commit Graph

418544 Commits

Author SHA1 Message Date
David Truby f47e7e4a34 [clang][SVE] Add support for bitwise operators on SVE types
This patch implements support for the &, |, ^, and ~ operators on sizeless SVE
types.

Differential Revision: https://reviews.llvm.org/D121119
2022-03-18 14:06:47 +00:00
Roy Jacobson 4b3a27e2e0 Add validation for number of arguments of __builtin_memcpy_inline
__builtin_memcpy_inline doesn't use the usual builtin argument validation code,
so it crashed when receiving wrong number of argument. Add the missing validation
check.

Open issue: https://github.com/llvm/llvm-project/issues/52949

Reviewed By: gchatelet

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

Committed by gchatelet on behalf of "Roy Jacobson <roi.jacobson1@gmail.com>"
2022-03-18 14:03:25 +00:00
Marek Kurdej c79e18da4f [clang-format] Expect instead of setting the same value in tests. NFC. 2022-03-18 15:01:41 +01:00
Marek Kurdej acc7a7f9a1 [clang-format] Use range-for loop. NFC. 2022-03-18 15:01:41 +01:00
Marek Kurdej b6baab673a [clang-format] Refactor BreakableBlockComment constructor. NFC. 2022-03-18 15:01:40 +01:00
Nikita Popov ab2284a643 [LowerConstantIntrinsics] Make TLI a required dependency
The way the pass is actually used in the optimization pipeline,
TLI will be available, but this is not the case when running just
-lower-constant-intrinsics in tests, which ends up being quite
confusing.

Require TLI unconditionally, as we usually do.
2022-03-18 14:59:18 +01:00
Valentin Clement 32306b9cf7
[flang] Lower length on character storage
This patch adds lowering for SetLength used to set
different length on character storage around calls where
the dummy and actual length differ.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-18 14:52:59 +01:00
Nikita Popov 28c53b384d [LowerConstantIntrinsics] Add test for objectsize of malloc (NFC)
This is currently not folded with a plain -lower-constant-intrinsics
invocation, because TLI is an optional dependency.
2022-03-18 14:50:33 +01:00
Valentin Clement 99d239341c
[flang][NFC] Add lowering tests
Add couple of tests for the lowering.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-18 14:48:56 +01:00
Valentin Clement 460f828f09
[flang] Lower statement function
This patch adds lowering to suppoert statement functions

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-18 14:47:16 +01:00
Nikita Popov 52cc65d474 [OpenMPRuntime] Specify correct pointer type
Rather than specifying a dummy type in EmitLoadOfPointer() and
then casting it to the correct one, we should instead specify the
correct type and cast beforehand. Otherwise the computed alignment
will be incorrect.
2022-03-18 14:25:51 +01:00
Vladislav Khmelevsky 5be5d0f56e [BOLT] LongJmp speedup refactoring
Run tentativeLayoutRelocMode twice only if UseOldText option was passed.
Refactor BF loop to break on condtition met.

Differential Revision: https://reviews.llvm.org/D121825
2022-03-18 16:16:47 +03:00
LLVM GN Syncbot 959e2f00b0 [gn build] Port f83d833e41 2022-03-18 12:43:27 +00:00
Nico Weber ec49c84fb9 [gn build] (manually) port a954ade8ed (gen X86GenMnemonicTables.inc) 2022-03-18 08:42:50 -04:00
Nico Weber d2dc52493e [gn build] (semiautomatically) port fdcb256f97 2022-03-18 08:42:50 -04:00
David Spickett 9f052f3dd2 [lldb] Require x86 target for NativePDB test
This test would fail if you only build for example,
just the AArch64 backend, due to the x86 triple.
2022-03-18 12:31:03 +00:00
Nico Weber 21b97df74c Revert "[gn build] (manually) port 6316129e066e"
This reverts commit 5f4a334ded.
6316129e06 was reverted in 112aafcaf4.
2022-03-18 08:26:46 -04:00
Egor Zhdan 33a9eac6aa [Clang] Support multiple attributes in a single pragma
This adds support for multiple attributes in `#pragma clang attribute push`, for example:

```
```
or
```
```

Related attributes can now be applied with a single pragma, which makes it harder for developers to make an accidental error later when editing the code.

rdar://78269653

Differential Revision: https://reviews.llvm.org/D121283
2022-03-18 12:20:41 +00:00
Tomas Matheson 62c481542e Revert "[ARM][AArch64] generate subtarget feature flags"
This reverts commit dd8b0fecb9.
2022-03-18 11:58:20 +00:00
David Green fe6057a293 [AArch64] Custom lower concat(v4i8 load, ...)
We already have custom lowering for v4i8 load, which loads as a f32,
converts to a vector and bitcasts and extends the result to a v4i16.
This adds some custom lowering of concat(v4i8 load, ...) to keep the
result as an f32 and create a buildvector of the resulting f32 loads.
This helps not create all the extends and bitcasts, which are often
difficult to fully clean up.

Differential Revision: https://reviews.llvm.org/D121400
2022-03-18 11:58:02 +00:00
Nikolas Klauser f83d833e41 [libc++][ranges] Implement ranges::min
Reviewed By: var-const, Mordante, #libc

Spies: jwakely, ldionne, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D119589
2022-03-18 12:52:21 +01:00
Tomas Matheson dd8b0fecb9 [ARM][AArch64] generate subtarget feature flags
This patch aims to reduce a lot of the boilerplate around adding new subtarget
features. From the SubtargetFeatures tablegen definitions, a series of calls to
the macro GET_SUBTARGETINFO_MACRO are generated in
ARM/AArch64GenSubtargetInfo.inc.  ARMSubtarget/AArch64Subtarget can then use
this macro to define bool members and the corresponding getter methods.

Some naming inconsistencies have been fixed to allow this, and one unused
member removed.

This implementation only applies to boolean members; in future both BitVector
and enum members could also be generated.

Differential Revision: https://reviews.llvm.org/D120906
2022-03-18 11:48:20 +00:00
Simon Pilgrim 4455c5cdea [CostModel][X86] Update RUN -passes=* to double quotes to appease update scripts on windows 2022-03-18 11:44:18 +00:00
Pavel Labath af4da4f995 [lldb] Increase timeout in TestProcessIOHandlerInterrupt
The small value was not meant to be checked in.
2022-03-18 12:14:10 +01:00
Nikita Popov 6ffb3ad631 [SCEV] Use constant ranges when determining reachable blocks (PR54434)
This avoids false positive verification failures if the condition
is not literally true/false, but SCEV still makes use of the fact
that a loop is not reachable through more complex reasoning.

Fixes https://github.com/llvm/llvm-project/issues/54434.
2022-03-18 12:04:35 +01:00
Pavel Labath a4d6de2031 [lldb] Fix TestProcessIOHandlerInterrupt.py for macos
On darwin, we don't completely suppress the signal used to interrupt the
inferior. The underlying read syscall returns EINTR, which causes premature
termination of the input loop.

Work around that by hand-rolling an EINTR-resistant version of getline.
2022-03-18 11:51:55 +01:00
sstwcw fee94803f5 [clang-format] Copy help options to the doc directory.
The options listed in ClangFormat.rst lag behind those output by the
-help command line option.  Specifically, these are missing.

--files
--qualifier-alignment

Fixes #54418

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D121890
2022-03-18 10:51:36 +00:00
Andrzej Warzynski 4571f8aa05 [flang][lowering] Add support for lowering of the `ior` intrinsic
This patch adds support for lowering of the `ior` intrinsic from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-18 10:36:38 +00:00
Mohammed Nurul Hoque 7afa44f5f5 [RISCV] Add more sign-extending ops to MIR sext.w pass.
This patch adds single-bit and bit-counting ops to list of sign-extending ops.

A single-bit write propagates sign-extendedness if it's not in the sign-bits.

Bit extraction and bit counting always outputs a small number, so sign-extended.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D121152
2022-03-18 18:21:17 +08:00
Dmitry Preobrazhensky 53491e4519 [AMDGPU][DOC][NFC] Added links to MI200 documentation
Differential Revision: https://reviews.llvm.org/D121811
2022-03-18 13:17:42 +03:00
Andrzej Warzynski ff3e75f739 [flang][lowering] Add support for lowering of the `{l|u}bound` intrinsics
This patch adds support for lowering of the `{l|u}bound` intrinsics from
Fortran to the FIR dialect of MLIR. Note that `ubound` is already
supported, but the test was missing (added here).

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
2022-03-18 10:16:54 +00:00
Nikita Popov 74992f4a5b [CodeGen] Store element type in DominatingValue<RValue>
For aggregate rvalues, we need to store the element type in the
dominating value, so we can recover the element type for the
address.
2022-03-18 11:13:25 +01:00
Andrzej Warzynski 4d2096482d [flang][lowering] Add support for lowering of the `merge` intrinsics
This patch adds support for lowering of the `merge` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Mark Leair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-18 10:09:40 +00:00
Nikita Popov 33d020d010 [CodeGen] Remove some uses of deprecated Address constructor 2022-03-18 11:01:25 +01:00
Benjamin Kramer 9816fada16 [bazel] Port a954ade8ed 2022-03-18 10:50:55 +01:00
Benjamin Kramer d3f4562cbd [bazel] Sync llvm-config.h after 112aafcaf4 2022-03-18 10:45:54 +01:00
Nikita Popov fc8946fae7 [InstCombine] Remove integer SPF of SPF folds (NFCI)
Now that we canonicalize to intrinsics, these folds should no
longer be needed. Only one fold that also applies to floating-point
min/max is retained.
2022-03-18 10:20:48 +01:00
Kiran Chandramohan 022b05941e [Flang] Lower the spacing, rrspacing intrinsics
These intrinsics returns the distance to the nearest real number and
their reciprocal. They are lowered to flang runtime calls.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Mark Leair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-18 09:18:42 +00:00
Nikita Popov f96428e16d [MemorySSA] Don't optimize uses during construction
This changes MemorySSA to be constructed in unoptimized form.
MemorySSA::ensureOptimizedUses() can be called to optimize all
uses (once). This should be done by passes where having optimized
uses is beneficial, either because we're going to query all uses
anyway, or because we're doing def-use walks.

This should help reduce the compile-time impact of MemorySSA for
some use cases (the reason why I started looking into this is
D117926), which can avoid optimizing all uses upfront, and instead
only optimize those that are actually queried.

Actually, we have an existing use-case for this, which is EarlyCSE.
Disabling eager use optimization there gives a significant
compile-time improvement, because EarlyCSE will generally only query
clobbers for a subset of all uses (this change is not included in
this patch).

Differential Revision: https://reviews.llvm.org/D121381
2022-03-18 09:56:16 +01:00
Florian Hahn 4a699ae9c6
[LoopSimplifyCFG] Check predecessors of exits before marking them dead.
LoopSimplifyCFG may process loops that are not in
loop-simplify/canonical form. For loops not in canonical form, exit
blocks may be reachable from non-loop blocks and we cannot consider them
as dead if they only are not reachable from the loop itself.

Unfortunately the smallest test I could come up with requires running
multiple passes:
    -passes='loop-mssa(loop-instsimplify,loop-simplifycfg,simple-loop-unswitch)'

The reason is that loops are canonicalized at the beginning of loop
pipelines, so a later transform has to break canonical form in a way
that breaks LoopSimplifyCFG's dead-exit analysis.

Alternatively we could try to require all loop passes to maintain
canonical form. That in turn would also require additional verification.

Fixes #54023, #49931.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D121925
2022-03-18 08:54:44 +00:00
Amir Ayupov 42e8e00189 [BOLT][NFC] Use X86 mnemonic tables
Remove tables from X86MCPlusBuilder, make use of llvm::X86 mnemonic tables.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121573
2022-03-18 01:52:11 -07:00
Amir Ayupov a954ade8ed [X86][NFC] Generate mnemonic tables
Produce mnemonic tables, adding the functions to llvm::X86 namespace.

Reviewed By: MaskRay, skan

Differential Revision: https://reviews.llvm.org/D121572
2022-03-18 01:46:48 -07:00
Amir Ayupov fdcb256f97 [TableGen] X86 mnemonic tables backend
Add tablegen backend that generates X86 mnemonic-based opcode groupings, e.g.
`isADD`, `isTEST`, etc.

Addresses https://lists.llvm.org/pipermail/llvm-dev/2022-January/154526.html

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D121571
2022-03-18 01:43:53 -07:00
Valentin Clement 7db0f6f2f3
[flang][NFC] Move random test in Instriscs folder 2022-03-18 09:25:14 +01:00
Nikita Popov 112aafcaf4 Revert "Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled"
This reverts commit 6316129e06.

This was implemented with inverted logic.
2022-03-18 09:21:53 +01:00
Michel Weber ae3e3c6362 [MLIR][Presburger] introduce SetCoalescer
This patch refactors the current coalesce implementation. It introduces
the `SetCoalescer`, a class in which all coalescing functionality lives.
The main advantage over the old design is the fact that the vectors of
constraints do not have to be passed around, but are implemented as
private fields of the SetCoalescer. This will become especially
important once more inequality types are introduced.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D121364
2022-03-18 08:19:10 +00:00
jacquesguan 26c95ae389 [mlir][Math] Add constant folder for sqrt.
Differential Revision: https://reviews.llvm.org/D121980
2022-03-18 16:01:44 +08:00
Pavel Labath 14bd14f9f9 [lldb] Fix ^C handling in IOHandlerProcessSTDIO
D120762 accidentally moved the interrupt check into the block which was
reading stdio. This meant that a ^C only took effect after a regular
character has been pressed.

This patch fixes that and adds a (pexpect) test.

Differential Revision: https://reviews.llvm.org/D121912
2022-03-18 08:58:30 +01:00
Pavel Labath 53e9ee3027 Revert "[lldb] Fix ^C handling in IOHandlerProcessSTDIO"
This reverts commit f93d861349 -- looks
like a bad application of `patch -p<level>`
2022-03-18 08:58:30 +01:00
Pavel Labath ab25757522 Remove a top-level "using namespace" directive from LegalizationArtifactCombiner.h
The directive pollutes the namespace of all files including that header.
Move the directive into the bodies of functions that need it instead.
2022-03-18 08:58:30 +01:00