11188 Commits

Author SHA1 Message Date
Yuanfang Chen
0e554ebf02 [lit][unit] set the default result start and pid
In case of interrupting, there were None. Fixes PR55176.
2022-04-28 13:39:11 -07:00
Nico Weber
de7e539432 [gn build] (manually) port 0f1b5f115a7f 2022-04-28 08:39:12 -04:00
Andrew Savonichev
1041a9642b [lit] Support %if ... %else syntax for RUN lines
This syntax allows to modify RUN lines based on features
available. For example:

    RUN: ... | FileCheck %s --check-prefix=%if windows %{CHECK-W%} %else %{CHECK-NON-W%}
    CHECK-W: ...
    CHECK-NON-W: ...

The whole command can be put under %if ... %else:

    RUN: %if tool_available %{ %tool %} %else %{ true %}

or:

    RUN: %if tool_available %{ %tool %}

If tool_available feature is missing, we'll have an empty command in
this RUN line.  LIT used to emit an error for empty commands, but now
it treats such commands as nop in all cases.

Multi-line expressions are also supported:

    RUN: %if tool_available %{ \
    RUN:   %tool               \
    RUN: %} %else %{           \
    RUN:   true                \
    RUN: %}

Background and motivation:
D121727 [NVPTX] Integrate ptxas to LIT tests
https://reviews.llvm.org/D121727

Differential Revision: https://reviews.llvm.org/D122569
2022-04-27 20:29:08 +03:00
LLVM GN Syncbot
74ddcc2b27 [gn build] Port 6ddf2a824da9 2022-04-27 13:44:43 +00:00
LLVM GN Syncbot
224386679d [gn build] Port 7b81192d462b 2022-04-26 17:42:25 +00:00
Jay Foad
fb571719d5 [TableGen] Dump RC.AllocationPriority with -register-info-debug 2022-04-26 16:29:26 +01:00
LLVM GN Syncbot
86312461b8 [gn build] Port 854c33946fd4 2022-04-26 09:06:40 +00:00
LLVM GN Syncbot
b0d119b583 [gn build] Port b1fa5ac3ba34 2022-04-26 01:46:12 +00:00
Nico Weber
31456ff191 [gn build] Kind of port e6f44a3cd273 (DirectXTests) 2022-04-25 20:25:39 -04:00
Yuanfang Chen
d3efa577f5 [lit] Keep stdout/stderr when using GoogleTest format
When a unit test crashes or timeout, print the shard's stdout and
stderr. When a unit test fails, attaches the test's output to the LIT
output to help debugging.

While at it, concatenating shard's environment variables using space
instead of newline to make the reproducer script user friendly.

Based on D123797. (Thanks to @lenary)
2022-04-25 12:26:03 -07:00
LLVM GN Syncbot
ea8cbd5c58 [gn build] Port 042dc3c46d73 2022-04-25 10:26:57 +00:00
Matt Arsenault
0ecbb683a2 TableGen/GlobalISel: Make address space/align predicates consistent
The builtin predicate handling has a strange behavior where the code
assumes that a PatFrag is a stack of PatFrags, and each level adds at
most one predicate. I don't think this particularly makes sense,
especially without a diagnostic to ensure you aren't trying to set
multiple at once.

This wasn't followed for address spaces and alignment, which could
potentially fall through to report no builtin predicate was
added. Just switch these to follow the existing convention for now.
2022-04-22 15:48:07 -04:00
Nico Weber
3fdc3d63f6 [gn build] (manually) port a7691dee2d3c (TestAST)
This makes clang/lib/Testing the very first non-test()-target that includes
gtest headers, which means it needs an explicit dep on gtest.
2022-04-21 21:37:48 -04:00
serge-sans-paille
af7b98c383 [clang-tblgen] Automatically document options values
This is a port of f5c666742f7bb4ae79ec79c8acf61dced4d37cc9 to clang's tablegen,
with a better wording.

Differential Revision: https://reviews.llvm.org/D123682
2022-04-20 22:00:06 +02:00
Nico Weber
59bd20526c [gn build] (manually) port f26c41e8dd28 (lib/clang/Support) 2022-04-20 09:28:04 -04:00
LLVM GN Syncbot
f493fe34bf [gn build] Port 6c69427e880b 2022-04-20 04:12:02 +00:00
Nico Weber
9973075274 [gn build] port clang-linker-wrapper build file
Tests now try to run it, so we need a build file for it.
2022-04-20 00:11:34 -04:00
LLVM GN Syncbot
858e40d8f3 [gn build] Port bac6cd5bf856 2022-04-19 21:23:58 +00:00
LLVM GN Syncbot
b5e962a510 [gn build] Port c57f03415f96 2022-04-19 20:13:49 +00:00
David Green
cc03414125 [PerfectShuffle] Remove unused variables from D123386. NFC 2022-04-19 16:22:04 +01:00
David Green
73dc996428 [AArch64] Add lane moves to PerfectShuffle tables
This teaches the perfect shuffle tables about lane inserts, that can
help reduce the cost of many entries. Many of the shuffle masks are
one-away from being correct, and a simple lane move can be a lot simpler
than trying to use ext/zip/etc. Because they are not exactly like the
other masks handled in the perfect shuffle tables, they require special
casing to generate them, with a special InsOp Operator.

