Commit Graph

8775 Commits

Author SHA1 Message Date
Nico Weber b9fd375d75 Revert "[lit] Keep original cfg file case around."
This reverts commit bc3f54de18.

The patch breaks in the following two scenarios:

1. When manually passing an absolute path to llvm-lit with a lower-case
   drive letter: `python bin\llvm-lit.py -sv c:\llvm-project\clang\test\PCH`

2. When the PWD has a lower-case drive letter, like after running
   `cd c:\` with a lower-case "c:" (cmd's default is upper-case, but
   it takes case-ness from what's passed to `cd` apparently).
2020-04-15 17:19:39 -04:00
Dimitry Andric 7fb79105fe Use maximum compression when packaging release tarballs.
Summary:
Since a full run of test-release.sh takes many hours (at least on my
poor systems), we might as well spend some extra time compressing the
tarball, in return for a quite a bit of gains for uploading and
downloading it.

As an example, the 10.0.0-rc4 .tar.xz tarball shrinks from 465MiB to
306MiB, about 52% smaller.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76192
2020-04-15 20:30:26 +02:00
Dimitry Andric 9daadcec81 Turn off core dumps before starting the main body of test-release.sh.
Summary:
Some of the regression tests, such as those for the various sanitizers,
use huge shadow memory maps (showing up in top as 20 TiB).  If any of
those ever crashes, your test system's disk will be filled up until
everything falls over.  Set the ulimit for core dumps to 0 to prevent
this problem.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76191
2020-04-15 20:29:40 +02:00
Nico Weber bc3f54de18 [lit] Keep original cfg file case around.
There's been some back and forth if the cfg paths in the
config_map should be normcase()d. The argument for is that
it allows using all-lower spelling in cmd on Windows, the
argument against that doing so is lossy.

Before the relative-paths-in-generated-lit.site.cfg.py work,
there was no downside to calling normcase(), but with it
we need a hack to recover the original case.

This time, normcase() the hashtable key, but store the original
cased key in addition to the value. This fixes both cons, at the
cost of a few bytes more memory.

Differential Revision: https://reviews.llvm.org/D78169
2020-04-15 14:18:11 -04:00
Nico Weber f42baaab4f Remove an apparently unneeded normcase() call.
I believe this call is unneeded after https://reviews.llvm.org/D34855.

Reviewed as part of https://reviews.llvm.org/D78169
2020-04-15 14:02:48 -04:00
Nico Weber 6a887d22a1 Remove a function that has been dead since r313889. 2020-04-15 12:02:30 -04:00
LLVM GN Syncbot b68daf5d06 [gn build] Port 8c11bc0cd0 2020-04-15 09:38:24 +00:00
LLVM GN Syncbot 1e5f149c3c [gn build] Port 44e09b59b8 2020-04-15 06:53:11 +00:00
LLVM GN Syncbot b8aa1e31ea [gn build] Port 2ada8e2525 2020-04-15 06:01:21 +00:00
Matt Arsenault cb5dc3765b TableGen/GlobalISel: Fix constraining REG_SEQUENCE operands
This was hitting the default instruction constraint code which uses
the register classes in the instruction def, which REG_SEQUENCE does
not have.

Fixes not constraining the register class for AMDGPU fneg/fabs
patterns, which would fail when the use was another generic,
unconstrained instruction.

Another oddity I noticed is that the temporary registers are created
with an unnecessary, but incorrect 16-bit LLT but this shouldn't
matter.

I'm also still unclear why root and sub-instructions have to be
handled differently.
2020-04-14 22:05:22 -04:00
LLVM GN Syncbot 7713635074 [gn build] Port ebf190fcda 2020-04-14 22:33:30 +00:00
LLVM GN Syncbot 474b248877 [gn build] Port 8cbe371c28 2020-04-14 22:33:30 +00:00
LLVM GN Syncbot 8d7778ce28 [gn build] Port 204c3b5516 2020-04-14 22:33:29 +00:00
Nico Weber b6b332e3a3 [gn build] (manually) port c8a5b30bac 2020-04-14 12:51:58 -04:00
LLVM GN Syncbot 935b836d65 [gn build] Port 4563024356 2020-04-14 14:20:02 +00:00
LLVM GN Syncbot 2fff0fd0dc [gn build] Port 36c76de678 2020-04-14 09:55:20 +00:00
Julian Lettner 23f896a096 [lit] Update local test objects "in place" from remote test objects
Update local test object "in place" from remote test object.  We need to
do this to ensure that discovered test object which is used for printing
test results reflect the changes.

> Why are we sending back the whole test object from the worker process
> (lit.worker.execute) instead of just the result?

Unfortunately, the test result is not the only "result" of test
execution.  Other members (e.g., xfails, requires) of the Test class are
set only during execution.  Those members affect the behavior of
`isExpectedToFail` and `setResult`, and are accessed when printing
results.  For example, xunit.xml test results include missing features
for "skip reasons".  The lack of separation between an immutable "test
definition" and "generated outputs" (including the primary result and
other secondary state) is unfortunate historical design decision in lit.

> Why do we update the initial test object instead of just discarding it
> and continuing with the pickled test object?

Both of these approaches would work.  However, note that we need a fully
populated test object for printing results.  Updating the existing one
seems to be the easier path.
2020-04-13 21:02:58 -07:00
LLVM GN Syncbot e124e83db6 [gn build] Port 384ca190ae 2020-04-14 00:27:34 +00:00
Nico Weber e27894c99e [gn build] (manually) merge 10df1563d some more 2020-04-13 20:18:47 -04:00
LLVM GN Syncbot 5f9166525b [gn build] Port 10df1563d6 2020-04-13 23:18:41 +00:00
Nico Weber 4d4fef22da Revert a few unsuccessful attempts at fixing bots.
I broke bots last week and tried a few things to fix them.
These were attempts that didn't help, so back them back out.

This reverts commit c7aff9a109.
This reverts commit 8838d6d356.
This reverts commit e875ba1509.
2020-04-13 17:09:21 -04:00
LLVM GN Syncbot bb0e6cc1dd [gn build] Port e823068306 2020-04-13 20:31:14 +00:00
LLVM GN Syncbot c88a567279 [gn build] Port 255cc202ea 2020-04-13 20:31:14 +00:00
Nico Weber 6b4cd6b62d [gn build] (manually) merge 6dbf1a1229 2020-04-13 13:57:20 -04:00
Louis Dionne dd3feecd73 [lit] Print substitutions with --show-suites
We already print available features, and it can be useful to print
substitutions as well since those are a pretty fundamental part of
a test suite. We could also consider printing other things like the
test environment, however the need doesn't appear to be as strong.

As a fly-by fix, we also always print available features, even when
there are none.

Before:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features : -faligned-allocation -fsized-deallocation [...]

After:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features: -faligned-allocation -fsized-deallocation [...]
      Available Substitutions: %{build_module} => [...]
                               %{build} => %{cxx} -o [...]

Differential Revision: https://reviews.llvm.org/D77818
2020-04-13 12:01:12 -04:00
Julian Lettner c610807afe [lit] Temporarily disable failing tests on Windows 2020-04-10 20:03:44 -07:00
Julian Lettner 15000650a6 [lit] Fix tests on Windows
max-time.py:
  Windows does not have a native `sleep` command, use `time.sleep()` in
  Python instead.

max-failures.py:
  The max-failure test reused the shtest-shell test inputs instead of
  defining its own "test domain".  However, the output of this
  shtest-shell "test domain" is slightly different on Windows, which now
  bites us since we made the max-failures test stricter.  Let's define
  our own "max failures" test domain.
2020-04-10 17:33:49 -07:00
Julian Lettner 5925c4a0ff [lit] Increase sleep time in timeout test
Fixup for cbe42a9d5f.  Increase values for testing the overall lit
timeout (--max-time) which wasn't enough for the test to complete on
very slow build bots.
2020-04-10 16:22:00 -07:00
Julian Lettner cbe42a9d5f [lit] Add SKIPPED test result category
Track and print the number of skipped tests.  Skipped tests are tests
that should have been executed but weren't due to:
  * user interrupt [Ctrl+C]
  * --max-time (overall lit timeout)
  * --max-failures

This is part of a larger effort to ensure that all discovered tests are
properly accounted for.

Add test for overall lit timeout feature (`--max-time` option) to
observe skipped tests.  Extend test for `--max-failures` option.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D77819
2020-04-10 15:13:30 -07:00
LLVM GN Syncbot 516a671b89 [gn build] Port ea11f4726f 2020-04-10 18:26:30 +00:00
LLVM GN Syncbot de3122a7e4 [gn build] Port 89f1321fe4 2020-04-10 15:51:31 +00:00
Jinsong Ji 6d7c25bbf9 [NFC][UpdateTestChecks] Fix typos in comments 2020-04-10 15:04:10 +00:00
Nico Weber 1bd70bcd50 [gn build] add scan-build target 2020-04-10 06:18:41 -04:00
Kang Zhang 8633ef0f43 [PowerPC][UpdateTestChecks] Remove the extra # when scrubbing loop comments
Summary:
The patch D63957 is to avoid empty string when scrubbing loop comments,
it will replace loop comments to a `#`, that's correct.
But if the line has something else not only loop comments, we will get
a extra `#`.
The patch is to remove the extra `#`.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D77357
2020-04-10 06:09:01 +00:00
John McCall 8423a6f363 Rename OptimalLayout to OptimizedStructLayout at Chris's request. 2020-04-10 00:14:20 -04:00
LLVM GN Syncbot 39caa68ae1 [gn build] Port 4275eb1331 2020-04-10 03:20:36 +00:00
LLVM GN Syncbot 0bcf2d8864 [gn build] Port 1229245df7 2020-04-10 00:51:20 +00:00
LLVM GN Syncbot 372cc5741e [gn build] Port a79b2fc44b 2020-04-09 22:50:22 +00:00
Kirill Naumov 6f85ec960b [Tools] Fixed bug with llvm/utils/chunk-print-before-all.py script.
Prior to the fix, the script was not annotating the first line of
chunk-0.ll. Because of that, a compilation with ./bin/opt was failing.

