Commit Graph

8775 Commits

Author SHA1 Message Date
Julian Lettner 840bc47f8b [lit] Extract by_suite_and_test_path sort key function 2020-05-01 17:03:55 -07:00
Julian Lettner 3eb1d7ffb5 [lit] Create report generators during argument parsing 2020-05-01 17:03:55 -07:00
Julian Lettner 201e73cbbb [lit] Small refinements for xunit report output 2020-05-01 17:03:55 -07:00
Julian Lettner 7ffb5bc2a2 [lit] Factor out report generators into separate file
Factor out the report generators from main.py into reports.py.

I verified that we generate the exact same output by running `check-all`
and comparing the new and old output for both report flavors.
2020-05-01 17:03:55 -07:00
Julian Lettner 11e02d5c24 [lit] Only update specific fields from remote test object
Don't update whole test object from the remote (pickled) finished test
object.  Doing so also changes the config and suite members, which we
want to avoid.
2020-05-01 17:03:54 -07:00
LLVM GN Syncbot e676076c25 [gn build] Port 6cb073133c 2020-05-02 00:00:04 +00:00
Julian Lettner 70605ff452 [lit] Don't crash for --time-tests in aborted test run
Properly print the test times histogram even for aborted (user
interrupt, [Ctrl+C]) test runs.
2020-04-30 18:19:15 -07:00
Julian Lettner 8cb8fe909b [lit] Add EXCLUDED test result category
Track and print the number of tests that were discovered but not
executed due to test selection options:
  * --filter (regex filter)
  * --max-tests (limits number of tests)
  * sharding feature

