Commit Graph

8077 Commits

Author SHA1 Message Date
Johannes Doerfert
904ec54f8e [Utils] Hide the default behavior change of D68819 under a flag
With D69701, the options used when running the script on a file will be
recorded and reused on a rerun. This allows us to hide new features
behind flags, starting with the "define" that was introduced in D68819.
2019-11-01 11:34:00 -05:00
LLVM GN Syncbot
edf77d410d gn build: Merge d36a0333102 2019-11-01 15:17:32 +00:00
Roman Tereshin
a86792ba95 [GlobalISel] Match table opt: fix a bug in matching num of operands
If there is a dag node with a variable number of operands that has at
least N operands (for some non-negative N), and multiple patterns with
that node with different number of operands, we would drop the number of
operands check in patterns with N operands, presumably because it's
guaranteed in such case that none of the per-operand checks will access
the operand list out-of-bounds.

Except semantically the check is about having exactly N operands, not at
least N operands, and a backend might rely on it to disambiguate
different patterns.

In this patch we change the condition on emitting the number of operands
check from "the instruction is not guaranteed to have at least as many
operands as are checked by the pattern being matched" to "the
instruction is not guaranteed to have a specific number of operands".

We're relying (still) on the rest of the CodeGenPatterns mechanics to
validate that the pattern itself doesn't try to access more operands
than there is in the instruction in cases when the instruction does have
fixed number of operands, and on the machine verifier to validate at
runtime that particular MIs like that satisfy the constraint as well.

Reviewers: dsanders, qcolombet

Reviewed By: qcolombet

Subscribers: arsenm, rovka, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69653
2019-11-01 01:57:48 -07:00
Simon Atanasyan
63c8773887 [utils] Reflow asm check generation to tolerate blank lines
This change introduces two fixes. The second fix allows to generate
a test to check the first fix.

- Output `CHECK-EMPTY` prefix for an empty line in ASM output. Before that
  fix `update_llc_test_checks.py` incorrectly emits `CHECK-NEXT: <space>`
  prefix.
- Fix the `ASM_FUNCTION_MIPS_RE` regex to stop on a real function
  epilogue not on an inline assembler prologue and include inline
  assembler code into a test.

Differential Revision: https://reviews.llvm.org/D47192
2019-11-01 09:42:48 +03:00
Matt Arsenault
e736d60a93 Fix update_mir_test_checks after 3598b8100 2019-10-31 20:08:28 -07:00
LLVM GN Syncbot
8d6ff505c0 gn build: Merge e72e59e9028 2019-10-31 23:15:09 +00:00
Peter Collingbourne
71aebd8c16 gn build: Add support for cross-compiling the builtins and profile runtimes for Android aarch64 and arm.
Differential Revision: https://reviews.llvm.org/D69681
2019-10-31 15:47:20 -07:00
Alex Richardson
48c9bf1f95 [update_cc_test_checks.py] Pass the builtin include dir to clang
Summary:
This is required to update tests that make use of builtin headers. To fix
this use the same command expansion as lit does for %clang_cc1. I tested
this by updating clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c.
%clang_cc1 will now expand to `clang -cc1 -internal-isystem
$LLVM_BUILD/lib/clang/$VERSION/include -nostdsysteminc`.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: kristof.beyls, dmgreen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69611
2019-10-31 21:18:33 +00:00
Peter Collingbourne
2bf23c7e0e gn build: s/target_/current_/g in compiler-rt/lib/{builtins,profile}.
Fixes stage2 cross compilation.