The extra if-statement ensures that the corner case is covered

Reviewed-By: apilipenko

Differential Revision: https://reviews.llvm.org/D76507
2020-04-09 22:24:55 +00:00
LLVM GN Syncbot f355e15104 [gn build] Port 44f0d7f136 2020-04-09 11:26:04 +00:00
LLVM GN Syncbot 61151500aa [gn build] Port a0275705bb 2020-04-09 10:13:53 +00:00
LLVM GN Syncbot 84e6d3ca08 [gn build] Port a3dc949000 2020-04-09 05:18:49 +00:00
Johannes Doerfert 0985554b70 [Attributor][NFC] Split AbstractAttributes out of Attributor.cpp
Attributor.cpp became quite big and we need to start provide structure.
The Attributor code is now in Attributor.cpp and the classes derived
from AbstractAttribute are in AttributorAttributes.cpp. Minor changes
were required but no intended functional changes.

We also minimized includes as part of this.

Reviewed By: baziotis

Differential Revision: https://reviews.llvm.org/D76873
2020-04-08 19:02:14 -05:00
LLVM GN Syncbot 072ec965e1 [gn build] Port 8b67853a83 2020-04-08 20:00:26 +00:00
Julian Lettner 0bc2eab6f5 [lit] Print slowest tests and time histogram before result groups 2020-04-07 22:19:50 -07:00
Julian Lettner 414745026c [lit] Improve test summary output
This change aligns the test summary output along the longest
category label.  We also properly align test counts.