With this change all discovered tests are accounted for: every
discovered test is included in one of the counts printed in the summary.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D78078
2020-04-30 17:58:11 -07:00
LLVM GN Syncbot 0ae6282389 [gn build] Port cfea3dc102 2020-04-30 22:15:14 +00:00
Julian Lettner 3cd6e02920 [lit] Push computation of workers into run_tests
This also avoids assigning to the option object.
2020-04-30 13:49:30 -07:00
Hans Wennborg 88aad9b9f0 lit googletest.py: Don't raise StopIteration in generator
The intention here seems to be to end the generator function, but with
modern Python, raising StopIteration causes a runtime error
(https://www.python.org/dev/peps/pep-0479/).

Differential revision: https://reviews.llvm.org/D79169
2020-04-30 18:16:17 +02:00
Julian Lettner fbdcfcd4c3 [lit] Provide extension API for custom result categories
The lnt test suite defines custom result codes [1].  Support those via
an extension API instead of "by accident", which should offer the
advantage of properly handling them when we print test results.

[1] https://reviews.llvm.org/D77986

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D78164
2020-04-29 19:45:55 -07:00
LLVM GN Syncbot 85aee35d82 [gn build] Port 9854edd817 2020-04-29 22:52:50 +00:00
Nico Weber aa545dcec1 [gn build] (manually) port ad97ccf6b2 2020-04-29 11:51:22 -04:00
Nico Weber 7585ac79dd Reland "[gn build] (manually) merge c4c3883"
The Python3 change relanded yet again, so merge it yet again.

This reverts commit f0019cdc47.
This reverts commit 854a7db46c.
2020-04-28 21:43:58 -04:00
LLVM GN Syncbot 2dd4596e2a [gn build] Port 8683f5de53 2020-04-29 00:53:06 +00:00
Nico Weber f0019cdc47 [gn build] fix typo 2020-04-28 20:52:51 -04:00
Nico Weber 854a7db46c Revert "[gn build] (manually) merge c4c3883"
This reverts commit cbaa74a098.
The Py3 change got (mostly, except compiler-rt) reverted again.
2020-04-28 20:48:29 -04:00
Reid Kleckner cbaa74a098 [gn build] (manually) merge c4c3883
PYTHON_EXECUTABLE changed to Python3_EXECUTABLE in the lit test suite.

Committing without review, since the gn build is currently broken. Going
forward, more gn build changes may be necessary to get gn to find Python
3 instead of Python 2.
2020-04-28 10:24:11 -07:00
Nico Weber cbb61831f5 Revert "[gn build] (manually) merge cd84bfb8142bc7ff3a0"
This reverts commit 825f583c86.
This reverts commit 45417ecbc1.

cd84bfb814 was reverted in be884b7935
2020-04-27 23:31:46 -04:00
Nico Weber 825f583c86 [gn build] (manually) merge cd84bfb814 more precisely 2020-04-27 21:55:02 -04:00
Nico Weber 45417ecbc1 [gn build] (manually) merge cd84bfb814 2020-04-27 21:45:58 -04:00
Nico Weber d9541b18e3 Revert "[gn build] (manually) merge 811c0c9eb46"
This reverts commit b160e9e539.
811c0c9eb4 was reverted in 96717125e8.
2020-04-27 09:00:21 -04:00
Nico Weber b160e9e539 [gn build] (manually) merge 811c0c9eb4 2020-04-27 06:39:40 -04:00
Benjamin Kramer ed766f1bb1 Sort EnumAttr so it matches Attribute::operator<
This means AttrBuilder will always create a sorted set of attributes and
we can skip the sorting step. Sorting attributes is surprisingly
expensive, and I recently made it worse by making it use array_pod_sort.
2020-04-26 17:00:25 +02:00
Fangrui Song 7016a4b5c3 llvm-tblgen -gen-dag-isel: Hoist SmallVector TmpBuf 2020-04-25 20:41:04 -07:00
Fangrui Song 58dbd5befd llvm-tblgen -gen-dag-isel: Reduce lib/Target/*/*GenDAGISel.inc
X86GenDAGISel.inc: 22597697 bytes -> 20874981 bytes
2020-04-25 20:02:04 -07:00
Fangrui Song 94d331a718 [X86] Shrink lib/Target/X86/X86GenDisassemblerTables.inc
6330853 bytes -> 5207842 bytes
2020-04-25 19:44:32 -07:00
Nico Weber 6121122a3b [gn build] update two comments 2020-04-24 11:52:49 -04:00
LLVM GN Syncbot 531bfa3e02 [gn build] Port 7aaff8fd2d 2020-04-24 15:06:14 +00:00
Nico Weber 446082b99f [gn build] minimally merge 67b2dbd5a3 even more 2020-04-24 11:05:58 -04:00
Nico Weber 76ea360036 [gn build] minimally merge 67b2dbd5a3 more 2020-04-24 10:23:22 -04:00
Nico Weber 0efb958bde [gn build] minimally merge 67b2dbd5a3 2020-04-24 09:58:19 -04:00
Nico Weber aed67a3df7 [gn build] (manually) merge 8f766e382b in a minimal way 2020-04-24 09:33:35 -04:00
Alex Richardson f50bc823fe [UpdateTestChecks] Make generation of UTC_ARGS: comment more robust
We now use the argparse Action objects to determine the name of the flags.
This fixes cases where the key for the stored result ('dest') is not the
same as the command line flag (e.g. --enable/--disable).
Also add a test that --disabled can be part of the initial UTC_ARGS.

This is split out from D78478

Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D78617
2020-04-23 13:12:27 +01:00
LLVM GN Syncbot dad6de4112 [gn build] Port 2360933147 2020-04-21 23:36:07 +00:00
LLVM GN Syncbot 67c6b80569 [gn build] Port 352fef3f11 2020-04-21 21:22:08 +00:00
LLVM GN Syncbot 73ea427818 [gn build] Port 060efd24c7 2020-04-21 21:22:07 +00:00
LLVM GN Syncbot 5a2a24f1e9 [gn build] Port 2214b9076f 2020-04-21 08:34:22 +00:00
Sriraman Tallam 365b60fc93 New pass to make internal linkage symbol names unique.
With clang option -funique-internal-linkage-symbols, symbols with
internal linkage get names with the module hash appended.

Differential Revision: https://reviews.llvm.org/D78243
2020-04-20 15:05:22 -07:00
LLVM GN Syncbot aa688ba047 [gn build] Port 12030494fc 2020-04-20 13:10:45 +00:00
Georgii Rymar 76e0ab23f6 [FileCheck] - Refactor the code related to string arrays. NFCI.
There are few `std::vector<std::string>` members in
`FileCheckRequest`. This patch changes these arrays to `std::vector<StringRef>`
and refactors the code related to cleanup/improve/simplify it.

Differential revision: https://reviews.llvm.org/D78202
2020-04-20 14:54:49 +03:00
Fangrui Song 041a3557f0 [CMake] Delete HAVE_SCHED_GETAFFINITY and HAVE_CPU_COUNT
sched_getaffinity (Linux specific) has been available

* in glibc since 2002-08-08 (commit 972e719e8154eec5f543b027e2a08dfa285d55d5)
* in musl since the initial check-in.
2020-04-19 08:50:23 -07:00
Luís Marques 60ce987bf3 [RISCV][PowerPC] Fix google/benchmark benchmark::cycleclock::Now
Cherrypick the upstream fix commit a77d5f7 onto llvm/utils/benchmark
and libcxx/utils/google-benchmark.
This fixes LLVM's 32-bit RISC-V compilation, and the issues
mentioned in https://github.com/google/benchmark/pull/955
An additional cherrypick of ecc1685 fixes some minor formatting
issues introduced by the preceding commit.

Differential Revision: https://reviews.llvm.org/D78084
2020-04-18 09:32:19 +01:00
LLVM GN Syncbot 7b72a17ee7 [gn build] Port 66037b84cf 2020-04-17 22:33:56 +00:00
LLVM GN Syncbot cceaf6b8ff [gn build] Port ff9379f4b2 2020-04-17 09:27:53 +00:00
LLVM GN Syncbot 634f173830 [gn build] Port 953a814aae 2020-04-17 00:58:15 +00:00
Joel E. Denny ce685455e4 [FileCheck] Fix --dump-input annotation sort per input line
Without this patch, `--dump-input` annotations on a single input line
are sorted by the associated directive's check-file line.  That seemed
fine because that's often identical to the order in which FileCheck
looks for matches for those directives.

The first problem is that an `--implicit-check-not` pattern has no
check-file line.  The logical equivalent is sorting in command-line
order, but that's not implemented.

The second problem is that, unlike a directive, an
`--implicit-check-not` pattern applies at many points, between many
different pairs of directives.  However, sorting in command-line order
gathers all its associated diagnostics together at one point in an
input line's list of annotations.

In general, it seems to be easier to understand FileCheck's logic when
annotations on a single input line are sorted in the order FileCheck
produced the associated diagnostics, so this patch makes that change.
As documented in the patch, the annotation sort order is also
especially relevant to `CHECK-LABEL`, `CHECK-NOT`, and `CHECK-DAG`, so
this patch updates or extends tests to check the sort makes sense for
them.  (However, the sort for `CHECK-DAG` annotations should not
actually be altered by this patch.)

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D77607
2020-04-16 15:39:35 -04:00
Joel E. Denny b5a24610fa [FileCheck] Fix --dump-input implicit pattern location
Currently, `--dump-input` implies that all `--implicit-check-not`
patterns appear on line 1 by printing annotations like:

```
       1: foo bar baz
not:1         !~~     error: no match expected
```

This patch changes that to:

```
          1: foo bar baz
not:imp1         !~~     error: no match expected
```

`imp1` indicates the first `--implicit-check-not` pattern.

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D77605
2020-04-16 15:39:35 -04:00
LLVM GN Syncbot 6aac98f4dd [gn build] Port d9085f65db 2020-04-16 17:47:41 +00:00
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