Differential Revision: https://reviews.llvm.org/D69680
2019-10-31 14:03:39 -07:00
Nico Weber
aeb961875a Revert "gn build: (manually) merge ec66603ac7"
This reverts commit df899f2272330ef42739500b2f7f25d17d2c8dcb.
Looks like ec66603ac7 was reverted recently.
2019-10-31 16:30:01 -04:00
Nico Weber
6c6e80f196 gn build: (manually) merge ec66603ac7 2019-10-31 16:28:50 -04:00
Johannes Doerfert
649bdfef2e [Utils][FIX] Unbreak update_XXX_test_checks after 3598b810029d
The users of build_function_body_dictionary and add_checks need to be
adjusted after the changes in UpdateTestChecks/common.py.
2019-10-31 13:43:27 -05:00
Julian Lettner
bf5dfd5af4 [lit] Extract Display.print_header function 2019-10-31 11:43:20 -07:00
Julian Lettner
a7dbaf3c9c [lit] Always print newline before test time/summary
Slightly decreases the time I need to parse the test summary.
2019-10-31 11:43:20 -07:00
Joel E. Denny
02f7cc6f6f [lit] Fix internal env calling other internal commands
Without this patch, when using lit's internal shell, if `env` on a lit
RUN line calls `cd`, `mkdir`, or any of the other in-process shell
builtins that lit implements, lit accidentally searches for the latter
as an external executable.

This patch puts such builtins in a map so that boilerplate for them
need be implemented only once.  This patch moves that handling after
processing of `env` so that `env` calling such a builtin can be
detected.  Finally, because such calls appear to be useless, this
patch takes the safe approach of diagnosing them rather than
supporting them.

Reviewed By: probinson, mgorny, rnk

Differential Revision: https://reviews.llvm.org/D66506
2019-10-31 14:37:51 -04:00
Julian Lettner
2b77dc62da [lit] Rename ProgressDisplay -> Display 2019-10-31 10:23:19 -07:00
Nico Weber
f068cde8d0 gn build: (manually) merge cd24a00 more 2019-10-31 09:12:53 -04:00
Nico Weber
d518f5c9d0 gn build: (manually) merge b32bae6f760 2019-10-31 07:38:21 -04:00
Johannes Doerfert
16ae1f547b [Utils] Allow update_test_checks to check function information
Summary:
This adds a switch to the update_test_checks that triggers arguments and
other function annotations, e.g., personality, to be present in the
check line. If not set, the behavior should be the same as before.
If arguments are recorded, their names are scrubbed from the IR to allow
merging.

This patch includes D68153.

Reviewers: lebedev.ri, greened, spatel, xbolva00, RKSimon, mehdi_amini

Subscribers: bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68819
2019-10-30 20:40:42 -05:00
Reid Kleckner
d6b52c4d18 [lit] Add missing import
Apparently llvm-lit.py does not execute this path
2019-10-30 16:32:28 -07:00
Reid Kleckner
fbcf20e723 [lit] Silence warning about importing the resource module on Windows
lit was printing this warning on every test run on Windows, and that is
not necessary.
2019-10-30 16:11:16 -07:00
LLVM GN Syncbot
40640b50a0 gn build: Merge 33a745e6fe7 2019-10-30 22:28:00 +00:00
Julian Lettner
176ef08004 [lit] Change progress bar color to red on first failure 2019-10-30 15:09:43 -07:00
Julian Lettner
1ad1c85e01 [lit] Add helper for test.result.code.isFailure 2019-10-30 15:09:43 -07:00
Julian Lettner
aa70a4bf1b [lit] Extract _install_win32_signal_handler function 2019-10-30 15:09:43 -07:00
LLVM GN Syncbot
b6a2caf574 gn build: Merge cd24a00bd32 2019-10-30 20:20:22 +00:00
LLVM GN Syncbot
5d65b565d1 gn build: Merge b9d8e23b806 2019-10-30 19:36:47 +00:00
LLVM GN Syncbot
53ef52138f gn build: Merge 29dc0b17de6 2019-10-30 17:40:59 +00:00
Nico Weber
0c9af5a142 gn build: (manually) merge 67474c60d34 2019-10-30 11:23:54 -04:00
LLVM GN Syncbot
a11648a1fe gn build: Merge 6bf55804924 2019-10-30 10:43:37 +00:00
Alex Richardson
bc49add214 [UpdateTestChecks] Fix invalid python string escapes 2019-10-30 09:36:20 +00:00
Alex Richardson
4c2f38b670 [update_cc_test_checks.py] Fix invalid python string escape sequence
This works with current python version but will be an error with 3.9
2019-10-30 09:28:51 +00:00
Nico Weber
9ad8425b72 gn build: (manually) merge a34680a3 2019-10-29 21:51:11 -04:00
Julian Lettner
7eb9e9c81c [lit] Refactor ordering of tests 2019-10-29 17:49:23 -07:00
Julian Lettner
eb34e6096d [lit] Small improvements in cl_arguments.py
*) `--max-tests` should be positive integer
*) `--max-time` should be positive integer
*) Remove unnecessary defaults for command line option parsing
2019-10-29 16:46:35 -07:00
Joel E. Denny
84b5bf580c [lit] Extend internal diff to support - argument
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option.  This patch adds support for
`-` to mean stdin.