Before:
```
Testing Time: 10.30s
  Unsupported Tests  : 1
  Expected Passes    : 30
```

After:
```
Testing Time: 10.29s
  Unsupported Tests:  1
  Expected Passes  : 30
```
2020-04-07 22:19:50 -07:00
LLVM GN Syncbot b21bfcca4a [gn build] Port f85ae058f5 2020-04-08 04:48:03 +00:00
Julian Lettner 09f345080e [lit] Print slowest test first when timing tests
lit supports `--time-tests` which will report the 20 slowest tests and
print a nice histogram for test times.  This change prints this list and
the histogram rows by decreasing test times.  After all, we are most
interested in the slowest tests.
2020-04-07 18:18:33 -07:00
Julian Lettner 2ac96d61c2 [lit] Improve consistency when printing test results 2020-04-07 18:12:18 -07:00
LLVM GN Syncbot 6fa0d0ae11 [gn build] Port 1adeeabb79 2020-04-07 23:30:51 +00:00
LLVM GN Syncbot 1a28d33f37 [gn build] Port 88c2137b6d 2020-04-07 18:26:53 +00:00
Julian Lettner eb5ca295d7 [lit] Cleanup printing of discovered suites and tests 2020-04-07 10:39:35 -07:00
Nico Weber 448b777b86 Stop passing site cfg files via --param to llvm-lit.
This has been unnecessary since https://reviews.llvm.org/D37756.

https://reviews.llvm.org/D37838 removed it for llvm.

This removes it from clang, lld, clang-tools-extra (and the GN build).

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D77585
2020-04-07 08:20:40 -04:00
Julian Lettner 38edab1c40 [lit] Improve handling of parallelism group semaphores 2020-04-06 20:52:06 -07:00
Nico Weber e613f0ee8d Reland "Make llvm_source_root in llvm-lit relative too."
This reverts commit 3185881d69
and adds a missing "include(AddLLVM)" (similar lines already
exist elsewhere in compiler-rt).
2020-04-06 20:49:10 -04:00
Hubert Tong 3185881d69 Revert "Make llvm_source_root in llvm-lit relative too."
This reverts commit 6c1a9fb174.

Commit causes failures:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/49206
2020-04-06 17:29:49 -04:00
Nico Weber 0c9f750a13 [gn build] (manually) port 6c1a9fb174 2020-04-06 16:50:12 -04:00
Nico Weber 6c1a9fb174 Make llvm_source_root in llvm-lit relative too.
No intended behavior change.
2020-04-06 16:47:25 -04:00
Nico Weber cc54466dd9 Delete a variable that's been unused since r313407.
No intended behavior change.
2020-04-06 15:33:50 -04:00
LLVM GN Syncbot f32d4161db [gn build] Port 427c1dc4f4 2020-04-06 19:22:43 +00:00
Louis Dionne 8a42bf24ae [lit] Move the recursiveExpansionLimit setting to TestingConfig
The LitConfig is shared across the whole test suite. However, since
enabling recursive expansion can be a breaking change for some test
suites, it's important to confine the setting to test suites that
enable it explicitly.

Note that other issues were raised with the way recursiveExpansionLimit
operates. However, this commit simply moves the setting to the right
place -- the mechanism by which it works can be improved independently.