The lane to insert into is encoded as the RHSID, and the move from is
grabbed from the original mask. This helps reduce the maximum perfect
shuffle entry cost to 3, with many more shuffles being generatable in a
single instruction.

Differential Revision: https://reviews.llvm.org/D123386
2022-04-19 14:49:50 +01:00
David Green
50af82701c [AArch64] Cost all perfect shuffles entries as cost 1
A brief introduction to perfect shuffles - AArch64 NEON has a number of
shuffle operations - dups, zips, exts, movs etc that can in some way
shuffle around the lanes of a vector. Given a shuffle of size 4 with 2
inputs, some shuffle masks can be easily codegen'd to a single
instruction. A <0,0,1,1> mask for example is a zip LHS, LHS. This is
great, but some masks are not so simple, like a <0,0,1,2>. It turns out
we can generate that from zip LHS, <0,2,0,2>, having generated
<0,2,0,2> from uzp LHS, LHS, producing the result in 2 instructions.

It is not obvious from a given mask how to get there though. So we have
a simple program (PerfectShuffle.cpp in the util folder) that can scan
through all combinations of 4-element vectors and generate the perfect
combination of results needed for each shuffle mask (for some definition
of perfect). This is run offline to generate a table that is queried for
generating shuffle instructions. (Because the table could get quite big,
it is limited to 4 element vectors).

