platform/upstream/llvm.git
2 years ago[lld/mac] On Apple systems, call CC_SHA256 from libSystem
Nico Weber [Tue, 21 Jun 2022 17:49:26 +0000 (13:49 -0400)]
[lld/mac] On Apple systems, call CC_SHA256 from libSystem

It's in libSystem, so it doesn't bring in any new deps, and it's
currently much faster than LLVM's current SHA256 implementation.

Makes linking (arm64) Chromium Framework with ld64.lld 17% faster.
See also PR56121.

No behavior change.

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

2 years ago[DSE] Don't remove nounwind invokes
Heejin Ahn [Mon, 20 Jun 2022 05:48:48 +0000 (22:48 -0700)]
[DSE] Don't remove nounwind invokes

For non-mem-intrinsic and non-lifetime `CallBase`s, the current
`isRemovable` function only checks if the `CallBase` 1. has no uses 2.
will return 3. does not throw:
https://github.com/llvm/llvm-project/blob/80fb7823367c1d105fcbc8f21b69205a0d68c859/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp#L1017

But we should also exclude invokes even in case they don't throw,
because they are terminators and thus cannot be removed. While it
doesn't seem to make much sense for `invoke`s to have an `nounwind`
target, this kind of code can be generated and is also valid bitcode.

Reviewed By: nikic

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

2 years agoFix an unused-variable warning in release build, NFC.
Haojian Wu [Tue, 21 Jun 2022 18:52:07 +0000 (20:52 +0200)]
Fix an unused-variable warning in release build, NFC.

2 years ago[flang] Add more diagnostics to fir.coordinate_of
Valentin Clement [Tue, 21 Jun 2022 18:42:43 +0000 (20:42 +0200)]
[flang] Add more diagnostics to fir.coordinate_of

Add more diagnostics to fir.coordinate_of to provide better checking
that the IR is sane.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years ago[libc++] Pass -fno-modules to clang-tidy instead of disabling it for the modules...
Nikolas Klauser [Tue, 21 Jun 2022 18:26:43 +0000 (20:26 +0200)]
[libc++] Pass -fno-modules to clang-tidy instead of disabling it for the modules build

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