Differential Revision: https://reviews.llvm.org/D77415
2020-04-06 13:58:00 -04:00
LLVM GN Syncbot 6ddc525667 [gn build] Port 00a5755897 2020-04-06 17:54:02 +00:00
Nico Weber 2e1afe5232 try to fix tsan bot 2020-04-06 10:47:41 -04:00
Nico Weber d4638cbad7 Make paths in generated llvm-lit relative as well.
This builds on top of D77184. With this, I can rename my build directory
to a different name and `bin/llvm-lit ../llvm-project/clang/test
../llvm-project/llvm/test` still succeeds.

I haven't tried copying the build dir to a different machine to run
tests there yet, but I tried something like it a few months ago and it
worked back then.

Changes:
- Make configure_lit_site_cfg() store the main / generated config pair
  interleaved in the LLVM_LIT_CONFIG_FILES list and postpone converting
  it to python code to llvm-lit's CMakeList.
- Pull the relpath code into a new function make_paths_relative() and
  call that in llvm-lit's CMakeList, prior to converting the list to
  python code.
- Pull the path() function into a variable and use that in llvm-lit's
  CMakeList too.

Differential Revision: https://reviews.llvm.org/D77496
2020-04-06 09:18:23 -04:00
Lang Hames 1b39c6f62c [ORC] Add MachO universal binary support to StaticLibraryDefinitionGenerator.
Add a new overload of StaticLibraryDefinitionGenerator::Load that takes a triple
argument and supports loading archives from MachO universal binaries in addition
to regular archives.

The LLI tool is updated to use this overload.
2020-04-05 20:21:05 -07:00
LLVM GN Syncbot f9b570fbcf [gn build] Port 1d42c0db9a 2020-04-04 00:07:07 +00:00
LLVM GN Syncbot 275ee5d251 [gn build] Port c74dd640fd 2020-04-03 20:07:19 +00:00
Julian Lettner 6f8c45067b [lit] Cleanly exit on user keyboard interrupt
Graceful lit shutdown on user keyboard interrupt [Ctrl+C] was a
longstanding goal of mine.  After a few refactorings this revision
finally enables it.  We use the following strategy to deal with
KeyboardInterrupt:
https://noswap.com/blog/python-multiprocessing-keyboardinterrupt

Printing of a helpful summary for interrupted runs (just as the one for
completed runs) will be tackled in future revisions.

Reviewed By: serge-sans-paille, rnk

Differential Revision: https://reviews.llvm.org/D77365
2020-04-03 13:03:44 -07:00
LLVM GN Syncbot b947a84699 [gn build] Port f95a67d8b8 2020-04-03 19:47:51 +00:00
LLVM GN Syncbot 0a173fd9a5 [gn build] Port d65557d15d 2020-04-03 13:41:09 +00:00
LLVM GN Syncbot 0cfdce26ea [gn build] Port 71e8021d82 2020-04-03 04:56:02 +00:00
Julian Lettner 022f1e2cc8 [lit] Refine filter error handling
Picking a default filter `.*` that matches everything lets us streamline
some error handling code.
2020-04-02 14:45:54 -07:00
Julian Lettner cab904c6d3 [lit] Remove unnecessary indirection in progress_callback
On shutdown, the result complete handler is not racing with the main
thread anymore because we are now always waiting for process pool
termination via
```
  finally:
    pool.join()
```
2020-04-02 14:45:54 -07:00
Duncan P. N. Exon Smith 0c85c488e2 utils: Tweak clang-parse-diagnostics-file for modules includes
Diagnostics from modules do not have a `main-file` listed.  Tweak
`clang-parse-diagnostics-file` to patch this up.  Previously, the call
to `os.path.basename` would crash.

Radar-Id: rdar://problem/59000292
2020-04-02 14:16:26 -07:00
Nico Weber a16ba6fea2 Reland "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang"
The problem on Windows was that the \b in "..\bin" was interpreted
as an escape sequence. Use r"" strings to prevent that.

This reverts commit ab11b9eefa,
with raw strings in the lit.site.cfg.py.in files.

Differential Revision: https://reviews.llvm.org/D77184
2020-04-02 16:12:03 -04:00
Fangrui Song 6acd300375 Reland D75382 "[lld] Initial commit for new Mach-O backend"
With a fix for http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/3636

Also trims some unneeded dependencies.
2020-04-02 12:03:43 -07:00
Nico Weber ab11b9eefa Revert "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang"
This reverts commit fb80b6b2d5 and
follow-up 631ee8b24a.

Seems to not work on Windows:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/31684
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/6512

Let's revert while I investigate.
2020-04-02 15:00:09 -04:00
Nico Weber fb80b6b2d5 Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang
Currently, all generated lit.site.cfg files contain absolute paths.

This makes it impossible to build on one machine, and then transfer the
build output to another machine for test execution. Being able to do
this is useful for several use cases:

1. When running tests on an ARM machine, it would be possible to build
   on a fast x86 machine and then copy build artifacts over after building.

2. It allows running several test suites (clang, llvm, lld) on 3
   different machines, reducing test time from sum(each test suite time) to
   max(each test suite time).