Reviewed By: probinson, rnk

Differential Revision: https://reviews.llvm.org/D67643
2019-10-29 15:13:53 -04:00
Joel E. Denny
7728e897bd [lit] Make internal diff work in pipelines
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Also, when lit's `diff` prints differences to stdout in Windows, this
patch ensures it always terminate lines with `\n` not `\r\n`.  That
way, strict FileCheck directives checking the `diff` output succeed in
both Linux and Windows.  This wasn't an issue when `diff` was internal
to lit because `diff` didn't then write to the true stdout, which is
where the `\n` -> `\r\n` conversion happened in Python.

Reviewed By: probinson, stella.stamenova

Differential Revision: https://reviews.llvm.org/D66574
2019-10-29 15:13:52 -04:00
Julian Lettner
a8800b4b14 [lit] Remove callback indirection
The callback provides no benefits since `run.execute()` does not take
any arguments anymore.
2019-10-28 18:56:17 -07:00
LLVM GN Syncbot
2693be1daf gn build: Merge 38839d08b8e 2019-10-29 01:06:42 +00:00
Nico Weber
ae15e43f8b gn build: fix bad merge of 75f72f6b done in 3431f1ba 2019-10-28 20:59:11 -04:00
Nico Weber
447c8898f7 gn build: (manually) merge 75f72f6b 2019-10-28 20:56:21 -04:00
Julian Lettner
00b9ef2f1f [lit] Refactor merging of user parameters 2019-10-28 14:11:15 -07:00
Nico Weber
5b7277d05a gn build: (manually) merge d157a9bc
While here, also merge r335850 / r366396.
2019-10-28 14:18:56 -04:00
Julian Lettner
6091e0cde0 [lit] Remove redundant comments from main function
Hopefully the functionality is now clear due to the use of small,
well-named helper functions.
2019-10-28 11:10:07 -07:00
Julian Lettner
550eee0284 [lit] Make main.py a pure Python module
Running it directly as a tool, that is what lit.py is for.
2019-10-28 09:56:37 -07:00
LLVM GN Syncbot
bf030296d6 gn build: Merge 5ab9a850f6b 2019-10-28 06:32:06 +00:00
Matt Arsenault
8da126d330 TableGen: Use enum names in composeSubRegIndices table
I'm not sure why this is using the raw enum value. This makes reading
the generated table comprehensible.
2019-10-27 21:26:56 -07:00
Alex Lorenz
b8517ab3f5 [lit] Drop the user-site packages directory from search paths when running tests
Do not add user-site packages directory to the python search path.
This avoids test failures if there's an incompatible lit module installed
inside the user-site packages directory, as it gets prioritized over the lit
from the PYTHONPATH.
2019-10-27 13:31:02 -07:00
Julian Lettner
75b07a59d8 [lit] Move sharding logic into separate function 2019-10-25 16:23:52 -07:00
Joel E. Denny
728fa0079b [lit] Don't fail when printing test output with special chars
This addresses a UnicodeEncodeError when using Python 3.6.5 in Windows
10.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D69207
2019-10-25 18:13:13 -04:00