In the perfect shuffle tables zip, unz and trn shuffles were being cost
as 2, which is higher than needed and skews the perfect shuffle tables
to create inefficient combinations. This sets them to 1 and regenerates
the tables. The codegen will usually be better and the costs should be
more precise (but it can get less second-order re-use of values from
multiple shuffles, these cases should be fixed up in subsequent patches.

Differential Revision: https://reviews.llvm.org/D123379
2022-04-19 12:05:05 +01:00
Nico Weber
bf59cd7244 [gn build] (manually) port f2526c1a5c6f 2022-04-16 12:58:04 -04:00
LLVM GN Syncbot
73110f1306 [gn build] Port 721651be246e 2022-04-15 19:23:18 +00:00
Daniil Kovalev
b1bb76a731 [NFC][UpdateTestChecks] Fix whitespace in common.py and asm.py
While working on D122986, noticed that indentation size varies even within
one file. Fixed that - now indentation is 2 spaces everywhere. This indentation

Differential Revision: https://reviews.llvm.org/D123859
2022-04-15 18:11:24 +03:00
Roman Lebedev
8fbed6870b
[UpdateTestChecks] Prevent rapid onset insanity when forced to write LoopVectorize-driven costmodel tests
Subj, or on other words, we have a lot of tests that are driven by
the LoopVectorizer's debug output, but we don't have
any meaningful way to autogenerate checklines in them,
which means that an insurmountable amount of manual work
is required when modifying the appropriate cost models.

That is not sustainable, so this presents a solution.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D121133
2022-04-15 15:37:29 +03:00
LLVM GN Syncbot
4dba3d4c53 [gn build] Port 1d83750f631d 2022-04-15 11:44:38 +00:00
Nico Weber
f097885b07 [gn build] (manually) port 6d45558c1a05d (MipsGenPostLegalizeGICombiner) 2022-04-15 07:05:15 -04:00
Daniil Kovalev
8e43cbab33 [UpdateTestChecks] Add NVPTX support in update_llc_test_checks.py
This patch makes possible generating NVPTX assembly check lines with
update_llc_test_checks.py utility.

Differential Revision: https://reviews.llvm.org/D122986
2022-04-15 11:01:53 +03:00
Vitaly Buka
b61f173f24 [lit] Forward more sanitizer env in TestingConfig 2022-04-15 00:50:52 -07:00
Vitaly Buka
43e0cedc1e [NFC] Reformat a part of TestingConfig.py 2022-04-15 00:50:52 -07:00
Xiaodong Liu
2d9b7fdaa3 [utils] Use git to checkout code instead of svn in building docker image
Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D123795
2022-04-15 01:41:14 +00:00
LLVM GN Syncbot
234678fbf9 [gn build] Port b9ca972b1ff0 2022-04-14 18:36:20 +00:00
LLVM GN Syncbot
f80e47884c [gn build] Port 1fdf952deeb9 2022-04-14 15:22:09 +00:00
LLVM GN Syncbot
4f1065156b [gn build] Port e471ba3d0122 2022-04-14 14:51:17 +00:00
LLVM GN Syncbot
5bf9aa38ab [gn build] Port 58d9ab70aef3 2022-04-14 13:37:28 +00:00
LLVM GN Syncbot
65fcd31ef1 [gn build] Port dd47ab750b58 2022-04-14 13:21:19 +00:00
LLVM GN Syncbot
33ab2e3c84 [gn build] Port 73da7eed8fac 2022-04-14 13:06:13 +00:00
Nico Weber
a29d9ba1f5 Revert "[gn build] Port 73da7eed8fac"
This reverts commit bd4463bebfe8545c8e626fc7828beac3509b656f.
Breaks check-clang-tools on Windows, see comment on
https://reviews.llvm.org/D123655
2022-04-14 09:05:11 -04:00
LLVM GN Syncbot
04a3f3f167 [gn build] Port 6ba1b9075dc1 2022-04-14 09:08:24 +00:00
LLVM GN Syncbot
bd4463bebf [gn build] Port 73da7eed8fac 2022-04-14 05:36:21 +00:00
Nico Weber
65d3850efe [gn build] (manually) port ab8abeaf48ab 2022-04-13 20:58:10 -04:00
Arthur Eubanks
2f70fe1b59 [gn build] Set CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL=1
Matches official cmake build.
2022-04-13 16:29:52 -07:00
LLVM GN Syncbot
1203a24764 [gn build] Port a85da649b9ac 2022-04-13 15:05:20 +00:00
LLVM GN Syncbot
d1e5854805 [gn build] Port 2fb026ee4d1a 2022-04-13 13:52:22 +00:00
LLVM GN Syncbot
0242ffd9c0 [gn build] Port 2b424f4ea82e 2022-04-13 13:04:50 +00:00
LLVM GN Syncbot
05256c8d95 [gn build] Port e53c461bf3f0 2022-04-13 05:30:23 +00:00
Yuanfang Chen
cd0a5889d7 [Reland][lit] Use sharding for GoogleTest format
This helps lit unit test performance by a lot, especially on windows. The performance gain comes from launching one gtest executable for many subtests instead of one (this is the current situation).

The shards are executed by the test runner and the results are stored in the
json format supported by the GoogleTest. Later in the test reporting stage,
all test results in the json file are retrieved to continue the test results
summary etc.

On my Win10 desktop, before this patch: `check-clang-unit`: 177s, `check-llvm-unit`: 38s; after this patch: `check-clang-unit`: 37s, `check-llvm-unit`: 11s.
On my Linux machine, before this patch: `check-clang-unit`: 46s, `check-llvm-unit`: 8s; after this patch: `check-clang-unit`: 7s, `check-llvm-unit`: 4s.

Reviewed By: yln, rnk, abrachet

Differential Revision: https://reviews.llvm.org/D122251
2022-04-12 14:51:12 -07:00
Harald van Dijk
3337f50625
[X86] Fix handling of maskmovdqu in x32 differently
This reverts the functional changes of D103427 but keeps its tests, and
and reimplements the functionality by reusing the existing 32-bit
MASKMOVDQU and VMASKMOVDQU instructions as suggested by skan in review.
These instructions were previously predicated on Not64BitMode. This
reimplementation restores the disassembly of a class of instructions,
which will see a test added in followup patch D122449.

These instructions are in 64-bit mode special cased in
X86MCInstLower::Lower, because we use flags with one meaning for subtly
different things: we have an AdSize32 class which indicates both that
the instruction needs a 0x67 prefix and that the text form of the
instruction implies a 0x67 prefix. These instructions are special in
needing a 0x67 prefix but having a text form that does *not* imply a
0x67 prefix, so we encode this in MCInst as an instruction that has an
explicit address size override.

Note that originally VMASKMOVDQU64 was special cased to be excluded from
disassembly, as we cannot distinguish between VMASKMOVDQU and
VMASKMOVDQU64 and rely on the fact that these are indistinguishable, or
close enough to it, at the MCInst level that it does not matter which we
use. Because VMASKMOVDQU now receives special casing, even though it
does not make a difference in the current implementation, as a
precaution VMASKMOVDQU is excluded from disassembly rather than
VMASKMOVDQU64.

Reviewed By: RKSimon, skan

Differential Revision: https://reviews.llvm.org/D122540
2022-04-12 18:32:14 +01:00
Nico Weber
2ac876c52c [gn build] Fix a URL in a comment 2022-04-12 11:38:12 -04:00