2 years ago[libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used...
Nikolas Klauser [Wed, 15 Jun 2022 08:21:19 +0000 (10:21 +0200)]
[libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used checks

Reviewed By: #libc, ldionne

Spies: aheejin, libcxx-commits, xazax.hun

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

2 years ago[lldb] [llgs] Attempt to fix LLGS tests on Windows
Michał Górny [Tue, 21 Jun 2022 18:08:06 +0000 (20:08 +0200)]
[lldb] [llgs] Attempt to fix LLGS tests on Windows

Sponsored by: The FreeBSD Foundation

2 years ago[lld/mac] Extract a sha256() function
Nico Weber [Tue, 21 Jun 2022 17:46:40 +0000 (13:46 -0400)]
[lld/mac] Extract a sha256() function

No behavior change.

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

2 years ago[InstCombine] handle subobjects of constant aggregates
Martin Sebor [Tue, 21 Jun 2022 17:31:58 +0000 (11:31 -0600)]
[InstCombine] handle subobjects of constant aggregates

Remove the known limitation of the library function call folders to only
work with top-level arrays of characters (as per the TODO comment in
the code) and allows them to also fold calls involving subobjects of
constant aggregates such as member arrays.

2 years ago[lldb] [llgs] Add a test for detach-all packet
Michał Górny [Wed, 8 Jun 2022 11:09:08 +0000 (13:09 +0200)]
[lldb] [llgs] Add a test for detach-all packet

Add a test verifying that plain 'D' packet correctly detaches all
processes.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D127291

2 years ago[lldb] [llgs] Refactor fork/vfork tests, verify state
Michał Górny [Wed, 8 Jun 2022 10:52:52 +0000 (12:52 +0200)]
[lldb] [llgs] Refactor fork/vfork tests, verify state

Refactor the fork and vfork tests to reuse the code better, avoid
unnecessary regexps and avoid unnecessary conversions between
hex-strings and integers.

Verify the server state after detaching.  In particular, verify that
the detached process' PID/TID pair is no longer valid,
and that the correct process remains running.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D127290

2 years ago[lldb] [llgs] Fix signo sent with fork/vfork/vforkdone events
Michał Górny [Mon, 20 Jun 2022 14:50:21 +0000 (16:50 +0200)]
[lldb] [llgs] Fix signo sent with fork/vfork/vforkdone events

Fix ThreadStopInfo struct to include the signal number for all events.
Since signo was not included in the details for fork, vfork
and vforkdone stops, the code incidentally referenced the wrong union
member, resulting in wrong signo being sent.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D127193

2 years ago[lldb] [MainLoop] Support "pending callbacks", to be called once
Michał Górny [Tue, 21 Jun 2022 09:55:48 +0000 (11:55 +0200)]
[lldb] [MainLoop] Support "pending callbacks", to be called once

Support adding a "pending callback" to the main loop, that will be
called once after all the pending events are processed.  This can be
e.g. to defer destroying the process instance until its exit is fully
processed, as suggested in D127500.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D128253

2 years ago[HLSL] Support HLSL vector initializers
Chris Bieneman [Tue, 14 Jun 2022 21:48:30 +0000 (16:48 -0500)]
[HLSL] Support HLSL vector initializers

In HLSL vectors are ext_vectors in all respects except that they
support a constructor style syntax for initializing vectors. This
change adds a translation of vector constructor arguments into
initializer lists.

This supports two oddities of HLSL syntax:
(1) HLSL vectors support constructor syntax
(2) HLSL vectors are expanded to constituate components in constructors

Reviewed By: aaron.ballman

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

2 years ago[mlir][TilingInterface] Enable tile and fuse using TilingInterface.
Mahesh Ravishankar [Tue, 21 Jun 2022 16:59:26 +0000 (16:59 +0000)]
[mlir][TilingInterface] Enable tile and fuse using TilingInterface.

This patch implements tile and fuse transformation for ops that
implement the tiling interface. To do so,
- `TilingInterface` needs a new method that generates a tiled
  implementation of the operation based on the tile of the result
  needed.
- A pattern is added that replaces a `tensor.extract_slice` whose
  source is defined by an operation that implements the
  `TilingInterface` with a tiled implementation that produces the
  extracted slice in-place (using the method added to
  `TilingInterface`).
- A pattern is added that takes a sequence of operations that
  implement the `TilingInterface` (for now `LinalgOp`s), tiles the
  consumer, and greedily fuses its producers iteratively.

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

2 years ago[SLP][NFC]Fix a warning in a comparison, NFC.
Alexey Bataev [Tue, 21 Jun 2022 17:04:39 +0000 (10:04 -0700)]
[SLP][NFC]Fix a warning in a comparison, NFC.

Fixed signedness warning.

2 years ago[lldb] [llgs] Implement non-stop style stop notification packets
Michał Górny [Tue, 12 Apr 2022 14:21:09 +0000 (16:21 +0200)]
[lldb] [llgs] Implement non-stop style stop notification packets

Implement the support for %Stop asynchronous notification packet format
in LLGS.  This does not implement full support for non-stop mode for
threaded programs -- process plugins continue stopping all threads
on every event.  However, it will be used to implement asynchronous
events in multiprocess debugging.

The non-stop protocol is enabled using QNonStop packet.  When it is
enabled, the server uses notification protocol instead of regular stop
replies.  Since all threads are always stopped, notifications are always
generated for all active threads and copied into stop notification
queue.

If the queue was empty, the initial asynchronous %Stop notification
is sent to the client immediately.  The client needs to (eventually)
acknowledge the notification by sending the vStopped packet, in which
case it is popped from the queue and the stop reason for the next thread
is reported.  This continues until notification queue is empty again,
in which case an OK reply is sent.

Asychronous notifications are also used for vAttach results and program
exits.  The `?` packet uses a hybrid approach -- it returns the first
stop reason synchronously, and exposes the stop reasons for remaining
threads via vStopped queue.

The change includes a test case for a program generating a segfault
on 3 threads.  The server is expected to generate a stop notification
for the segfaulting thread, along with the notifications for the other
running threads (with "no stop reason").  This verifies that the stop
reasons are correctly reported for all threads, and that notification
queue works.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D125575

2 years ago[libc++][CI] Updates GCC to version 12.
Mark de Wever [Mon, 30 May 2022 16:38:27 +0000 (18:38 +0200)]
[libc++][CI] Updates GCC to version 12.

Reviewed By: ldionne, philnik, #libc, #libc_abi

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

2 years agoRevert "[mlir][TilingInterface] Enable tile and fuse using TilingInterface."
Mahesh Ravishankar [Tue, 21 Jun 2022 16:56:10 +0000 (16:56 +0000)]
Revert "[mlir][TilingInterface] Enable tile and fuse using TilingInterface."

This reverts commit ea75511319d9dff8c38c8794c3949c40b63a38d7 due to build failures.

2 years ago[Support/BLAKE3] CMake: Check for `IS_X64` or `CMAKE_OSX_ARCHITECTURES` before adding...
Argyrios Kyrtzidis [Tue, 21 Jun 2022 16:46:06 +0000 (09:46 -0700)]
[Support/BLAKE3] CMake: Check for `IS_X64` or `CMAKE_OSX_ARCHITECTURES` before adding the assembly files

This should fix `clang-ppc64-aix` builder (https://lab.llvm.org/buildbot/#/builders/214)

2 years agoin the absense of the -max-pass-iterations command line options, make
John Regehr [Tue, 21 Jun 2022 15:01:42 +0000 (09:01 -0600)]
in the absense of the -max-pass-iterations command line options, make
llvm-reduce run its full pass sequence up to 5 times, instead of just
once

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

2 years ago[mlir][TilingInterface] Enable tile and fuse using TilingInterface.
Mahesh Ravishankar [Mon, 13 Jun 2022 23:24:31 +0000 (23:24 +0000)]
[mlir][TilingInterface] Enable tile and fuse using TilingInterface.

This patch implements tile and fuse transformation for ops that
implement the tiling interface. To do so,
- `TilingInterface` needs a new method that generates a tiled
  implementation of the operation based on the tile of the result
  needed.
- A pattern is added that replaces a `tensor.extract_slice` whose
  source is defined by an operation that implements the
  `TilingInterface` with a tiled implementation that produces the
  extracted slice in-place (using the method added to
  `TilingInterface`).
- A pattern is added that takes a sequence of operations that
  implement the `TilingInterface` (for now `LinalgOp`s), tiles the
  consumer, and greedily fuses its producers iteratively.

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

2 years ago[Scalarizer] No need to gather a scattered extracted element
serge-sans-paille [Thu, 19 May 2022 12:27:16 +0000 (14:27 +0200)]
[Scalarizer] No need to gather a scattered extracted element

ExtractElement does not produce a vector out of a vector, so there's no need to
call a gather once done.

Fix #54469

Credits to npopov@redhat.com for the original approach.

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

2 years ago[NFC] clang: Implement tests for PR56099
Matheus Izvekov [Sat, 18 Jun 2022 02:05:45 +0000 (04:05 +0200)]
[NFC] clang: Implement tests for PR56099

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D128112

2 years agoReland [GlobalOpt] Preserve CFG analyses
Arthur Eubanks [Sun, 19 Jun 2022 19:20:11 +0000 (12:20 -0700)]
Reland [GlobalOpt] Preserve CFG analyses

The only place we modify the CFG is when calling
removeUnreachableBlocks(), so insert a callback there which invalidates
analyses for that function (or recomputes DT in the legacy PM).

We may delete functions, make sure to clear analyses for those
functions. (this was missed in the original revision)

Small compile time wins across the board:
https://llvm-compile-time-tracker.com/compare.php?from=f444ea8ce0aaaa5ec1a4129809389da15cc41396&to=698f41f4fc26cbf1006ed5d88e9d658edfc5b749&stat=instructions

Reviewed By: nikic

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

2 years ago[gdb-scripts] Add to_string methods to printer implementations
Krzysztof Drewniak [Thu, 16 Jun 2022 14:38:56 +0000 (14:38 +0000)]
[gdb-scripts] Add to_string methods to printer implementations

Some GDB versions require all prettyprinter classes to define to_string.
This commit adds these definitions.

Reviewed By: csigg

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

2 years ago[mlir][sparse][taco] Support f16.
bixia1 [Fri, 17 Jun 2022 23:14:36 +0000 (16:14 -0700)]
[mlir][sparse][taco] Support f16.

Reviewed By: aartbik

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

2 years ago[libc++] Improve charconv base10 algorithm.
Mark de Wever [Mon, 16 May 2022 05:42:40 +0000 (07:42 +0200)]
[libc++] Improve charconv base10 algorithm.

This change is a preparation to add the 128-bit integral output.

Before
```
--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_to_chars_good/2        20.1 ns         20.1 ns     35045000
BM_to_chars_good/3         117 ns          117 ns      5916000
BM_to_chars_good/4        83.7 ns         83.7 ns      8401000
BM_to_chars_good/5        70.6 ns         70.6 ns      9915000
BM_to_chars_good/6        59.9 ns         59.9 ns     11678000
BM_to_chars_good/7        53.9 ns         53.8 ns     12995000
BM_to_chars_good/8        19.0 ns         19.0 ns     37110000
BM_to_chars_good/9        45.9 ns         45.8 ns     15278000
BM_to_chars_good/10       9.24 ns         9.24 ns     75343000
BM_to_chars_good/11       42.6 ns         42.6 ns     16449000
BM_to_chars_good/12       38.8 ns         38.8 ns     18101000
BM_to_chars_good/13       38.8 ns         38.8 ns     17999000
BM_to_chars_good/14       37.7 ns         37.6 ns     18571000
BM_to_chars_good/15       35.8 ns         35.8 ns     19660000
BM_to_chars_good/16       15.4 ns         15.4 ns     46129000
BM_to_chars_good/17       32.3 ns         32.3 ns     21763000
BM_to_chars_good/18       32.8 ns         32.8 ns     21396000
BM_to_chars_good/19       33.4 ns         33.4 ns     21078000
BM_to_chars_good/20       33.3 ns         33.3 ns     21020000
BM_to_chars_good/21       32.3 ns         32.3 ns     21807000
BM_to_chars_good/22       31.6 ns         31.6 ns     22057000
BM_to_chars_good/23       30.7 ns         30.7 ns     22938000
BM_to_chars_good/24       28.3 ns         28.3 ns     24659000
BM_to_chars_good/25       28.2 ns         28.2 ns     24790000
BM_to_chars_good/26       28.4 ns         28.4 ns     24410000
BM_to_chars_good/27       28.7 ns         28.7 ns     24423000
BM_to_chars_good/28       28.9 ns         28.9 ns     24139000
BM_to_chars_good/29       28.9 ns         28.9 ns     24347000
BM_to_chars_good/30       29.2 ns         29.2 ns     24141000
BM_to_chars_good/31       29.6 ns         29.6 ns     23699000
BM_to_chars_good/32       29.5 ns         29.5 ns     23933000
BM_to_chars_good/33       28.9 ns         28.9 ns     24042000
BM_to_chars_good/34       28.7 ns         28.7 ns     24361000
BM_to_chars_good/35       28.3 ns         28.3 ns     24703000
BM_to_chars_good/36       28.1 ns         28.1 ns     24924000
BM_to_chars_bad/2         6.16 ns         6.15 ns    114101000
BM_to_chars_bad/3         14.5 ns         14.5 ns     48244000
BM_to_chars_bad/4         16.9 ns         16.9 ns     41974000
BM_to_chars_bad/5         12.5 ns         12.5 ns     56080000
BM_to_chars_bad/6         10.9 ns         10.9 ns     64036000
BM_to_chars_bad/7         14.5 ns         14.5 ns     47294000
BM_to_chars_bad/8         6.36 ns         6.35 ns    110430000
BM_to_chars_bad/9         12.4 ns         12.4 ns     56448000
BM_to_chars_bad/10        5.13 ns         5.13 ns    137596000
BM_to_chars_bad/11        9.88 ns         9.88 ns     69015000
BM_to_chars_bad/12        10.8 ns         10.8 ns     63990000
BM_to_chars_bad/13        10.7 ns         10.7 ns     65066000
BM_to_chars_bad/14        9.71 ns         9.71 ns     71775000
BM_to_chars_bad/15        9.18 ns         9.18 ns     75267000
BM_to_chars_bad/16        6.12 ns         6.12 ns    115000000
BM_to_chars_bad/17        10.7 ns         10.7 ns     65504000
BM_to_chars_bad/18        10.6 ns         10.6 ns     65685000
BM_to_chars_bad/19        9.98 ns         9.98 ns     69894000
BM_to_chars_bad/20        9.74 ns         9.74 ns     72098000
BM_to_chars_bad/21        9.25 ns         9.25 ns     75184000
BM_to_chars_bad/22        9.10 ns         9.10 ns     75602000
BM_to_chars_bad/23        9.48 ns         9.48 ns     72824000
BM_to_chars_bad/24        9.27 ns         9.27 ns     75112000
BM_to_chars_bad/25        9.61 ns         9.61 ns     72080000
BM_to_chars_bad/26        9.72 ns         9.72 ns     72178000
BM_to_chars_bad/27        10.0 ns         10.0 ns     69733000
BM_to_chars_bad/28        10.3 ns         10.3 ns     67409000
BM_to_chars_bad/29        9.97 ns         9.97 ns     69193000
BM_to_chars_bad/30        10.1 ns         10.1 ns     69007000
BM_to_chars_bad/31        9.68 ns         9.68 ns     72232000
BM_to_chars_bad/32        8.99 ns         8.99 ns     76825000
BM_to_chars_bad/33        8.82 ns         8.82 ns     79293000
BM_to_chars_bad/34        8.64 ns         8.64 ns     80441000
BM_to_chars_bad/35        8.96 ns         8.96 ns     75320000
BM_to_chars_bad/36        8.87 ns         8.87 ns     77293000

```

After
```
--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_to_chars_good/2        14.7 ns         14.7 ns     47583000
BM_to_chars_good/3         101 ns          101 ns      6901000
BM_to_chars_good/4        68.4 ns         68.4 ns     10088000
BM_to_chars_good/5        58.2 ns         58.2 ns     12007000
BM_to_chars_good/6        51.1 ns         51.1 ns     13687000
BM_to_chars_good/7        45.6 ns         45.6 ns     15323000
BM_to_chars_good/8        14.6 ns         14.6 ns     47795000
BM_to_chars_good/9        40.7 ns         40.7 ns     17371000
BM_to_chars_good/10       7.48 ns         7.48 ns     90931000
BM_to_chars_good/11       37.6 ns         37.6 ns     18542000
BM_to_chars_good/12       35.2 ns         35.2 ns     19922000
BM_to_chars_good/13       34.9 ns         34.9 ns     20105000
BM_to_chars_good/14       33.5 ns         33.5 ns     20863000
BM_to_chars_good/15       31.9 ns         31.9 ns     22014000
BM_to_chars_good/16       11.7 ns         11.7 ns     60012000
BM_to_chars_good/17       28.9 ns         28.9 ns     24148000
BM_to_chars_good/18       29.0 ns         29.0 ns     24317000
BM_to_chars_good/19       28.7 ns         28.7 ns     24363000
BM_to_chars_good/20       28.1 ns         28.1 ns     24899000
BM_to_chars_good/21       27.5 ns         27.5 ns     25499000
BM_to_chars_good/22       26.9 ns         26.9 ns     25929000
BM_to_chars_good/23       26.2 ns         26.2 ns     26828000
BM_to_chars_good/24       25.1 ns         25.1 ns     27742000
BM_to_chars_good/25       25.3 ns         25.3 ns     27720000
BM_to_chars_good/26       25.2 ns         25.2 ns     27789000
BM_to_chars_good/27       25.3 ns         25.3 ns     27777000
BM_to_chars_good/28       25.3 ns         25.3 ns     27643000
BM_to_chars_good/29       25.3 ns         25.3 ns     27750000
BM_to_chars_good/30       25.4 ns         25.4 ns     27566000
BM_to_chars_good/31       25.4 ns         25.4 ns     27611000
BM_to_chars_good/32       25.8 ns         25.8 ns     27218000
BM_to_chars_good/33       25.7 ns         25.7 ns     27070000
BM_to_chars_good/34       26.1 ns         26.1 ns     26693000
BM_to_chars_good/35       26.4 ns         26.4 ns     26486000
BM_to_chars_good/36       26.3 ns         26.3 ns     26619000
BM_to_chars_bad/2         5.99 ns         5.99 ns    118787000
BM_to_chars_bad/3         14.3 ns         14.3 ns     48567000
BM_to_chars_bad/4         16.0 ns         16.0 ns     43239000
BM_to_chars_bad/5         12.6 ns         12.6 ns     55354000
BM_to_chars_bad/6         10.7 ns         10.7 ns     65491000
BM_to_chars_bad/7         14.4 ns         14.4 ns     48723000
BM_to_chars_bad/8         6.50 ns         6.50 ns    104967000
BM_to_chars_bad/9         12.0 ns         12.0 ns     56552000
BM_to_chars_bad/10        5.16 ns         5.16 ns    136380000
BM_to_chars_bad/11        10.5 ns         10.5 ns     66764000
BM_to_chars_bad/12        10.7 ns         10.7 ns     65534000
BM_to_chars_bad/13        11.0 ns         11.0 ns     63426000
BM_to_chars_bad/14        9.90 ns         9.90 ns     68575000
BM_to_chars_bad/15        9.52 ns         9.52 ns     70932000
BM_to_chars_bad/16        6.14 ns         6.14 ns    111762000
BM_to_chars_bad/17        10.6 ns         10.6 ns     65883000
BM_to_chars_bad/18        10.5 ns         10.5 ns     67606000
BM_to_chars_bad/19        9.96 ns         9.96 ns     68898000
BM_to_chars_bad/20        9.40 ns         9.41 ns     73116000
BM_to_chars_bad/21        9.12 ns         9.12 ns     78647000
BM_to_chars_bad/22        8.95 ns         8.95 ns     80211000
BM_to_chars_bad/23        9.50 ns         9.49 ns     73571000
BM_to_chars_bad/24        9.29 ns         9.29 ns     74690000
BM_to_chars_bad/25        9.65 ns         9.65 ns     72877000
BM_to_chars_bad/26        9.78 ns         9.78 ns     70171000
BM_to_chars_bad/27        10.1 ns         10.1 ns     69543000
BM_to_chars_bad/28        10.4 ns         10.4 ns     67582000
BM_to_chars_bad/29       10.00 ns        10.00 ns     70806000
BM_to_chars_bad/30        9.99 ns         9.99 ns     70340000
BM_to_chars_bad/31        9.56 ns         9.56 ns     74159000
BM_to_chars_bad/32        8.97 ns         8.97 ns     78052000
BM_to_chars_bad/33        8.86 ns         8.86 ns     78586000
BM_to_chars_bad/34        8.81 ns         8.81 ns     78562000
BM_to_chars_bad/35        8.90 ns         8.90 ns     77384000
BM_to_chars_bad/36        9.04 ns         9.04 ns     77263000

```

Reviewed By: #libc, ldionne

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

2 years ago[libc++][format] Improves the handle test.
Mark de Wever [Tue, 14 Jun 2022 17:25:42 +0000 (19:25 +0200)]
[libc++][format] Improves the handle test.

A formatter using a handle only needs to satisfy the BasicFormatter
requirements. The current test allowed more than that minimum. Changed
it to the minimum to make sure it works.

This was due to a post-commit review comment of @vitaut in D121530.

Reviewed By: ldionne, vitaut, #libc

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

2 years ago[FunctionPropertiesAnalysis] Generalize support for unreachable
Mircea Trofin [Wed, 15 Jun 2022 23:59:47 +0000 (16:59 -0700)]
[FunctionPropertiesAnalysis] Generalize support for unreachable

Generalized support for subgraphs that get rendered unreachable, for
both `call` and `invoke` cases.

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

2 years ago[AArch64] Move add_and_or_is_add pattern. NFC
David Green [Tue, 21 Jun 2022 15:07:01 +0000 (16:07 +0100)]
[AArch64] Move add_and_or_is_add pattern. NFC

This just moves the add_and_or_is_add further up in the file, so that it
can be shared with SVE as in D128159.

2 years agoRevert rGe6ccb57bb3f6b761f2310e97fd6ca99eff42f73e "[SLP] Add cost model for `llvm...
Nabeel Omer [Tue, 21 Jun 2022 15:05:21 +0000 (15:05 +0000)]
Revert rGe6ccb57bb3f6b761f2310e97fd6ca99eff42f73e "[SLP] Add cost model for `llvm.powi.*` intrinsics"

This reverts commit e6ccb57bb3f6b761f2310e97fd6ca99eff42f73e.

2 years ago[lldb] Skip Recognizer/assert.test on linux
Pavel Labath [Tue, 21 Jun 2022 14:47:08 +0000 (16:47 +0200)]
[lldb] Skip Recognizer/assert.test on linux

-> PR56144

2 years ago[SystemZ] Fix the cost function for vector zero extend.
Jonas Paulsson [Mon, 31 Aug 2020 14:35:39 +0000 (16:35 +0200)]
[SystemZ] Fix the cost function for vector zero extend.

Zero extend of a vector is done with either a single unpack or a vector
permute, and the TTI cost function should reflect this.

Review: Ulrich Weigand

2 years ago[SLP] Add cost model for `llvm.powi.*` intrinsics
Nabeel Omer [Mon, 20 Jun 2022 12:49:25 +0000 (12:49 +0000)]
[SLP] Add cost model for `llvm.powi.*` intrinsics

This patch adds handling for the llvm.powi.* intrinsics in
BasicTTIImplBase::getIntrinsicInstrCost() and improves vectorization.
Closes #53887.

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

2 years ago[llvm][vfs] Implement in-memory symlinks
Jan Svoboda [Tue, 21 Jun 2022 08:20:24 +0000 (10:20 +0200)]
[llvm][vfs] Implement in-memory symlinks

This patch implements symlinks for the in-memory VFS. Original author: @erik.pilkington.

Depends on D117648 & D117649.

Reviewed By: sammccall

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

2 years ago[llvm][vfs] NFC: Promote `InMemoryDirIterator` to nested class
Jan Svoboda [Tue, 21 Jun 2022 14:20:53 +0000 (16:20 +0200)]
[llvm][vfs] NFC: Promote `InMemoryDirIterator` to nested class

2 years ago[llvm][vfs] NFC: Promote `lookupInMemoryNode()` to member function
Jan Svoboda [Tue, 21 Jun 2022 14:16:32 +0000 (16:16 +0200)]
[llvm][vfs] NFC: Promote `lookupInMemoryNode()` to member function

2 years ago[llvm][vfs] NFC: Rename `InMemoryFileSystem::addHardLink()` arguments
Jan Svoboda [Tue, 21 Jun 2022 14:12:09 +0000 (16:12 +0200)]
[llvm][vfs] NFC: Rename `InMemoryFileSystem::addHardLink()` arguments

2 years ago[SLP]Fix a crash when insert subvector is out of range.
Alexey Bataev [Fri, 17 Jun 2022 17:23:12 +0000 (10:23 -0700)]
[SLP]Fix a crash when insert subvector is out of range.

If the OffsetBeg + InsertVecSz is greater than VecSz, need to estimate
the cost as shuffle of 2 vector, not as insert of subvector. Otherwise,
the inserted subvector is out of range and compiler may crash.

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

2 years ago[X86] fold (and (mul x, c1), c2) -> (mul x, (and c1, c2)) iff c2 is all/no bits mask
Simon Pilgrim [Tue, 21 Jun 2022 14:08:39 +0000 (15:08 +0100)]
[X86] fold (and (mul x, c1), c2) -> (mul x, (and c1, c2)) iff c2 is all/no bits mask

Noticed on D128216 - if we're zeroing out vector elements of a mul/mulh result then see if we can merge the and-mask into the mul by just multiplying by zero.

Ideally we'd make this generic (similar to the existing foldSelectWithIdentityConstant?), but these cases are appearing very late, after the constants have been lowered to constant-pool loads.

2 years ago[gn build] Port 6a4056ab2ada
LLVM GN Syncbot [Tue, 21 Jun 2022 14:01:32 +0000 (14:01 +0000)]
[gn build] Port 6a4056ab2ada

2 years ago[ConstraintElimination] Remove unneeded StackEntry::Condition (NFC).
Florian Hahn [Tue, 21 Jun 2022 13:55:30 +0000 (15:55 +0200)]
[ConstraintElimination] Remove unneeded StackEntry::Condition (NFC).

The field was only used for debug printing. Print constraint from the
system instead.

2 years agoRevert "[JITLink][Orc] Add MemoryMapper interface with InProcess implementation"
Nico Weber [Tue, 21 Jun 2022 13:56:49 +0000 (09:56 -0400)]
Revert "[JITLink][Orc] Add MemoryMapper interface with InProcess implementation"

This reverts commit 6ede65205073d3cf6b1ed4d101e66eae3e0fc8e6.
Doesn't build on Windows, see https://reviews.llvm.org/D127491#3598773

2 years ago[AMDGPU] Update SPI_SHADER_PGM_RSRC2_PS.EXTRA_LDS_SIZE for GFX11
Jay Foad [Wed, 6 Apr 2022 09:49:43 +0000 (10:49 +0100)]
[AMDGPU] Update SPI_SHADER_PGM_RSRC2_PS.EXTRA_LDS_SIZE for GFX11

The granularity of SPI_SHADER_PGM_RSRC2_PS.EXTRA_LDS_SIZE changed
in GFX11. It is now in units of 256 dwords instead of 128 dwords.

COMPUTE_PGM_RSRC2.LDS_SIZE is unaffected. It is still in units of
128 dwords.

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

2 years ago[mlir][sparse] Preserve NaNs when converting float to bfloat
Benjamin Kramer [Tue, 21 Jun 2022 13:22:35 +0000 (15:22 +0200)]
[mlir][sparse] Preserve NaNs when converting float to bfloat

2 years agoRevert "[CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux"
David Spickett [Tue, 21 Jun 2022 13:12:38 +0000 (13:12 +0000)]
Revert "[CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux"

This reverts commit 311f7839602344ca347816146edb68c0ffaaa060.

Due to not working for Arm where arm and armhf configs are built.

2 years agoSupport expressions in the context of a reference
Emre Kultursay [Tue, 21 Jun 2022 12:28:53 +0000 (14:28 +0200)]
Support expressions in the context of a reference

...type variable by dereferencing the variable before
evaluating the expression.

Reviewed By: labath

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

2 years ago[GlobalsModRef] Remove check for allocator calls
Nikita Popov [Wed, 8 Jun 2022 08:00:31 +0000 (10:00 +0200)]
[GlobalsModRef] Remove check for allocator calls

As the FIXME already indicates, I don't see why this code would be
necessary. If there's a call to an allocator function, that should
get treated just like any other function call -- usually it will be
a declaration and handled conservatively based on memory attributes
only. There should be no need to explicitly force it to be modref.
No test failures either, so I think this is just dead code.

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

2 years ago[mlir][Linalg] Split reduction transform op
Nicolas Vasilache [Tue, 21 Jun 2022 08:38:54 +0000 (01:38 -0700)]
[mlir][Linalg] Split reduction transform op

This revision separates the `LinalgSplitReduction` pattern, whose application is based on attributes,
from its implementation.
A transform dialect op extension is added to control the application of the transformation at a finer granularity.

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

2 years ago[llvm] Disable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR for Arm Linux
David Spickett [Tue, 21 Jun 2022 11:50:38 +0000 (11:50 +0000)]
[llvm] Disable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR for Arm Linux

I did this before but the other change got reverted and relanded
recently.

arm vs armhf isn't handled correctly so this setting doesn't work
for 32 bit Arm Linux. Causing failures like:
https://lab.llvm.org/buildbot/#/builders/178/builds/2293

2 years ago[gn build] Port 6ede65205073
LLVM GN Syncbot [Tue, 21 Jun 2022 11:45:40 +0000 (11:45 +0000)]
[gn build] Port 6ede65205073

2 years ago[JITLink][Orc] Add MemoryMapper interface with InProcess implementation
Anubhab Ghosh [Tue, 21 Jun 2022 11:44:17 +0000 (13:44 +0200)]
[JITLink][Orc] Add MemoryMapper interface with InProcess implementation

MemoryMapper class takes care of cross-process and in-process address space
reservation, mapping, transferring content and applying protections.

Implementations of this class can support different ways to do this such
as using shared memory, transferring memory contents over EPC or just
mapping memory in the same process (InProcessMemoryMapper).

Reviewed By: sgraenitz, lhames

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

2 years ago[X86] combineAndnp - constant fold ANDNP(C,X) -> AND(~C,X)
Simon Pilgrim [Tue, 21 Jun 2022 11:30:53 +0000 (12:30 +0100)]
[X86] combineAndnp - constant fold ANDNP(C,X) -> AND(~C,X)

If the LHS op has a single use then using the more general AND op is likely to allow commutation, load folding, generic folds etc.

2 years ago[AArch64] Remove unnecessary funnel shift sve costs.
David Green [Tue, 21 Jun 2022 11:21:37 +0000 (12:21 +0100)]
[AArch64] Remove unnecessary funnel shift sve costs.

D127680 added some unnecessary funnel shift costs for AArch64 to "match
the legacy behaviour". The default costs are closer to the correct
values and line up with the scalar/neon costs better. Remove the lines
again to clean up the code, they can be added back at a later date with
better values if needed.

2 years ago[SROA] Migrate tests to opaque pointers (NFC)
Nikita Popov [Fri, 17 Jun 2022 13:19:23 +0000 (15:19 +0200)]
[SROA] Migrate tests to opaque pointers (NFC)

Tests were updated with this script:
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34

However, in this case a lot of fixup was required, due to many
minor, but ultimately immaterial differences in results. In
particular, the GEP representation changes slightly in many cases,
either because we now use an i8 GEP, or because we now leave a
GEP alone, using it's original index types and (lack of) inbounds.

basictest-opaque-ptrs.ll has been dropped, because it was an
opaque pointers duplicate of basictest.ll.

2 years ago[X86] computeKnownBitsForTargetNode - add X86ISD::VBROADCAST_LOAD handling
Simon Pilgrim [Tue, 21 Jun 2022 10:47:51 +0000 (11:47 +0100)]
[X86] computeKnownBitsForTargetNode - add X86ISD::VBROADCAST_LOAD handling

This requires us to override the isTargetCanonicalConstantNode callback introduced in D128144, so we can recognise the various cases where a VBROADCAST_LOAD constant is being reused at different vector widths to prevent infinite loops.

2 years agoRevert "[LLD] [COFF] Use StringTableBuilder to optimize the string table"
Martin Storsjö [Tue, 21 Jun 2022 10:16:00 +0000 (13:16 +0300)]
Revert "[LLD] [COFF] Use StringTableBuilder to optimize the string table"

This reverts commit 9ffeaaa0ea54307db309104696a0b6cce6ddda38.

This fixes debugging large executables with lldb and gdb.

When StringTableBuilder is used, the string offsets for any string
can point anywhere in the string table - while previously, all strings
were inserted in order (without deduplication and tail merging).

For symbols, there's no complications in encoding the string offset;
the offset is encoded as a raw 32 bit binary number in half of the
symbol name field.

For sections, the string table offset is written as
"/<decimaloffset>", but if the decimal offset would be larger than
7 digits, it's instead written as "//<base64offset>". Tools that
operate on object files can handle the base64 offset format, but
apparently neither lldb nor gdb expect that syntax when locating the
debug information section. Prior to the reverted commit, all long
section names were located at the start of the string table, so
their offset never exceeded the range for the decimal syntax.

Just reverting this change for now, as the actual benefit from it
was fairly modest.

Longer term, lld could write all long section names unoptimized
at the start of the string table, followed by all the strings for
symbol names, with deduplication and tail merging. And lldb and
gdb could be fixed to handle sections with the base64 offset syntax.

This fixes https://github.com/mstorsjo/llvm-mingw/issues/289.

2 years ago[SROA] Regenerate test checks (NFC)
Nikita Popov [Tue, 21 Jun 2022 10:23:42 +0000 (12:23 +0200)]
[SROA] Regenerate test checks (NFC)

2 years ago[mlir][OpenMP][NFC] Parameter refers to single args and hence changing description...
Shraiysh Vaishay [Tue, 21 Jun 2022 09:57:01 +0000 (15:27 +0530)]
[mlir][OpenMP][NFC] Parameter refers to single args and hence changing description for taskgroup allocate clause.

2 years ago[ConstraintElimination] Move logic to check condition to helper (NFC).
Florian Hahn [Tue, 21 Jun 2022 09:50:13 +0000 (11:50 +0200)]
[ConstraintElimination] Move logic to check condition to helper (NFC).

2 years ago[clang-tidy][docs] Fix wrong sphinx link after d9afb8c3e8fd01a3c89ab2ddebcd44602a30a975
Balazs Benics [Tue, 21 Jun 2022 09:42:09 +0000 (11:42 +0200)]
[clang-tidy][docs] Fix wrong sphinx link after d9afb8c3e8fd01a3c89ab2ddebcd44602a30a975

There was a copy-paste mistake at the embedded link:
  `clang-tidy/checks/cppcoreguidelines-virtual-class-destructor`
  ->
  `clang-tidy/checks/cppcoreguidelines/virtual-class-destructor`

Sphinx error:
/home/zbebnal/git/llvm-project/clang-tools-extra/docs/ReleaseNotes.rst:168:unknown document: clang-tidy/checks/cppcoreguidelines-virtual-class-destructor

Build bot: https://lab.llvm.org/buildbot#builders/115/builds/29805

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

2 years ago[clang-tidy] cppcoreguidelines-virtual-class-destructor should ignore final classes
Balazs Benics [Tue, 21 Jun 2022 09:02:18 +0000 (11:02 +0200)]
[clang-tidy] cppcoreguidelines-virtual-class-destructor should ignore final classes

The `cppcoreguidelines-virtual-class-destructor` supposed to enforce
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-non-virtual

Quote:
> A **base** class destructor should be either public and virtual, or
> protected and non-virtual
[emphasis mine]

However, this check still rules the following case:

  class MostDerived final : public Base {
  public:
    MostDerived() = default;
    ~MostDerived() = default;
    void func() final;
  };

Even though `MostDerived` class is marked `final`, thus it should not be
considered as a **base** class. Consequently, the rule is satisfied, yet
the check still flags this code.

In this patch, I'm proposing to ignore `final` classes since they cannot
be //base// classes.

Reviewed By: whisperity

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

2 years ago[AArch64] Add Extract(DUP(C)) as a canonical constant.
David Green [Tue, 21 Jun 2022 08:51:22 +0000 (09:51 +0100)]
[AArch64] Add Extract(DUP(C)) as a canonical constant.

As a followup to D128144, this adds extract(DUP(C)) as a canonical
constant to prevent it being transformed back into a BUILD_VECTOR,
leading to an infinite loop.

2 years ago[AMDGPU] Set GFX11 null export target based on export attributes
Carl Ritson [Wed, 28 Jul 2021 10:57:09 +0000 (19:57 +0900)]
[AMDGPU] Set GFX11 null export target based on export attributes

If shader only has depth exports use MRTZ otherwise use MRT0.

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

2 years ago[mlir][SCF] Fold tensor.cast feeding into scf.foreach_thread.parallel_insert_slice
Nicolas Vasilache [Tue, 21 Jun 2022 07:41:31 +0000 (00:41 -0700)]
[mlir][SCF] Fold tensor.cast feeding into scf.foreach_thread.parallel_insert_slice

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

2 years ago[mlir][memref] Fix layout map computation in inferRankReducedResultType
Matthias Springer [Tue, 21 Jun 2022 08:07:52 +0000 (10:07 +0200)]
[mlir][memref] Fix layout map computation in inferRankReducedResultType

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

2 years ago[mlir][SCF] Add scf::ForeachThread canonicalization.
Nicolas Vasilache [Mon, 20 Jun 2022 20:34:51 +0000 (13:34 -0700)]
[mlir][SCF] Add scf::ForeachThread canonicalization.

This revision adds the necessary plumbing for canonicalizing scf::ForeachThread with the
`AffineOpSCFCanonicalizationPattern`.
In the process the `loopMatcher` helper is updated to take OpFoldResult instead of just values.
This allows composing various scenarios without the need for an artificial builder.

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

2 years ago[clang][Analyzer] Add errno state to standard functions modeling.
Balázs Kéri [Tue, 21 Jun 2022 06:29:31 +0000 (08:29 +0200)]
[clang][Analyzer] Add errno state to standard functions modeling.

This updates StdLibraryFunctionsChecker to set the state of 'errno'
by using the new errno_modeling functionality.
The errno value is set in the PostCall callback. Setting it in call::Eval
did not work for some reason and then every function should be
EvalCallAsPure which may be bad to do. Now the errno value and state
is not allowed to be checked in any PostCall checker callback because
it is unspecified if the errno was set already or will be set later
by this checker.

Reviewed By: martong, steakhal

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

2 years agoDon't use Optional::getValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 06:35:53 +0000 (23:35 -0700)]
Don't use Optional::getValue (NFC)

2 years ago[libc++] Implement P0174R2 (Deprecating Vestigial Library Parts in C++17)
Nikolas Klauser [Thu, 16 Jun 2022 09:48:10 +0000 (11:48 +0200)]
[libc++] Implement P0174R2 (Deprecating Vestigial Library Parts in C++17)

Reviewed By: ldionne, Mordante, #libc

Spies: jwakely, libcxx-commits

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

2 years ago[mlir] Don't use Optional::getValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 06:20:25 +0000 (23:20 -0700)]
[mlir] Don't use Optional::getValue (NFC)

2 years ago[machinesink] fix debug invariance issue
Markus Lavin [Tue, 21 Jun 2022 06:08:06 +0000 (08:08 +0200)]
[machinesink] fix debug invariance issue

Do not include debug instructions when comparing block sizes with
thresholds.

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

2 years ago[clang] Don't use Optional::getValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 05:59:26 +0000 (22:59 -0700)]
[clang] Don't use Optional::getValue (NFC)

2 years ago[llvm] Don't use Optional::getValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 05:45:45 +0000 (22:45 -0700)]
[llvm] Don't use Optional::getValue (NFC)

2 years ago[PowerPC][ctrloop] handles calls in preheader before MTCTRloop
Chen Zheng [Tue, 21 Jun 2022 04:26:17 +0000 (00:26 -0400)]
[PowerPC][ctrloop] handles calls in preheader before MTCTRloop

2 years ago[Support/BLAKE3] Do a CMake check for the `-mavx512vl` flag before applying it
Argyrios Kyrtzidis [Tue, 21 Jun 2022 05:03:11 +0000 (22:03 -0700)]
[Support/BLAKE3] Do a CMake check for the `-mavx512vl` flag before applying it

2 years ago[mlir][OpenMP] Add omp.taskgroup operation
Shraiysh Vaishay [Tue, 21 Jun 2022 04:36:54 +0000 (10:06 +0530)]
[mlir][OpenMP] Add omp.taskgroup operation

This patch adds omp.taskgroup operation according to OpenMP 5.0 2.17.6.

Also added tests for the same.

Reviewed By: kiranchandramohan, peixin

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

2 years ago[flang][OpenMP] Fix firstprivate with barrier
Shraiysh Vaishay [Mon, 20 Jun 2022 14:10:44 +0000 (19:40 +0530)]
[flang][OpenMP] Fix firstprivate with barrier

This patch fixes the unintentional data race in firstprivate
implementation. There is a Read-Write race when one thread tries
to copy the value inside the omp.parallel region while other
thread modifies it from inside the region (using pointers or
some other form of indirect access).

For detailed discussion please refer to [[ https://discourse.llvm.org/t/issues-with-the-current-implementation-of-privatization-in-openmp-with-fortran/62335 | discourse ]].

Reviewed By: kiranchandramohan, peixin, NimishMishra

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

2 years ago[Support/BLAKE3] Enable the SIMD implementations for macOS universal builds
Argyrios Kyrtzidis [Sun, 19 Jun 2022 05:32:57 +0000 (22:32 -0700)]
[Support/BLAKE3] Enable the SIMD implementations for macOS universal builds

To accomodate macOS universal configuration include the assembly files
and `blake3_neon.c` without a CMake check but instead guard their source
with architecture "#ifdef" checks.

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

2 years ago[RISCV] Add RISCVISD opcode for PseudoAddTPRel.
Craig Topper [Tue, 21 Jun 2022 03:56:20 +0000 (20:56 -0700)]
[RISCV] Add RISCVISD opcode for PseudoAddTPRel.

Use it along with RISCVISD::HI and ADD_LO to avoid emitting
MachineSDNodes during lowering.

2 years agoRecommit "[RISCV] Enable subregister liveness tracking for RVV."
Craig Topper [Tue, 21 Jun 2022 03:20:00 +0000 (20:20 -0700)]
Recommit "[RISCV] Enable subregister liveness tracking for RVV."

The failure that caused the previous revert has been fixed
by https://reviews.llvm.org/D126048

Original commit message:

RVV makes heavy use of subregisters due to LMUL>1 and segment
load/store tuples. Enabling subregister liveness tracking improves the quality
of the register allocation.

I've added a command line that can be used to turn it off if it causes compile
time or functional issues. I used the command line to keep the old behavior
for one interesting test case that was testing register allocation.

Reviewed By: kito-cheng

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

2 years ago[AARCH64 folding] Do not fold any copy with NZCV
Serguei Katkov [Wed, 8 Jun 2022 12:14:20 +0000 (19:14 +0700)]
[AARCH64 folding] Do not fold any copy with NZCV

There is no instruction to fold NZCV, so, just do not do it.

Without the fix the added test case crashes with an assert
"Mismatched register size in non subreg COPY"

Reviewed By: danilaml
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D127294

2 years agoDon't use Optional::hasValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 03:26:05 +0000 (20:26 -0700)]
Don't use Optional::hasValue (NFC)

2 years agoDon't use Optional::hasValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 03:17:57 +0000 (20:17 -0700)]
Don't use Optional::hasValue (NFC)

2 years agoDon't use Optional::hasValue (NFC)
Kazu Hirata [Tue, 21 Jun 2022 03:05:16 +0000 (20:05 -0700)]
Don't use Optional::hasValue (NFC)

2 years ago[gn build] Port a71fe49bb534
LLVM GN Syncbot [Tue, 21 Jun 2022 02:57:40 +0000 (02:57 +0000)]
[gn build] Port a71fe49bb534

2 years ago[PowerPC] add a new pass to expand ctr loop pseudos
Chen Zheng [Fri, 8 Apr 2022 07:16:05 +0000 (03:16 -0400)]
[PowerPC] add a new pass to expand ctr loop pseudos

This patch implements a new way to generate the CTR loops. Now the
intrinsics inserted in hardware loop pass will be mapped to pseudo
instructions and these pseudo instructions will be expanded to CTR
loop or normal compare+branch loop in this post ISEL pass.

Reviewed By: lkail

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

2 years ago[RISCV] Add merge operand to RISCVISD::VRGATHER*_VL nodes.
Craig Topper [Tue, 21 Jun 2022 01:58:23 +0000 (18:58 -0700)]
[RISCV] Add merge operand to RISCVISD::VRGATHER*_VL nodes.

Use it in place of VSELECT_VL+VRGATHER*_VL.

This simplifies the isel patterns.

Overall, I think trying to match select+op to create masked instructions
in isel doesn't scale. We either need to do it in DAG combine, pre-isel
peepole, or post-isel peephole. I don't yet know which is the right
answer, but for this case it seemed best to be able to request the
masked form directly from lowering.

Reviewed By: frasercrmck

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

2 years ago[SelectionDAG][DAGCombiner] Reuse exist node by reassociate
chenglin.bi [Mon, 20 Jun 2022 10:27:49 +0000 (18:27 +0800)]
[SelectionDAG][DAGCombiner] Reuse exist node by reassociate

When already have (op N0, N2), reassociate (op (op N0, N1), N2) to (op (op N0, N2), N1) to reuse the exist (op N0, N2)

Reviewed By: RKSimon

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

2 years ago[fastregalloc] Enhance the heuristics for liveout in self loop.
Luo, Yuanke [Tue, 21 Jun 2022 00:10:16 +0000 (08:10 +0800)]
[fastregalloc] Enhance the heuristics for liveout in self loop.

For below case, virtual register is defined twice in the self loop. We
don't need to spill %0 after the third instruction `%0 = def (tied %0)`,
because it is defined in the second instruction `%0 = def`.

1 bb.1
2 %0 = def
3 %0 = def (tied %0)
4 ...
5 jmp bb.1

Reviewed By: MatzeB

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

2 years ago[mlir][ods] Remove StructAttr
Mogball [Tue, 21 Jun 2022 00:59:05 +0000 (00:59 +0000)]
[mlir][ods] Remove StructAttr

Depends on D127373

Reviewed By: rriddle

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

2 years ago[X86] Make sure SF is updated when optimizing for `jg/jge/jl/jle`
Phoebe Wang [Tue, 21 Jun 2022 00:40:32 +0000 (08:40 +0800)]
[X86] Make sure SF is updated when optimizing for `jg/jge/jl/jle`

This fixes issue #56103.

Reviewed By: mingmingl

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

2 years ago[Driver] Pass -X to ld for riscv64-fuchsia
Brad Smith [Tue, 21 Jun 2022 01:02:56 +0000 (21:02 -0400)]
[Driver] Pass -X to ld for riscv64-fuchsia

D127826, add support for Fuchsia which uses lld on riscv64

Reviewed By: MaskRay, phosek

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

2 years agoFix build break introduced by https://reviews.llvm.org/D127702
Jeffrey Tan [Tue, 21 Jun 2022 00:21:18 +0000 (17:21 -0700)]
Fix build break introduced by https://reviews.llvm.org/D127702

Fix build break introduced by https://reviews.llvm.org/D127702

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

2 years ago[test][AlwaysInline]:Correct comment and file check for always-inline.ll
archsaxe [Mon, 20 Jun 2022 23:53:03 +0000 (16:53 -0700)]
[test][AlwaysInline]:Correct comment and file check for always-inline.ll

This fixes a useless filecheck and wrong comment for always-inline.ll. Testing
has been done using ninja check-llvm and llvm-lit always-inline.ll --show-all.

Reviewed By: modimo, hoy

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

2 years ago[LLD][COFF] Ignore /pdbcompress flag
Pengxuan Zheng [Mon, 20 Jun 2022 22:14:44 +0000 (15:14 -0700)]
[LLD][COFF] Ignore /pdbcompress flag

Microsoft does not seem to document the flag. Ignoring it for now is probably
better than getting an unknown flag error.

Reviewed By: thakis

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

2 years ago[mlir][math] Lower cos,sin to libm
lewuathe [Mon, 20 Jun 2022 23:29:02 +0000 (08:29 +0900)]
[mlir][math] Lower cos,sin to libm

Lower math.cos and math.sin to libm

Reviewed By: ftynse

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

2 years agoSupport logpoints in lldb-vscode
Jeffrey Tan [Fri, 13 May 2022 18:31:23 +0000 (11:31 -0700)]
Support logpoints in lldb-vscode

This patch implements VSCode DAP logpoints feature (also called tracepoint
in other VS debugger).
This will provide a convenient way for user to do printf style logging
debugging without pausing debuggee.

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

2 years agoRevert "[lld-macho] Show source information for undefined references"
Nico Weber [Mon, 20 Jun 2022 23:15:57 +0000 (19:15 -0400)]
Revert "[lld-macho] Show source information for undefined references"

This reverts commit cd7624f15369f0d395c1edee1a0b9592083d2fe0.
See https://reviews.llvm.org/D128184#3597534