This patch makes it possible to pass a list of variables that should be
relative in the generated lit.site.cfg.py file to
configure_lit_site_cfg(). The lit.site.cfg.py.in file needs to call
`path()` on these variables, so that the paths are converted to absolute
form at lit start time.

The testers would have to have an LLVM checkout at the same revision,
and the build dir would have to be at the same relative path as on the
builder.

This does not yet cover how to figure out which files to copy from the
builder machine to the tester machines. (One idea is to look at the
`--graphviz=test.dot` output and copy all inputs of the `check-llvm`
target.)

Differential Revision: https://reviews.llvm.org/D77184
2020-04-02 13:53:16 -04:00
LLVM GN Syncbot 2e9d223dba [gn build] Port c00cb76274 2020-04-02 16:36:36 +00:00
LLVM GN Syncbot 7ea64499bf [gn build] Port 24bb2d1e77 2020-04-02 16:36:35 +00:00
Nico Weber c886e2be1e Revert "[gn build] Port 03f43b3aca36"
This reverts commit 45b6364e8d,
03f43b3aca was reverted in af39151f3c.
2020-04-02 12:36:06 -04:00
LLVM GN Syncbot ab25d37354 [gn build] Port 5e508b9bac 2020-04-02 11:15:00 +00:00
LLVM GN Syncbot 2a645abe93 [gn build] Port d1705c1196 2020-04-02 10:21:22 +00:00
LLVM GN Syncbot 3d8950bf99 [gn build] Port d08fadd662 2020-04-02 10:21:21 +00:00
Nico Weber 07b6c0be4a [gn build] remove NOSORT from clang/Headers/BUILD.gn
Having the sync script work for this file seems better
than matching the order of headers in the cmake file.
Also, not having to manually sort the list is nice, even
if gn's automated sorting doesn't quite match the artisanal
order in the cmake file.
2020-04-02 06:20:13 -04:00
Kang Zhang 8cc6f5beb8 [NFC][update_llc_test_checks] Remove the redundant SCRUB_LOOP_COMMENT_RE in asm.py
Summary:
In the patch: https://reviews.llvm.org/D42654
De-duplicate utils/update_{llc_,}test_checks.py, Some common part has
been move to common.py. The SCRUB_LOOP_COMMENT_RE has been moved to
common.py, but forgetting to remove from asm.py.
This patch is to remove the redundant SCRUB_LOOP_COMMENT_RE in asm.py
and use common.SCRUB_LOOP_COMMENT_RE.
2020-04-02 09:46:45 +00:00
Julian Lettner c3ef971d36 [lit] Improve handling of timeouts and max failures
This work prepares us for the overall goal of clean shutdown on user
keyboard interrupt [Ctrl+C].
2020-04-02 01:24:02 -07:00
Johannes Doerfert a8b2fed0ae [Utils][FIX] Properly deal with occasionally deleted functions
While D68850 allowed functions to be deleted I accidentally saved some
version of the function to be used once a suitable prefix was found.
This turned out to be problematic when the occasionally deleted function
is also occasionally modified. The test case is adjusted to resemble the
case in which the problem was found.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D76586
2020-04-01 21:56:18 -05:00
Vedant Kumar 3a7865df62 [llvm-locstats] Fix labels on x-axis of comparison chart
Summary:
This change makes the labels on the x-axis of a comparison chart look
like: "0%", "(0%, 10%)", "[10%, 20%)", and so on.

Previously, each label was the same (a concatenation of all the possible
coverage buckets).

Reviewers: djtodoro

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77155
2020-04-01 10:04:01 -07:00
Julian Lettner a3fab31acd [lit] Refine adoption of argparse --version action
The real work for this was already done by serge-sans-paille [1].
Thanks for this!

[1] 1d4849379f
2020-03-31 16:02:16 -07:00
Fangrui Song 45b6364e8d [gn build] Port 03f43b3aca 2020-03-31 12:09:41 -07:00
Fangrui Song eb4663d8c6 [lld][COFF][ELF][WebAssembly] Replace --[no-]threads /threads[:no] with --threads={1,2,...} /threads:{1,2,...}
--no-threads is a name copied from gold.
gold has --no-thread, --thread-count and several other --thread-count-*.

There are needs to customize the number of threads (running several lld
processes concurrently or customizing the number of LTO threads).
Having a single --threads=N is a straightforward replacement of gold's
--no-threads + --thread-count.

--no-threads is used rarely. So just delete --no-threads instead of
keeping it for compatibility for a while.

If --threads= is specified (ELF,wasm; COFF /threads: is similar),
--thinlto-jobs= defaults to --threads=,
otherwise all available hardware threads are used.

There is currently no way to override a --threads={1,2,...}. It is still
a debate whether we should use --threads=all.

Reviewed By: rnk, aganea

