Commit Graph

11173 Commits

Author SHA1 Message Date
LLVM GN Syncbot f493fe34bf [gn build] Port 6c69427e88 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 bac6cd5bf8 2022-04-19 21:23:58 +00:00
LLVM GN Syncbot b5e962a510 [gn build] Port c57f03415f 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 f2526c1a5c 2022-04-16 12:58:04 -04:00
LLVM GN Syncbot 73110f1306 [gn build] Port 721651be24 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 1d83750f63 2022-04-15 11:44:38 +00:00
Nico Weber f097885b07 [gn build] (manually) port 6d45558c1a (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 b9ca972b1f 2022-04-14 18:36:20 +00:00
LLVM GN Syncbot f80e47884c [gn build] Port 1fdf952dee 2022-04-14 15:22:09 +00:00
LLVM GN Syncbot 4f1065156b [gn build] Port e471ba3d01 2022-04-14 14:51:17 +00:00
LLVM GN Syncbot 5bf9aa38ab [gn build] Port 58d9ab70ae 2022-04-14 13:37:28 +00:00
LLVM GN Syncbot 65fcd31ef1 [gn build] Port dd47ab750b 2022-04-14 13:21:19 +00:00
LLVM GN Syncbot 33ab2e3c84 [gn build] Port 73da7eed8f 2022-04-14 13:06:13 +00:00
Nico Weber a29d9ba1f5 Revert "[gn build] Port 73da7eed8fac"
This reverts commit bd4463bebf.
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 6ba1b9075d 2022-04-14 09:08:24 +00:00
LLVM GN Syncbot bd4463bebf [gn build] Port 73da7eed8f 2022-04-14 05:36:21 +00:00
Nico Weber 65d3850efe [gn build] (manually) port ab8abeaf48 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 a85da649b9 2022-04-13 15:05:20 +00:00
LLVM GN Syncbot d1e5854805 [gn build] Port 2fb026ee4d 2022-04-13 13:52:22 +00:00
LLVM GN Syncbot 0242ffd9c0 [gn build] Port 2b424f4ea8 2022-04-13 13:04:50 +00:00
LLVM GN Syncbot 05256c8d95 [gn build] Port e53c461bf3 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
LLVM GN Syncbot dbf1557359 [gn build] Port 95f0f69f1f 2022-04-12 09:55:37 +00:00
LLVM GN Syncbot dbd80d7d27 [gn build] Port 5a5be4044f 2022-04-12 08:49:06 +00:00
Tobias Hieta 1889170aeb workflow: When updating the issueXX branch, use force push
Otherwise if you try to update the branch with a new /cherry-pick
from the same issue you will run into problems similar as to the
one shown in this workflow:
https://github.com/llvm/llvm-project/runs/5864672298?check_suite_focus=true

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D123365
2022-04-12 08:03:59 +02:00
LLVM GN Syncbot ff84cb1660 [gn build] Port 203a1e36ed 2022-04-11 23:49:30 +00:00
Fangrui Song a8ef1647aa [CMake][gn][Bazel] Remove HAVE_PTHREAD_GETSPECIFIC
The only user was removed by d351f54a07.
2022-04-11 14:44:45 -07:00
LLVM GN Syncbot 5ef0ed7d5a [gn build] Port c292b6066c 2022-04-11 14:58:55 +00:00
LLVM GN Syncbot f5d6d13d72 [gn build] Port b4ad28da19 2022-04-11 12:47:08 +00:00
Patryk Wychowaniec d16a631c12 [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts
This commit contains a refactoring that merges AVRRelaxMemOperations
into AVRExpandPseudoInsts, so that we have a single place in code that
expands the STDWPtrQRr opcode.

Seizing the day, I've also fixed a couple of potential bugs with our
previous implementation (e.g. when the destination register was killed,
the previous implementation would try to .addDef() that killed
register, crashing LLVM in the process - that's fixed now, as proved by
the test).

Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D122533
2022-04-11 02:42:13 +00:00
Sheng ba59ec2843 Fix a misuse of `cast`
`cast` will assert instead of returning null pointer.
2022-04-11 01:21:15 +00:00
LLVM GN Syncbot a099bc3c77 [gn build] Port 7aa8c38a9e 2022-04-09 20:16:19 +00:00
LLVM GN Syncbot c6f37ab250 [gn build] Port a96443edde 2022-04-09 14:04:27 +00:00
LLVM GN Syncbot a31cd8c8f2 [gn build] Port 889302292b 2022-04-09 07:40:37 +00:00
Fangrui Song ca68038d12 Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
(With C++ exceptions, `clang++ --target=mips64{,el}-linux-gnu -fpie -pie
-fuse-ld=lld` has link errors (lld does not implement some strange R_MIPS_64
.eh_frame handling in GNU ld). However, sanitizer-x86_64-linux-qemu used this to
build ScudoUnitTests. Pined ScudoUnitTests to -no-pie.)

Default the option introduced in D113372 to ON to match all(?) major Linux
distros. This matches GCC and improves consistency with Android and linux-musl
which always default to PIE.
Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future.

Differential Revision: https://reviews.llvm.org/D120305
2022-04-08 23:40:18 -07:00
Fangrui Song a58d0af058 Revert D121556 "[randstruct] Add randomize structure layout support"
This reverts commit 3f0587d0c6.

Not all tests pass after a few rounds of fixes.

I spot one failure that std::shuffle (potentially different results with
different STL implementations) was misused and replaced it with llvm::shuffle,
but there appears to be another failure in a Windows build.

The latest failure is reported on https://reviews.llvm.org/D121556#3440383
2022-04-08 18:37:26 -07:00
LLVM GN Syncbot 62c8b185ff [gn build] Port 46b2a463bd 2022-04-09 01:14:57 +00:00