Commit Graph

413573 Commits

Author SHA1 Message Date
Nathan James 6f2c95657b
[clang][docs] Regenerate ASTMatchers documentation 2022-02-03 14:11:30 +00:00
Markus Böck 7b196f1b09 [mlir][Rewrite] Add support for using an operation with no results as location
Prior to this patch, using an operation without any results as the location would result in the generation of invalid C++ code. It'd try to format using the result values, which would would end up being an empty string for an operation without any.
This patch fixes that issue by instead using getValueAndRangeUse which handles both ranges as well as the case for an op without any results.

Differential Revision: https://reviews.llvm.org/D118885
2022-02-03 15:08:09 +01:00
Valentin Clement e7361469bb
[fir] Add fir.array_amend operation definition
This patch adds the fir.array_amend operation. this op
is used later in upstreaming patches for the F95 compliance.

The `array_amend` operation marks an array value as having been changed via
a reference obtain by an `array_access`. It acts as a logical transaction
log that is used to merge the final result back with an `array_merge_store`
operation.

 ```mlir
  // fetch the value of one of the array value's elements
  %1 = fir.array_access %v, %i, %j : (!fir.array<?x?xT>, index, index) -> !fir.ref<T>
  // modify the element by storing data using %1 as a reference
  %2 = ... %1 ...
  // mark the array value
  %new_v = fir.array_amend %v, %2 : (!fir.array<?x?xT>, !fir.ref<T>) -> !fir.array<?x?xT>
```

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