Differential Revision: https://reviews.llvm.org/D76885
2020-03-31 08:46:12 -07:00
LLVM GN Syncbot e267dfceeb [gn build] Port 154d517bc7 2020-03-31 14:11:06 +00:00
Guillaume Chatelet c9d5c19597 [Alignment][NFC] Transitionning more getMachineMemOperand call sites
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: arsenm, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, jrtc27, atanasyan, Jim, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77121
2020-03-31 08:36:18 +00:00
LLVM GN Syncbot 0b6f40da45 [gn build] Port 581ba35291 2020-03-31 08:26:13 +00:00
Julian Lettner 1e8900cc82 [lit] Fix test that relied on "single process" mode
The shtest-inject test relied on being executed in "single process" mode
and started to fail with a `PicklingError` after it was removed:
```
  Can't pickle <class 'lit.TestingConfig.CustomFormat'>: attribute
  lookup lit.TestingConfig.CustomFormat failed
```

This happened because the test config has to be serialized to the worker
process, but apparently the `CustomFormat` class defined inline is not
serializable.

This change allows passing the tested functionality (preamble_commands)
directly to `lit.formats.ShTest` so we can use it directly in the test.
2020-03-30 21:58:48 -07:00
Julian Lettner f3c329986c [lit] Remove single process mode
Remove the "serial run" abstraction which bypasses Python's
`multiprocessing.Pool` and instead directly runs tests without spawning
worker processes.  This abstraction has not offered the benefits I hoped
it would and therefore does not carry its weight.
2020-03-30 21:58:48 -07:00
Julian Lettner 357a17e298 [lit] Send back whole lit.Test object from worker process
In previous commits [1,2] I changed worker.py to only send back the test
result from the worker process instead of the whole test object.  This
was a mistake.  lit.Test contains fields (e.g., xfials, requires,
unsupported) that are only populated when we actually execute the test,
but are queried when we report the results in the parent process.  This
commit essentially reverts the following changes:

[1] a3d2f9b53a
[2] 17bb660fb8
2020-03-30 21:58:48 -07:00
Nico Weber 3f5a5dd295 [gn build] re-run "gn format" on all .gn and .gni files 2020-03-30 22:15:26 -04:00
Nico Weber 4ce375a8f2 [gn build] minor tweaks to sync script
- only complain about duplicate 'sources' lines if they contain
  more than 1 elements each (before, 0 and 1 element lists were
  counted too). In practice, this only has an effect for
  clang/lib/Headers/BUILD.gn

- make the '# NOSORT' diag actually work. This too only affects
  clang/lib/Headers/BUILD.gn.

In aggregate, changes to clang/lib/Headers/BUILD.gn still can't
be auto-merged, but for a slighly better reason.
2020-03-30 22:07:23 -04:00
Nico Weber c26a352f23 [gn build] (manually) ort 5074776de4 2020-03-30 22:06:36 -04:00
Julian Lettner d16ba9b0bd [lit] Use Python's support for None in array slice indexing 2020-03-30 12:44:03 -07:00
Nico Weber a235215415 fix a comment grammar-o 2020-03-30 14:40:15 -04:00
LLVM GN Syncbot 8242509a49 [gn build] Port 3cbbded68c 2020-03-30 18:16:33 +00:00
Nico Weber c506adcdf2 Move CLANG_SYSTEMZ_DEFAULT_ARCH to config.h.
Instead of using a global define; see comments on D75914.

While here, port 9c9d88d8b1 to the GN build.
2020-03-30 14:16:17 -04:00
LLVM GN Syncbot 6628c525cb [gn build] Port 854f268ca6 2020-03-29 19:24:34 +00:00
Benjamin Kramer 854f268ca6 [MC] Move deprecation infos from MCTargetDesc to MCInstrInfo
This allows emitting it only when the feature is used by a target.
Shrinks Release+Asserts clang by 900k.
2020-03-29 21:20:40 +02:00
Julian Lettner 8896d12315 [lit] Avoid global imports in module declaration
A previous attempt to cleanup module imports broke installing via
pip/setup.py [1].  This should be fixed now.

[1] cf252240e8

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D76940
2020-03-27 12:07:19 -07:00
LLVM GN Syncbot f8c25945e5 [gn build] Port d60d7d69de 2020-03-27 16:07:06 +00:00
Louis Dionne 08d5426981 [lit] NFC: Move the flaky test logic to _runShTest
This minor refactoring allows reducing the amount of processing that
is duplicated when we re-run a flaky test. It also has the nice
side effect that libc++'s current test format supports flaky .sh.cpp
tests, because those are built on top of _runShTest, not executeShTest.
2020-03-27 09:32:58 -04:00
Louis Dionne faf415a1de [lit] Recursively expand substitutions
This allows defining substitutions in terms of other substitutions. For
example, a %build substitution could be defined in terms of a %cxx
substitution as '%cxx %s -o %t.exe' and the script would be properly
expanded.

Differential Revision: https://reviews.llvm.org/D76178
2020-03-27 09:25:26 -04:00
Fangrui Song 6728a9ae19 [MCInstPrinter] Add parameter `Address` to printCustomAliasOperand. NFC
Follow-up of D72172 and llvmorg-11-init-6896-gb3cc5dcef0f.
2020-03-27 00:38:20 -07:00
Fangrui Song b3cc5dcef0 [MCInstPrinter] Add parameter `Address` to MCInstPrinter::printAliasInstr. NFC
Follow-up of D72172.
2020-03-27 00:03:32 -07:00
LLVM GN Syncbot 196286434d [gn build] Port 9f7d4150b9 2020-03-26 21:10:45 +00:00
Simon Cook 1e30396223 [RISCV] Support negative constants in CompressInstEmitter
Summary:
Some compressed instructions match against negative values; store
immediates as a signed value such that these patterns will now match
the intended instructions.

Reviewers: asb, lenary, PaoloS

Reviewed By: asb

Subscribers: rbar, johnrusso, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, evandro, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76767
2020-03-26 15:23:38 +00:00
Fangrui Song 5fad05e80d [MCInstPrinter] Pass `Address` parameter to MCOI::OPERAND_PCREL typed operands. NFC
Follow-up of D72172 and D72180

This patch passes `uint64_t Address` to print methods of PC-relative
operands so that subsequent target specific patches can change
`*InstPrinter::print{Operand,PCRelImm,...}` to customize the output.

Add MCInstPrinter::PrintBranchImmAsAddress which is set to true by
llvm-objdump.

```
// Current llvm-objdump -d output
aarch64: 20000: bl #0
ppc:     20000: bl .+4
x86:     20000: callq 0

// Ideal output
aarch64: 20000: bl 0x20000
ppc:     20000: bl 0x20004
x86:     20000: callq 0x20005

// GNU objdump -d. The lack of 0x is not ideal because the result cannot be re-assembled
aarch64: 20000: bl 20000
ppc:     20000: bl 0x20004
x86:     20000: callq 20005
```

In `lib/Target/X86/X86GenAsmWriter1.inc` (generated by `llvm-tblgen -gen-asm-writer`):

```
   case 12:
     // CALL64pcrel32, CALLpcrel16, CALLpcrel32, EH_SjLj_Setup, JCXZ, JECXZ, J...
-    printPCRelImm(MI, 0, O);
+    printPCRelImm(MI, Address, 0, O);
     return;
```

Some targets have 2 `printOperand` overloads, one without `Address` and
one with `Address`. They should annotate derived `Operand` properly with
`let OperandType = "OPERAND_PCREL"`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D76574
2020-03-26 08:21:15 -07:00
LLVM GN Syncbot b9943d68d3 [gn build] Port 2aac0c47ae 2020-03-26 15:16:51 +00:00
Louis Dionne 0bd1276eed [lit] NFC: Remove trailing whitespace
I keep having to remove them from my diffs!
2020-03-26 11:05:18 -04:00
Nico Weber 13d267e302 revert parts of d7888149aa that several bots do not like 2020-03-25 14:05:07 -04:00
Nico Weber d7888149aa Suppress a few -Wunreachable-code warnings.
No behavior change. Also fix a comment to say match reality.
2020-03-25 13:55:42 -04:00
Nico Weber 717d7e3f44 [gn build] try removing a duplicate include dir 2020-03-25 13:23:47 -04:00
LLVM GN Syncbot 69def20542 [gn build] Port ce984129ea 2020-03-25 15:36:51 +00:00
LLVM GN Syncbot c2273883e2 [gn build] Port ba1f4405c6 2020-03-25 03:27:56 +00:00
Louis Dionne 8f64b02d33 [lit] Allow passing extra commands to executeShTest
This allows creating custom test formats on top of `executeShTest` that
inject commands at the beginning of the file being parsed, without
requiring these commands to physically appear in the test file itself.

For example, one could define a test format that prints out additional
debug information at the beginning of each test. More realistically,
this has been used to define custom test formats like one that supports
compilation failure tests (e.g. with the extension `compile.fail.cpp`)
by injecting a command that calls the compiler on the file itself and
expects it to fail.

Without this change, the only alternative is to create a temporary file
with the same content as the original test, then prepend the desired
`// RUN:` lines to that file, and call `executeShTest` on that file
instead. This is both slow and cumbersome to do.