Reviewed By: kiranchandramohan, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-02-03 15:04:35 +01:00
Valentin Clement 1bfbe315a7
[flang] Remove ununsed variable in ScalarExprLowering
Fix buildbot failure https://lab.llvm.org/buildbot/#/builders/180/builds/3066
2022-02-03 15:02:49 +01:00
Sam Parker 0c02c2c60a [NFC] TypePromotion test for AArch64 2022-02-03 13:49:30 +00:00
Pavel Labath c34698a811 [lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the
"lldb" log channel is defined (Log.h defines the generic logging
infrastructure). This worked because Log.h included Logging.h, even
though it should.

After the recent refactor, it became impossible the two files include
each other in this direction (the opposite inclusion is needed), so this
patch removes the workaround that was put in place and cleans up all
files to include the right thing. It also renames the file to LLDBLog to
better reflect its purpose.
2022-02-03 14:47:01 +01:00
Matt Devereau 1c6dca96ca [AArch64][SVE] Fold vselect into predicated fmul, fsub and fadd
Fold vselect with an unpredicated fmul/fsub/fadd
operand into a predicated fmul/fsub/fadd:

(vselect (p) (op (a) (b)) (a)) => (op -> (p) (a) (b))

Differential Revision: https://reviews.llvm.org/D117689
2022-02-03 13:43:15 +00:00
Kirill Bobyrev 089d9c50b2
[clangd] IncludeCleaner: Decrease API dependency on clangd
Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D118882
2022-02-03 14:40:53 +01:00
Shao-Ce SUN 005fd8aa70 [RISCV] Add support for Zihintpause extention
Add support for the 'pause' hint instruction as an alias for
'fence w, 0'. To do this allow the 'fence' operands pred and succ
to be set to 0 (the empty set). This will also allow future hints
to be encoded as 'fence 0, <x>' and 'fence <x>, 0'.

This patch revised from @mundaym's D93019.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D117789
2022-02-03 20:55:47 +08:00
John Brawn 6f53960d64 [AArch64] Adjust machine-combiner-reassociate.mir test
Use regular expressions for instruction numbers, as these can vary.
2022-02-03 12:40:14 +00:00
Sven van Haastregt 9694332b81 [clang-format] Add missing newline in -style help 2022-02-03 12:12:29 +00:00
Simon Pilgrim 6b4ebdd46f ModuleUtils - VFABI::setVectorVariantNames - use ArrayRef<> instead of const SmallVector to pass argument 2022-02-03 12:11:48 +00:00
Christian Kühnel 2f8da95e07 [clangd][nfc] cleanup of remaining clang-tidy findings
There were some left-overs (or new things) from the previous patches.

This will get us down to 0 open findings except:
clang-tidy is complaining in some files about
`warning: #includes are not sorted properly [llvm-include-order]`
however, clang-format does revert these changes.
It looks like clang-tidy and clang-format disagree there.

Not sure how we can fix that...

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D118698
2022-02-03 12:05:25 +00:00
John Brawn 94843ea7d7 [AArch64] Make machine combiner patterns preserve MIFlags
This is mainly done so that we don't lose the nofpexcept flag once we
start emitting it.

Differential Revision: https://reviews.llvm.org/D118621
2022-02-03 11:58:59 +00:00
Haojian Wu c39969ef25 [clangd] NFC, remove an unused local varaiable. 2022-02-03 12:52:24 +01:00
gbreynoo d17c54d17d [llvm-ar] Prevent automatic conversion from thin to full archive
llvm-ar silently converts a thin archive to a regular archive when you
specify a modification operation (e.g. 'r') without the 'T' modifier.
This change stops this from occuring. If a user is trying to convert
between thin and full archives then they can explicitly use the 'L'
command to createa new archive.

Differential Revision: https://reviews.llvm.org/D118693
2022-02-03 11:45:21 +00:00
Benjamin Kramer 309b48ca5e [mlir][vector] Sink StandardOps include to its user in VectorUtils 2022-02-03 12:34:41 +01:00
Nikita Popov 2071f7f252 [RS4GC] Regenerate test checks (NFC) 2022-02-03 12:29:44 +01:00
Sven van Haastregt d97a4dfea6 [OpenCL] Move most _explicit atomics into multiclass; NFC
This will simplify future conditionalization for OpenCL 3.0
optionality of atomic features.

The only set of atomic functions not using the multiclass is
atomic_compare_exchange_strong/weak, as these don't fit the common
pattern due to having 2 MemoryOrder arguments.
2022-02-03 11:09:41 +00:00
Florian Hahn 413e47ecd4
[ConstraintElimination] Handle degenerate case with branch to same dest.
When a conditional branch has the same block as both true and false
successor it is not safe to add the condition.

Fixes PR49819.
2022-02-03 11:09:14 +00:00
Florian Hahn e39bbe9a83
[ConstraintElimination] Add test cases from PR49819. 2022-02-03 11:09:10 +00:00
David Green 31373fb88a [AArch64] Reassociate integer extending reductions to pairwise addition.
Given an (integer) vecreduce, we know the order of the inputs does not matter.
We can convert UADDV(add(zext(extract_lo(x)), zext(extract_hi(x)))) into
UADDV(UADDLP(x)). This can also happen through an extra add, where we transform
UADDV(add(y, add(zext(extract_lo(x)), zext(extract_hi(x))))).

This makes sure the same thing happens signed cases too, which requires adding
a new SADDLP node.

Differential Revision: https://reviews.llvm.org/D118107
2022-02-03 11:05:48 +00:00
Owen Pan eaef54f213 [clang-format] Revert a feature in RemoveBracesLLVM
Revert the handling of a single-statement block that gets wrapped.

See issue #53543.

Differential Revision: https://reviews.llvm.org/D118873
2022-02-03 02:56:09 -08:00
David Spickett c01548c7e0 [compiler-rt][lsan] Increase libdl_deadlock test timeout
We (Linaro) still have the occasional failure here due
to high load on a shared buildbot machine.

We are looking into general soloutions but perhaps this
will help in the meantime.
2022-02-03 10:54:25 +00:00
Markus Böck 8652fc8453 [mlir][NFC] Fully qualify a default C++ string in Pattern.cpp 2022-02-03 11:50:37 +01:00
Valentin Clement f254a8eff6
[fir] Add fir.array_access op
The `array_access` provides a reference to a single element from an array
value. This is *not* a view in the immutable array, otherwise it couldn't
be stored to. It can be see as a logical copy of the element and its
position in the array. This reference can be written to and modified without
changing the original array.

The `array_access` operation is used to fetch the memory reference of an
element in an array value.

```fortran
      real :: a(n,m)
      ...
      ... a ...
      ... a(r,s+1) ...
```

One can use `fir.array_access` to recover the implied memory reference to
the element `a(i,j)` in an array expression `a` as shown above. It can also
be used to recover the reference element `a(r,s+1)` in the second
expression.

```mlir
      %s = fir.shape %n, %m : (index, index) -> !fir.shape<2>
      // load the entire array 'a'
      %v = fir.array_load %a(%s) : (!fir.ref<!fir.array<?x?xf32>>, !fir.shape<2>) -> !fir.array<?x?xf32>
      // fetch the value of one of the array value's elements
      %1 = fir.array_access %v, %i, %j : (!fir.array<?x?xf32>, index, index) -> !fir.ref<f32>
```

More information about `array_access` and other array operations can be
found in flang/docs/FIRArrayOperations.md.

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

Reviewed By: kiranchandramohan, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-02-03 11:45:27 +01:00
Valentin Clement ca53e049e0
[flang] Lower integer constant code for STOP stmt
This patch lower the integer constant code in the STOP statement.

The code is lowered to `arith.constant`.

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

Reviewed By: schweitz, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118787
2022-02-03 11:31:12 +01:00
Haojian Wu 20e05b9f0e [syntax][pseudo] Add Grammar for the clang pseudo-parser
This patch introduces the Grammar class, which is a critial piece for constructing
a tabled-based parser.

As the first patch, the scope is limited to:
  - define base types (symbol, rules) of modeling the grammar
  - construct Grammar by parsing the BNF file (annotations are excluded for now)

Differential Revision: https://reviews.llvm.org/D114790
2022-02-03 11:28:27 +01:00
Valentin Clement dc6a344637
[flang] Add lowering for integer constant
This patch enables the lowering of integer constant.

The `ScalarExprLowering` class is introduced in `ConvertExpr.cpp` to help
the lowering of expression. This patch adds all the placeholder as well for future
expression lowering with the appropriate TODOs.

Integer constant expression are lowered to `arith.constant` with an integer type corresponding to the kind value.

This patch is in support of D118787

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

Reviewed By: schweitz, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118786
2022-02-03 11:10:30 +01:00
David Spickett d15e7dd123 [clang][Hexagon] Match -lc option more specifically in toolchain test
In https://lab.llvm.org/buildbot/#/builders/185/builds/1341
our bot happened to generate a temporary file path with -lc in
it.

Match with "" around the options so this doesn't happen again.
2022-02-03 10:08:20 +00:00
Simon Moll 73ac3b1371 [VE] Packed v512i32 isel and tests
Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D118332
2022-02-03 11:01:54 +01:00
Serge Pavlov d2f132f0b7 [ConstantFolding] Fold constrained compare intrinsics
The change implements constant folding of ‘llvm.experimental.constrained.fcmp’
and ‘llvm.experimental.constrained.fcmps’ intrinsics.

Differential Revision: https://reviews.llvm.org/D110322
2022-02-03 16:45:56 +07:00
Tim Northover becb29aeb6 Revert "[compiler-rt][Darwin] Add arm64 to simulator platforms"
This reverts commit a8e5ce76b4.

It looks like older Xcodes' headers don't allow arm64 builds so it was causing
CI failures.
2022-02-03 09:42:49 +00:00
Marek Kurdej 768a6192df [clang-format] Reserve vectors when the number of items is known beforehand. NFC. 2022-02-03 10:38:23 +01:00
Roman Lebedev ee4ba9f3a1
Revert "[SimplifyCFG] Start redesigning `FoldTwoEntryPHINode()`."
Unfortunately, it seems we really do need to take the long route;
start from the "merge" block, find (all the) "dispatch" blocks,
and deal with each "dispatch" block separately, instead of simply
starting from each "dispatch" block like it would logically make sense,
otherwise we run into a number of other missing folds around
`switch` formation, missing sinking/hoisting and phase ordering.

This reverts commit 85628ce75b.
This reverts commit c5fff90953.
This reverts commit 34a98e1046.
This reverts commit 1e353f0922.
2022-02-03 12:32:50 +03:00
Sander de Smalen 01bfe9729a [ISEL] Canonicalize STEP_VECTOR to LHS if RHS is a splat.
This helps recognise patterns where we're trying to match STEP_VECTOR
patterns to INDEX instructions that take a GPR for the Start/Step.

The reason for canonicalising this operation to the LHS is
because it will already be canonicalised to the LHS if the RHS
is a constant splat vector.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D118459
2022-02-03 09:31:46 +00:00
Thomas Symalla 78bf2e0a3f [AMDGPU] Update two Codegen tests. (NFC)
This change adds a new Codegen test with auto-generated checks and
updates divergence-driven-trunc-to-i1.ll with auto-generated checks.
This is in preparation to D118461 to visualize the Codegen changes.
2022-02-03 10:28:53 +01:00
Hans Wennborg 564f9be11c Remove -Wweak-template-vtables
as it was planned for removal in clang 15 and we're now past the branch point

See https://github.com/llvm/llvm-project/issues/19107

Differential revision: https://reviews.llvm.org/D118762
2022-02-03 10:15:16 +01:00
Jean Perier 575a6f819b [flang] add ExtendedValue type helpers and factory::genZeroValue
Add some helpers to get the base type and element type of
fir::ExtendedValue and to test if a fir::ExtendedValue is
a derived type with length parameters.

Add a new helper factory::genZeroValue to generate zero scalar value for
all the numerical types and false for logicals.

These helpers are used only in lowering for now, so add unit tests.

Differential Revision: https://reviews.llvm.org/D118795
2022-02-03 10:13:54 +01:00
Marek Kurdej 7cc3e02042 [clang-format] Use back() instead of rbegin(). NFC. 2022-02-03 10:07:02 +01:00
Marek Kurdej bb1b53da6e [clang-format] Remove unnecessary non-null check and assert instead. NFC.
After a non-eof token, there is at least an eof token.
2022-02-03 09:50:36 +01:00
Markus Böck 7a9e3ef77a [mlir] Fix crash in RewriterGen when a `TypeConstraint` is not given an argument
The code assumes that a TypeConstraint in the additional constraints list specifies precisely one argument.
If the user were to not specify any, it'd result in a crash. If given more than one, the additional ones were ignored.

This patch fixes the crash and disallows user errors by adding a check that a single argument is supplied to the TypeConstraint

Differential Revision: https://reviews.llvm.org/D118763
2022-02-03 09:08:27 +01:00
Lang Hames 67a9f82cc9 [llvm-jitlink] Add comment to clarify testcase intent. 2022-02-03 18:59:09 +11:00
Lang Hames 517a4844bf [llvm-jitlink] Add -alias option, shorten "-define-abs" option to "-abs".
The -alias option can be used to define aliases within a JITDylib. The
immediate motivation is to simplify testing of ORC runtime functions using
existing testcases (e.g. by aliasing dlfcn functions to their ORC-runtime
counterparts, like -alias dlopen=__orc_rt_macho_dlopen). The option is likely
to be useful for testing in general.

The -define-abs option is shortened to -abs for consistency with -alias.
2022-02-03 18:47:59 +11:00
Fangrui Song f3a66ec0bd [asan][test] Re-generate asan-check-memaccess-add.ll with update_llc_test_checks.py
* LABEL is important to give a better diagnostic in case a check pattern fails
* Some NOT negative patterns are not effective. NEXT is useful to ensure
  a code sequence has the desired instructions and report a better
  diagnostic if something goes off.
* Since the ABI says the first parameter is in RDI. Replacing the
  pattern `[[REG16:.*]]` with `RDI` should not cause maintenance burden.

Since the test is pretty mechanical, just use update_llc_test_checks.py
to re-generate it. Most functions can use `nounwind` to avoid CFI
directives.

Reviewed By: kstoimenov, vitalybuka

Differential Revision: https://reviews.llvm.org/D118864
2022-02-02 23:40:10 -08:00
Mark de Wever 959678425d [libc++][nfc] Add TEST_HAS_NO_UNICODE_CHARS.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D118832
2022-02-03 08:02:25 +01:00
Konstantin Varlamov 823fa098aa [libc++][ranges][NFC] Test the specializations of `tuple_{size,element}` for ranges.
Also update the synopsis in `<ranges>` to mention the specializations.

Differential Revision: https://reviews.llvm.org/D118686
2022-02-02 22:58:33 -08:00
Amir Ayupov 167b623a6a [BOLT][NFC] Use isInt<> instead of range checks
Summary: Reuse LLVM isInt check

Reviewed By: maksfb

FBD33945182
2022-02-02 20:32:05 -08:00
Craig Topper abc6716038 [RISCV] Remove unused variables. NFC 2022-02-02 19:23:16 -08:00
Amir Ayupov 1ab13cc18b [BOLT][TEST] Add heatmap.test
Add a basic test for heatmap mode

Reviewed By: maksfb, ayermolo

Differential Revision: https://reviews.llvm.org/D118868
2022-02-02 18:56:15 -08:00