Differential Revision: https://reviews.llvm.org/D76290
2020-03-24 15:02:37 -04:00
LLVM GN Syncbot 26d4b5514a [gn build] Port b91905a263 2020-03-24 16:46:53 +00:00
Nico Weber 9ca6334c33 [gn build] (manually) port 8140f6bcde better 2020-03-24 12:39:49 -04:00
Nico Weber e322108667 [gn build] (manually) port 8140f6bcde 2020-03-24 12:38:25 -04:00
Nico Weber 5d29aebf87 [gn build] Port 49e5a97ec3 2020-03-24 12:36:08 -04:00
Simon Pilgrim 8905617ee3 [UpdateTestChecks] Use common ir function name matcher and extend to accept periods in names (PR37586)
Remove the local versions of the IR_FUNCTION_RE matcher (they weren't doing anything different), and ensure all the function name matchers accept '.' and '-'.

We don't need to use '\.' inside python regex sets either, or '\-' as long as thats at the end of the set.
2020-03-24 10:59:30 +00:00
Peter Collingbourne 8140f6bcde scudo: Create a public include directory. NFCI.
For MTE error reporting we will need to expose interfaces for crash handlers
to use to interpret scudo headers and metadata. The intent is that these
interfaces will live in scudo/interface.h.

Move the existing interface.h into an include/scudo directory and make it
independent of the internal headers, so that we will be able to add the
interfaces there.

Differential Revision: https://reviews.llvm.org/D76648
2020-03-23 18:23:29 -07:00
LLVM GN Syncbot defd96f1e3 [gn build] Port 7bf871c39f 2020-03-23 21:05:55 +00:00
LLVM GN Syncbot 75add0b2ef [gn build] Port 56abcfad70 2020-03-23 19:09:57 +00:00
LLVM GN Syncbot 9607a119bd [gn build] Port 57b8a40749 2020-03-23 17:23:22 +00:00
Fangrui Song ff042de67d [gn build] Port 24698e526f. Fix AMDGPUTests 2020-03-23 10:22:40 -07:00
Fangrui Song 552bd477f8 [gn build] Port 24698e526f 2020-03-23 10:04:36 -07:00
LLVM GN Syncbot d779ee152c [gn build] Port 34fd007aaf 2020-03-21 20:48:15 +00:00
LLVM GN Syncbot 9ab0c9a644 [gn build] Port 73cf8abbe6 2020-03-21 12:33:41 +00:00
LLVM GN Syncbot b6d9bfd180 [gn build] Port 0f4c70dd3e 2020-03-21 11:04:46 +00:00
Adrian Kuegel baa6f6a782 Revert "[TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes"
This reverts commit e9f22fd429.

When building with -DLLVM_USE_SANITIZER="Thread", check-llvm has 70
failing tests with this revision, and 29 without this revision.
2020-03-20 11:02:50 +01:00
LLVM GN Syncbot 1d5560c363 [gn build] Port 733b319948 2020-03-19 09:52:27 +00:00
Simon Moll 733b319948 [VP,Integer,#1] Vector-predicated integer intrinsics
Summary:
This patch adds IR intrinsics for vector-predicated integer arithmetic.

It is subpatch #1 of the [integer
slice](https://reviews.llvm.org/D57504#1732277) of
[LLVM-VP](https://reviews.llvm.org/D57504).  LLVM-VP is a larger effort to bring
native vector predication to LLVM.

Reviewed By: andrew.w.kaylor

Differential Revision: https://reviews.llvm.org/D69891
2020-03-19 10:51:47 +01:00
Louis Dionne f951b0f82d [lit] Add builtin support for flaky tests in lit
This commit adds a new keyword in lit called ALLOW_RETRIES. This keyword
takes a single integer as an argument, and it allows the test to fail that
number of times before it first succeeds.

This work attempts to make the existing test_retry_attempts more flexible
by allowing by-test customization, as well as eliminate libc++'s FLAKY_TEST
custom logic.

Differential Revision: https://reviews.llvm.org/D76288
2020-03-18 18:04:01 -04:00
lewis-revill e9f22fd429 [TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes
This patch generates TableGen descriptions for the specified register
banks which contain a list of register sizes corresponding to the
available HwModes. The appropriate size is used during codegen according
to the current HwMode. As this HwMode was not available on generation,
it is set upon construction of the RegisterBankInfo class. Targets
simply need to provide the HwMode argument to the
<target>GenRegisterBankInfo constructor.

The RISC-V RegisterBankInfo constructor has been updated accordingly
(plus an unused argument removed).

Differential Revision: https://reviews.llvm.org/D76007
2020-03-18 19:52:23 +00:00
lewis-revill e225e770f7 [TableGen][GlobalISel] Rework RegisterBankEmitter for easier const correctness.
This patch rewrites the RegisterBankEmitter class to derive
RegisterClassHierarchy from CodeGenTarget::getRegBank() rather than
constructing our own copy. All are now accessed through a const
reference.

Differential Revision: https://reviews.llvm.org/D76006
2020-03-18 19:52:23 +00:00
Nico Weber 642a424bc4 [gn build] remove a workaround that is no longer needed 2020-03-18 12:37:15 -04:00
Nico Weber f57290ec57 [gn build] add rebase changes that should have been in 9f981e9adf 2020-03-18 11:38:37 -04:00
Nico Weber 9f981e9adf Reland "[gn build] (manually) port 8b409eaba"
This reverts commit 4060016fce
and re-merges c5b81466c.
2020-03-18 11:31:18 -04:00
Louis Dionne 1458bb92df [lit] NFC: Fix typo in log statement 2020-03-17 16:49:56 -04:00
LLVM GN Syncbot 5555c04ba9 [gn build] Port 080dd10f7d 2020-03-17 19:45:39 +00:00
LLVM GN Syncbot ad357c1523 [gn build] Port ac1d23ed7d 2020-03-17 13:01:49 +00:00