Commit Graph

8306 Commits

Author SHA1 Message Date
LLVM GN Syncbot fa03665e86 gn build: Merge f0af11d86f 2019-11-08 20:48:12 +00:00
Kristof Beyls 1f592ecf82 find_interesting_reviews.py: avoid crash on non-ascii data. 2019-11-08 14:51:36 +00:00
LLVM GN Syncbot f96de25739 gn build: Merge 0dc0572b48 2019-11-08 14:31:11 +00:00
LLVM GN Syncbot b4237db295 gn build: Merge 25ee861372 2019-11-07 22:43:50 +00:00
Simon Pilgrim bcd7674e06 AsmWriterOperand - fix uninitialized variable warning. NFCI. 2019-11-07 16:56:15 +00:00
Nico Weber fe6fee9445 Revert "gn build: (manually) merge b5913e6d2f"
This reverts commit c52efdc52c,
because b5913e6d2f got reverted.
2019-11-06 20:52:29 -05:00
Matt Arsenault 9f9f42dbc5 TableGen: Remove assert that pattern results match input number
AMDGPU has some atomic instructions that do not return the previous
result, and can only be selected if there are no uses. The source
pattern will only match if the use is empty, so it should be safe to
discard the result.
2019-11-06 16:06:37 -08:00
Nico Weber c52efdc52c gn build: (manually) merge b5913e6d2f 2019-11-06 18:26:56 -05:00
Joel E. Denny 6cecd3c3db [lit] Protect full test suite from FILECHECK_OPTS
lit's test suite calls lit multiple times for various sample test
suites.  `FILECHECK_OPTS` is safe for FileCheck calls in lit's test
suite.  It's not safe for FileCheck calls in the sample test suites,
whose output affects the results of lit's test suite.

Without this patch, only one such sample test suite is protected from
`FILECHECK_OPTS`, and currently `shtest-shell.py` breaks with
`FILECHECK_OPTS=-vv`.  Moreover, it's hard to predict the future,
especially false passes.  Thus, this patch protects all existing and
future sample test suites from `FILECHECK_OPTS` (and the deprecated
`FILECHECK_DUMP_INPUT_ON_FAILURE`).

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D65156
2019-11-06 16:25:25 -05:00
Simon Pilgrim cca01c0347 CodeGenInstruction - fix uninitialized variable warnings. NFCI. 2019-11-06 17:04:21 +00:00
Simon Pilgrim cfc385d954 X86FoldTablesEmitter - fix static analyzer potential invalid iterator warning. NFCI. 2019-11-06 13:31:00 +00:00
LLVM GN Syncbot 1a6903bdfe gn build: Merge 24130d661e 2019-11-06 08:29:28 +00:00
Volodymyr Sapsai 39573daa76 Revert "[analyzer] Add test directory for scan-build."
This reverts commit 0aba69eb1a with
subsequent changes to test files.

It caused test failures on GreenDragon, e.g.,
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/
2019-11-05 14:03:36 -08:00
Julian Lettner d77ef856fc Revert "[lit] Better/earlier errors when no tests are executed"
This reverts commit d8f2bff751.
2019-11-05 12:10:43 -08:00
Joel E. Denny f1b4c4bfd0 [lit] Fix `not` calling internal commands
Without this patch, when using lit's internal shell, if `not` on a lit
RUN line calls `env`, `diff`, or any of the other in-process shell
builtins that lit implements, lit accidentally searches for the latter
as an external executable.  What's worse is that works fine when a
developer is testing on a platform where those executables are
available and behave as expected, but it then breaks on other
platforms.

`not` seems useful for some builtins, such as `diff`, so this patch
supports such uses.  `not --crash` does not seem useful for builtins,
so this patch diagnoses such uses.  In all cases, this patch ensures
shell builtins are found behind any sequence of `env` and `not`
commands.

`not` calling `env` calling an external command appears useful when
the `env` and external command are part of a lit substitution, as in
D65156.  This patch supports that by looking through any sequence of
`env` and `not` commands, building the environment from the `env`s,
and storing the `not`s.  The `not`s are then added back to the command
line without the `env`s to execute externally.  This avoids the need
to replicate the `not` implementation, in particular the `--crash`
option, in lit.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D66531
2019-11-05 14:09:21 -05:00
jmolloy 39525a6723 [DFAPacketizer] Allow up to 64 functional units
Summary:
To drive the automaton we used a uint64_t as an action type. This
contained the transition's resource requirements as a conjunction:

  (a OR b) AND (b OR c)

We encoded this conjunction as a sequence of four 16-bit bitmasks.
This limited the number of addressable functional units to 16, which
is quite low and has bitten many people in the past.

Instead, the DFAEmitter now generates a lookup table from InstrItinerary
class (index of the ItinData inside the ProcItineraries) to an internal
action index which is essentially a dense embedding of the conjunctive
form. Because we never materialize the conjunctive form, we no longer
have the 16 FU restriction.

In this patch we limit to 64 functional units due to using a uint64_t
bitmask in the DFAEmitter. Now that we've decoupled these representations
we can increase this in future.

Reviewers: ThomasRaoux, kparzysz, majnemer

Reviewed By: ThomasRaoux

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69110
2019-11-05 15:41:42 +00:00
Devin Coughlin 0aba69eb1a [analyzer] Add test directory for scan-build.
The static analyzer's scan-build script is critical infrastructure but
is not well tested. To start to address this, add a new test directory under
tests/Analysis for scan-build lit tests and seed it with several tests. The
goal is that future scan-build changes will be accompanied by corresponding
tests.

Differential Revision: https://reviews.llvm.org/D69781
2019-11-04 20:26:35 -08:00
Julian Lettner bd14bb42f0 [lit] Move measurement of testing time out of Run.execute 2019-11-04 10:16:24 -08:00
Julian Lettner d8f2bff751 [lit] Better/earlier errors when no tests are executed
Fail early, when we discover no tests at all, or filter out all of them.
2019-11-04 10:16:24 -08:00
LLVM GN Syncbot 667223c3ed gn build: Merge 40d0d4e233 2019-11-04 17:20:23 +00:00
Nico Weber 4168a2e9de gn build: (manually) merge 51b4b17eb
Also reverts r353980 since that duplicated the GenAsmMatcher target for
AArch64. Instead use visiblity.
2019-11-04 09:51:41 -05:00
Nico Weber 9cd13deb29 gn build: run "gn format" 2019-11-04 09:50:16 -05:00
Nico Weber a3915ca9f9 gn build: add deps, see discussion on D69130 2019-11-04 09:22:12 -05:00
Nico Weber ce7d5a6bbe gn build: (manually) merge 3a399c09 / add76dd3c 2019-11-03 12:52:54 -05:00
Simon Pilgrim 2b2adef03d Stop static analyzer warnings about using bitwise operators on booleans. NFCI.
Call each of the rebase_if() calls separately.
2019-11-02 22:40:04 +00:00
Simon Pilgrim 43fe9afa4f MatchTableRecord::emit - fix boolean operator precedence warnings from PVS Studio. NFCI.
Make it clear that (Flags & MTRF_????) should resolve to a boolean.
2019-11-02 21:04:07 +00:00
Dávid Bolvanský fe1a1d5aae Revert "[Codegen] Both sides of '&&' are same; fixed"
This reverts commit edb42dccfa. Buildbot timeouts.
2019-11-02 19:02:33 +01:00
Dávid Bolvanský edb42dccfa [Codegen] Both sides of '&&' are same; fixed
Summary:
Found by PVS Studio

Not familiar with this code; no testcase.

Reviewers: craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69741
2019-11-02 16:43:16 +01:00
Joel E. Denny cb2c4bb0e0 [lit] Fix internal env calling env
Without this patch, when using lit's internal shell, if `env` on a lit
RUN line calls `env`, lit accidentally searches for the latter as an
external executable.  What's worse is that works fine when a developer
is testing on a platform where `env` is available and behaves as
expected, but it then breaks on other platforms.

`env` calling `env` can make sense if one such `env` is within a lit
substitution, as in D65156 and D65121.  This patch ensures that lit
executes both as internal commands.

Reviewed By: probinson, mgorny, rnk

Differential Revision: https://reviews.llvm.org/D65697
2019-11-01 14:08:52 -04:00
Johannes Doerfert e67f6477fd [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 449882b544 gn build: Merge d36a033310 2019-11-01 15:17:32 +00:00
Roman Tereshin 6082a062a7 [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 a8a89c77ea [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 10c1d0a452 Fix update_mir_test_checks after 3598b8100 2019-10-31 20:08:28 -07:00
LLVM GN Syncbot bbbd22e645 gn build: Merge e72e59e902 2019-10-31 23:15:09 +00:00
Peter Collingbourne 7c86c70f26 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 d9cc7d1408 [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 d47133adad 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 d6bb256b44 Revert "gn build: (manually) merge ec66603ac7"
This reverts commit df899f2272.
Looks like ec66603ac7 was reverted recently.
2019-10-31 16:30:01 -04:00
Nico Weber df899f2272 gn build: (manually) merge ec66603ac7 2019-10-31 16:28:50 -04:00
Johannes Doerfert 4de09e0f44 [Utils][FIX] Unbreak update_XXX_test_checks after 3598b81002
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 20bb48c7a7 [lit] Extract Display.print_header function 2019-10-31 11:43:20 -07:00
Julian Lettner bbebdbbd20 [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 0d4e6519c5 [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 62c0746896 [lit] Rename ProgressDisplay -> Display 2019-10-31 10:23:19 -07:00
Nico Weber e491e82639 gn build: (manually) merge cd24a00 more 2019-10-31 09:12:53 -04:00
Nico Weber 7e23f88d7d gn build: (manually) merge b32bae6f76 2019-10-31 07:38:21 -04:00
Johannes Doerfert 3598b81002 [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 3dec30855e [lit] Add missing import
Apparently llvm-lit.py does not execute this path
2019-10-30 16:32:28 -07:00
Reid Kleckner 5632d3756c [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 b1209d74e3 gn build: Merge 33a745e6fe 2019-10-30 22:28:00 +00:00
Julian Lettner 577dca62e9 [lit] Change progress bar color to red on first failure 2019-10-30 15:09:43 -07:00
Julian Lettner 89e34d3e5a [lit] Add helper for `test.result.code.isFailure` 2019-10-30 15:09:43 -07:00
Julian Lettner 4dba95f0dd [lit] Extract `_install_win32_signal_handler` function 2019-10-30 15:09:43 -07:00
LLVM GN Syncbot e62f91fb75 gn build: Merge cd24a00bd3 2019-10-30 20:20:22 +00:00
LLVM GN Syncbot 88d77fce94 gn build: Merge b9d8e23b80 2019-10-30 19:36:47 +00:00
LLVM GN Syncbot 5cc605bcc1 gn build: Merge 29dc0b17de 2019-10-30 17:40:59 +00:00
Nico Weber 37e10c2929 gn build: (manually) merge 67474c60d3 2019-10-30 11:23:54 -04:00
LLVM GN Syncbot 9c273becce gn build: Merge 6bf5580492 2019-10-30 10:43:37 +00:00
Alex Richardson 2dad717c9a [UpdateTestChecks] Fix invalid python string escapes 2019-10-30 09:36:20 +00:00
Alex Richardson 4a372093e7 [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 4d06ea83cc gn build: (manually) merge a34680a3 2019-10-29 21:51:11 -04:00
Julian Lettner 3b982b11f4 [lit] Refactor ordering of tests 2019-10-29 17:49:23 -07:00
Julian Lettner 2b0b841083 [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 7c1d536c21 [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 b163806cdc [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 7cd3016774 [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 8a3a5f93b2 gn build: Merge 38839d08b8 2019-10-29 01:06:42 +00:00
Nico Weber 8530f294f5 gn build: fix bad merge of 75f72f6b done in 3431f1ba 2019-10-28 20:59:11 -04:00
Nico Weber 3431f1ba4c gn build: (manually) merge 75f72f6b 2019-10-28 20:56:21 -04:00
Julian Lettner 91095fe072 [lit] Refactor merging of user parameters 2019-10-28 14:11:15 -07:00
Nico Weber 8aa0a785c4 gn build: (manually) merge d157a9bc
While here, also merge r335850 / r366396.
2019-10-28 14:18:56 -04:00
Julian Lettner e6102dc5ef [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 2ddd1564a9 [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 2aa955411a gn build: Merge 5ab9a850f6 2019-10-28 06:32:06 +00:00
Matt Arsenault 525169efd1 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 32837a60ac [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 f3ad8ae7b7 [lit] Move sharding logic into separate function 2019-10-25 16:23:52 -07:00
Joel E. Denny 27fdf8a29d [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
Daniel Sanders a6e1de4afc [gicombiner] Add parse failure tests for defs/match 2019-10-25 12:56:49 -07:00
LLVM GN Syncbot a153233caf gn build: Merge 8e567b0730 2019-10-25 16:49:07 +00:00
LLVM GN Syncbot d581f68519 gn build: Merge 74d39a42f1 2019-10-25 10:01:34 +00:00
Tom Stellard efcdedd2e7 git-llvm: Drop dependency on github module
This was required for blocking merge commits, but now that we have
branch protections, we don't need this.
2019-10-25 00:04:31 -07:00
Tom Stellard b96e30c217 git-llvm: Push to master branch by default
This allows pushing without specifying a branch, which is what the
documentations says to do.
2019-10-24 23:56:00 -07:00
LLVM GN Syncbot 918b88ab15 gn build: Merge ffa214ef22 2019-10-25 06:36:53 +00:00
LLVM GN Syncbot 72d7908afc gn build: Merge d0bd3fc88b 2019-10-25 06:36:53 +00:00
LLVM GN Syncbot 9c0f66746c gn build: Merge bb6a27fc25 2019-10-25 06:36:52 +00:00
Nico Weber 13d8d19d51 gn build: (manually) merge 08074cc9 2019-10-25 02:35:14 -04:00
David Tenty bf869683c3 Use portable flag with nm in extract_symbols.py
Summary:
nm is one of the tools that extract_symbols.py can use to extract
symbols from llvm libraries as part of the build process. This patch
updates the invocation of nm to use the -P POSIX option for "portable
output" so we get a consistently parsable output format on all
platforms.

A link to the relevant nm format: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/nm.html

Reviewers: hubert.reinterpretcast, stevewan, sfertile

Reviewed By: stevewan

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69004
2019-10-23 16:48:22 -04:00
Michael Liao a7cebfe9c0 Relax assertions when there's really no entries. [NFC] 2019-10-22 15:26:30 -04:00
Nico Weber 19ca80ef05 gn build: make sync build work with git revs now that svn is gone 2019-10-22 14:19:35 -04:00
Tom Stellard 3bf7fddeb0 Update git-llvm script to push to GitHub
Summary:
Note: This patch should not be pushed until SVN has become read-only.
It should be the first patch committed directly to GitHub.

This patch updates git-llvm to check for merge commits and then push
changes to GitHub if none are found.  All logic related to SVN has been
removed.

Reviewers: jyknight

Subscribers: lenary, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67772
2019-10-22 16:23:25 +00:00
GN Sync Bot 4e039e2720 gn build: Merge r375483
llvm-svn: 375484
2019-10-22 05:09:35 +00:00
Julian Lettner b94ac8a263 [lit] Move increase_process_limit to ParallelRun
Increasing the process limit only makes sense when we use multiple
processes.

llvm-svn: 375474
2019-10-22 01:13:30 +00:00
Julian Lettner 3330cad630 [lit] Simplify test scheduling via multiprocessing.Pool
llvm-svn: 375458
2019-10-21 21:57:18 +00:00
Julian Lettner 8c6913a07b [lit] Remove redundancy from names and comments
llvm-svn: 375456
2019-10-21 21:41:59 +00:00
GN Sync Bot 01e177ede5 gn build: Merge r375390
llvm-svn: 375393
2019-10-21 08:06:38 +00:00
Martin Storsjo a59444a356 [LLDB] [Windows] Initial support for ARM register contexts
Differential Revision: https://reviews.llvm.org/D69226

llvm-svn: 375392
2019-10-21 08:02:34 +00:00
GN Sync Bot b01c077a18 gn build: Merge r375375
llvm-svn: 375376
2019-10-20 20:44:56 +00:00
Peter Collingbourne 3b113a2be6 gn build: Build compiler-rt code with -fvisibility=hidden.
This matches the CMake build.

Differential Revision: https://reviews.llvm.org/D69202

llvm-svn: 375299
2019-10-18 22:52:17 +00:00
GN Sync Bot e8da5e51cd gn build: Merge r375288
llvm-svn: 375289
2019-10-18 21:11:20 +00:00
Julian Lettner 80873de532 [lit] Reduce value of synthesized timeouts
Large timeout values (one year, positive infinity) trip up Python on
Windows with "OverflowError: timeout value is too large".  One week
seems to work and is still large enough in practice.

Thanks to Simon Pilgrim for helping me test this.
https://reviews.llvm.org/rL375171

llvm-svn: 375264
2019-10-18 17:59:46 +00:00
Julian Lettner 0381867f84 [lit] Remove unnecessary tracking of test_index
llvm-svn: 375263
2019-10-18 17:31:48 +00:00
Julian Lettner 17bb660fb8 [lit] Only send back test result from worker process
Avoid sending back the whole run.Test object (which needs to be pickled)
from the worker process when we are only interested in the test result.

llvm-svn: 375262
2019-10-18 17:31:45 +00:00
GN Sync Bot 52dc406efc gn build: Merge r375254
llvm-svn: 375256
2019-10-18 16:52:12 +00:00
James Molloy d5afdbe5a4 [DFAPacketizer] Fix large compile-time regression for VLIW targets
D68992 / rL375086 refactored the packetizer and removed a bunch of logic. Unfortunately it creates an Automaton object whenever a DFAPacketizer is required. These objects have no longevity, and in particular on a debug build the population of the Automaton's transition map from the underlying table is very slow (because it is called ~10 times per MachineFunction, in the testcase I'm looking at).

This patch changes Automaton to wrap its underlying constant data in std::shared_ptr, which allows trivial copy construction. The DFAPacketizer creation function now creates a static archetypical Automaton and copies that whenever a new DFAPacketizer is required.

This takes a testcase down from ~20s to ~0.5s in debug mode.

llvm-svn: 375240
2019-10-18 14:48:35 +00:00
Julian Lettner a3d2f9b53a [lit] Move resolving of XFAIL result codes out of Test.setResult
This will allow us to serialize just the result object instead of the
whole lit.Test object back from the worker to the main lit process.

llvm-svn: 375195
2019-10-18 00:50:37 +00:00
Julian Lettner 13bf5eb1f4 [lit] worker.py: Improve code for executing a single test
llvm-svn: 375194
2019-10-18 00:50:34 +00:00
Julian Lettner 9a335b6eda [lit] Move computation of deadline up into base class
llvm-svn: 375171
2019-10-17 21:12:45 +00:00
Julian Lettner 2ca8e27bd0 Reland "[lit] Synthesize artificial deadline"
We always want to use a deadline when calling `result.await`.  Let's
synthesize an artificial deadline (now plus one year) to simplify code
and do less busy waiting.

Thanks to Reid Kleckner for diagnosing that a deadline for of "positive
infinity" does not work with Python 3 anymore.  See commit:
4ff1e34b60

I tested this patch with Python 2 and Python 3.

llvm-svn: 375165
2019-10-17 20:22:32 +00:00
Reid Kleckner 4ff1e34b60 Revert [lit] Synthesize artificial deadline
Python on Windows raises this OverflowError:
      gotit = waiter.acquire(True, timeout)
  OverflowError: timestamp too large to convert to C _PyTime_t

So it seems this API behave the same way on every OS.

Also reverts the dependent commit a660dc590a.

llvm-svn: 375143
2019-10-17 17:44:35 +00:00
Julian Lettner a660dc590a [lit] Move computation of deadline up into base class
llvm-svn: 375130
2019-10-17 16:01:21 +00:00
Julian Lettner aa05e0e972 [lit] Synthesize artificial deadline
We always want to use a deadline when calling `result.await`.  Let's
synthesize an artificial deadline (positive infinity) to simplify code
and do less busy waiting.

llvm-svn: 375129
2019-10-17 16:01:18 +00:00
Julian Lettner d25c766aa2 [lit] Create derived classes for serial/parallel test runs
The hope is that with a little OO we can nicely factor out the
differences.

llvm-svn: 375128
2019-10-17 16:01:15 +00:00
Joel E. Denny e96e2d3227 Revert r375114: "[lit] Make internal diff work in pipelines"
This series of patches still breaks a Windows bot.

llvm-svn: 375121
2019-10-17 14:43:42 +00:00
Joel E. Denny 5e684e8d88 Revert r375116: "[lit] Extend internal diff to support `-` argument"
This series of patches still breaks a Windows bot.

llvm-svn: 375120
2019-10-17 14:43:26 +00:00
Joel E. Denny 849d67a700 [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

llvm-svn: 375116
2019-10-17 14:03:06 +00:00
Joel E. Denny 221e418f0c [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.

Reviewed By: probinson, stella.stamenova

Differential Revision: https://reviews.llvm.org/D66574

llvm-svn: 375114
2019-10-17 14:02:42 +00:00
James Molloy 12092a9691 [DFAPacketizer] Use DFAEmitter. NFC.
Summary:
This is a NFC change that removes the NFA->DFA construction and emission logic from DFAPacketizerEmitter and instead uses the generic DFAEmitter logic. This allows DFAPacketizer to use the Automaton class from Support and remove a bunch of logic there too.

After this patch, DFAPacketizer is mostly logic for grepping Itineraries and collecting functional units, with no state machine logic. This will allow us to modernize by removing the 16-functional-unit limit and supporting non-itinerary functional units. This is all for followup patches.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68992

llvm-svn: 375086
2019-10-17 08:34:29 +00:00
Daniel Sanders 6150093e22 Correct placement of #ifndef NDEBUG in r375067
llvm-svn: 375071
2019-10-17 01:21:53 +00:00
Daniel Sanders 329e748c8c [gicombiner] Add the run-time rule disable option
Summary:
Each generated helper can be configured to generate an option that disables
rules in that helper. This can be used to bisect rulesets.

The disable bits are stored in a SparseVector as this is very cheap for the
common case where nothing is disabled. It gets more expensive the more rules
are disabled but you're generally doing that for debug purposes where
performance is less of a concern.

Depends on D68426

Reviewers: volkan, bogner

Reviewed By: volkan

Subscribers: hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68438

llvm-svn: 375067
2019-10-17 00:37:04 +00:00
Julian Lettner f35cebe71d [lit] Improve lit.Run class
* Push timing of overall test time into run module
* Make lit.Run a proper class
* Add a few TODO comments

llvm-svn: 375065
2019-10-17 00:29:59 +00:00
Daniel Sanders ec5208fd65 [gicombiner] Hoist pure C++ combine into the tablegen definition
Summary:
This is just moving the existing C++ code around and will be NFC w.r.t
AArch64. Renamed 'CombineBr' to something more descriptive
('ElideByByInvertingCond') at the same time.

The remaining combines in AArch64PreLegalizeCombiner require features that
aren't implemented at this point and will be hoisted as they are added.

Depends on D68424

Reviewers: bogner, volkan

Subscribers: kristof.beyls, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68426

llvm-svn: 375057
2019-10-16 23:53:35 +00:00
Julian Lettner 168ef8a8d6 [lit] Remove unnecessary usage of lit.Run
llvm-svn: 375056
2019-10-16 23:31:32 +00:00
Julian Lettner 640d6de429 [lit] Do not create semaphores when we do not need them
Parallelism groups and semaphores are only required for parallel
execution.

llvm-svn: 375055
2019-10-16 23:25:46 +00:00
Julian Lettner bb98234931 [lit] Factor out separate methods for parallel and serial execution
llvm-svn: 375054
2019-10-16 23:25:41 +00:00
Julian Lettner 471dc1fb28 [lit] Print warning if we fail to delete temp directory
llvm-svn: 375049
2019-10-16 22:20:28 +00:00
Julian Lettner 3c7d8792f1 [lit] Skip creation of tmp dir if we don't actually run any tests
llvm-svn: 375048
2019-10-16 22:20:25 +00:00
Julian Lettner 70055d81b2 [lit] Remove return value from print_summary function
llvm-svn: 375047
2019-10-16 21:58:21 +00:00
Julian Lettner bbc56dd845 [lit] Small refactoring and cleanups in main.py
* Remove outdated precautions for Python versions < 2.7
* Remove dead code related to `maxIndividualTestTime` option
* Move printing of test and result summary out of main into its own
  function

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68847

llvm-svn: 375046
2019-10-16 21:53:20 +00:00
Joel E. Denny 2622419c78 [lit] Fix internal diff's --strip-trailing-cr and use it
Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before
a `\n` at the end of a line.  Without this patch, lit's internal diff
only removes `\r` if it appears as the last character.  That seems
useless.  This patch fixes that.

This patch also adds `--strip-trailing-cr` to some tests that fail on
Windows bots when D68664 is applied.  Based on what I see in the bot
logs, I think the following is happening.  In each test there, lit
diff is comparing a file with `\r\n` line endings to a file with `\n`
line endings.  Without D68664, lit diff reads those files in text
mode, which in Windows causes `\r\n` to be replaced with `\n`.
However, with D68664, lit diff reads the files in binary mode instead
and thus reports that every line is different, just as GNU diff does
(at least under Ubuntu).  Adding `--strip-trailing-cr` to those tests
restores the previous behavior while permitting the behavior of lit
diff to be more like GNU diff.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68839

llvm-svn: 375020
2019-10-16 17:21:57 +00:00
Joel E. Denny f095b8c425 [lit] Clean up internal diff's encoding handling
As suggested by rnk at D67643#1673043, instead of reading files
multiple times until an appropriate encoding is found, read them once
as binary, and then try to decode what was read.

For Python >= 3.5, don't fail when attempting to decode the
`diff_bytes` output in order to print it.

Avoid failures for Python 2.7 used on some Windows bots by
transforming diff output with `lit.util.to_string` before writing it
to stdout.

Finally, add some tests for encoding handling.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68664

llvm-svn: 375018
2019-10-16 17:21:24 +00:00
GN Sync Bot 9604624ebf gn build: Merge r374982
llvm-svn: 374983
2019-10-16 09:59:01 +00:00
Julian Lettner 74b285eee7 [lit] Add back LitTestCase
This essentially reverts a commit [1] that removed the adaptor for
Python unittests.  The code has been slightly refactored to make it more
additive: all code is contained in LitTestCase.py.

Usage sites will require a small adaption:
```
[old]
  import lit.discovery
  ...
  test_suite = lit.discovery.load_test_suite(...)

[new]
  import lit.LitTestCase
  ...
  test_suite = lit.LitTestCase.load_test_suite(...)
```

This was put back on request by Daniel Dunbar, since I wrongly assumed
that the functionality is unused.  At least llbuild still uses this [2].

[1] 70ca752ccf
[2] https://github.com/apple/swift-llbuild/blob/master/utils/Xcode/LitXCTestAdaptor/LitTests.py#L16

Reviewed By: ddunbar

Differential Revision: https://reviews.llvm.org/D69002

llvm-svn: 374947
2019-10-15 20:57:20 +00:00
GN Sync Bot 0cdf478955 gn build: Merge r374903
llvm-svn: 374904
2019-10-15 15:33:04 +00:00
GN Sync Bot ae8e69ecd0 gn build: Merge r374899
llvm-svn: 374900
2019-10-15 14:53:40 +00:00
GN Sync Bot a945469875 gn build: Merge r374882
llvm-svn: 374883
2019-10-15 11:55:38 +00:00
Djordje Todorovic 095531ea94 [llvm-locstats] Fix 'only params' no entry value stats
Adding the missing line.

llvm-svn: 374875
2019-10-15 10:12:14 +00:00
Martin Storsjo b1f6ba2a2e [LLDB] [Windows] Initial support for ARM64 register contexts
Differential Revision: https://reviews.llvm.org/D67954

llvm-svn: 374866
2019-10-15 08:31:52 +00:00
Julian Lettner 98aa3c1de9 [lit] Add argument check: --timeout must be non-negative integer
llvm-svn: 374847
2019-10-14 23:43:18 +00:00
Roman Tereshin 044297ccbf [update_mir_test_checks] Handle MI flags properly
previously we would generate literal check lines w/ no reg-exps for
vregs as MI flags (nsw, ninf, etc.) won't be recognized as a part of MI.

Fixing that. Includes updating the MIR tests that suffered from the
problem.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D68905

llvm-svn: 374829
2019-10-14 22:01:58 +00:00
Julian Lettner 31a26001a1 [lit] Create Run object later and only when it is needed
Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68843

llvm-svn: 374823
2019-10-14 21:23:40 +00:00
Jan Korous c5d14b5c6f [clang-scan-deps] Support for clang --analyze in clang-scan-deps
The goal is to have 100% fidelity in clang-scan-deps behavior when
--analyze is present in compilation command.

At the same time I don't want to break clang-tidy which expects
__static_analyzer__ macro defined as built-in.

I introduce new cc1 options (-setup-static-analyzer) that controls
the macro definition and is conditionally set in driver.

Differential Revision: https://reviews.llvm.org/D68093

llvm-svn: 374815
2019-10-14 20:15:01 +00:00
Joel E. Denny 7e385bd2f5 [lit] Extend internal diff to support -U
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 -U1 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 `-U` as a command-line option.  This patch adds `-U`
support.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68668

llvm-svn: 374814
2019-10-14 19:59:30 +00:00
Hans Wennborg 0b33417cd4 Fix copy-pasto in r374759
llvm-svn: 374796
2019-10-14 17:52:31 +00:00
Joerg Sonnenberger 9681ea9560 Reapply r374743 with a fix for the ocaml binding
Add a pass to lower is.constant and objectsize intrinsics

This pass lowers is.constant and objectsize intrinsics not simplified by
earlier constant folding, i.e. if the object given is not constant or if
not using the optimized pass chain. The result is recursively simplified
and constant conditionals are pruned, so that dead blocks are removed
even for -O0. This allows inline asm blocks with operand constraints to
work all the time.

The new pass replaces the existing lowering in the codegen-prepare pass
and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
on the intrinsics.

Differential Revision: https://reviews.llvm.org/D65280

llvm-svn: 374784
2019-10-14 16:15:14 +00:00
Dmitri Gribenko 1a21f98ac3 Revert "Add a pass to lower is.constant and objectsize intrinsics"
This reverts commit r374743. It broke the build with Ocaml enabled:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218

llvm-svn: 374768
2019-10-14 12:22:48 +00:00
Hans Wennborg f2b28fd161 build_llvm_package.bat: Run check-clang-tools and check-clangd tests.
llvm-svn: 374759
2019-10-14 09:08:57 +00:00
Joerg Sonnenberger e4300c392d Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by
earlier constant folding, i.e. if the object given is not constant or if
not using the optimized pass chain. The result is recursively simplified
and constant conditionals are pruned, so that dead blocks are removed
even for -O0. This allows inline asm blocks with operand constraints to
work all the time.

The new pass replaces the existing lowering in the codegen-prepare pass
and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
on the intrinsics.

Differential Revision: https://reviews.llvm.org/D65280

llvm-svn: 374743
2019-10-13 23:00:15 +00:00
Simon Atanasyan f79716774a merge-request.sh: Update 9.0 metabug for 9.0.1
llvm-svn: 374741
2019-10-13 22:10:06 +00:00
Nico Weber d0b8db9ab8 gn build: (manually) merge r374720
llvm-svn: 374721
2019-10-13 15:25:13 +00:00
GN Sync Bot 0fb5a1ee97 gn build: Merge r374707
llvm-svn: 374708
2019-10-13 08:33:14 +00:00
Nico Weber e95d1ca1e2 Revert r374663 "[clang-format] Proposal for clang-format to give compiler style warnings"
The test fails on macOS and looks a bit wrong, see comments on the review.

Also revert follow-up r374686.

llvm-svn: 374688
2019-10-12 22:58:34 +00:00
Nico Weber b12012cc98 gn build: (manually) merge r374663
llvm-svn: 374686
2019-10-12 22:24:56 +00:00
Joel E. Denny 3049748e15 Revert r374648: "Reland r374388: [lit] Make internal diff work in pipelines"
This series of patches still breaks a Windows bot.

llvm-svn: 374683
2019-10-12 18:52:46 +00:00
Joel E. Denny 199f5cd863 Revert r374649: "Reland r374389: [lit] Clean up internal diff's encoding handling"
This series of patches still breaks a Windows bot.

llvm-svn: 374682
2019-10-12 18:52:31 +00:00
Joel E. Denny f6210fc24f Revert r374650: "Reland r374390: [lit] Extend internal diff to support `-` argument"
This series of patches still breaks a Windows bot.

llvm-svn: 374681
2019-10-12 18:52:18 +00:00
Joel E. Denny b3f157a900 Revert 374651: "Reland r374392: [lit] Extend internal diff to support -U"
This series of patches still breaks a Windows bot.

llvm-svn: 374680
2019-10-12 18:52:05 +00:00
Joel E. Denny 57046e8fd9 Revert r374652: "[lit] Fix internal diff's --strip-trailing-cr and use it"
This series of patches still breaks a Windows bot.

llvm-svn: 374679
2019-10-12 18:51:51 +00:00
Joel E. Denny 9abfa58171 Revert r374653: "[lit] Fix a few oversights in r374651 that broke some bots"
This series of patches still breaks a Windows bot.

llvm-svn: 374678
2019-10-12 18:51:34 +00:00
Joel E. Denny e9d3b8192e Revert r374665: "[lit] Try yet again to fix new tests that fail on Windows bots"
This series of patches still breaks a Windows bot.

llvm-svn: 374677
2019-10-12 18:51:18 +00:00
Joel E. Denny b005d9e86f Revert r374666: "[lit] Adjust error handling for decode introduced by r374665"
This series of patches still breaks a Windows bot.

llvm-svn: 374676
2019-10-12 18:51:08 +00:00
Joel E. Denny 459a93659a Revert r374671: "[lit] Try errors="ignore" for decode introduced by r374665"
This series of patches still breaks a Windows bot.

llvm-svn: 374675
2019-10-12 18:50:57 +00:00
Joel E. Denny 1e98a6c57a [lit] Try errors="ignore" for decode introduced by r374665
Still trying to fix the same error as in r374666.

llvm-svn: 374671
2019-10-12 17:23:25 +00:00
Joel E. Denny 64c00893fa [lit] Adjust error handling for decode introduced by r374665
On that decode, Windows bots fail with:

```
UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
```

That's the same error as before r374665 except it's now at the decode
before the write to stdout.

llvm-svn: 374666
2019-10-12 16:25:46 +00:00
Joel E. Denny a271acbf79 [lit] Try yet again to fix new tests that fail on Windows bots
I seem to have misread the bot logs on my last attempt.  When lit's
internal diff runs on Windows under Python 2.7, it's text diffs not
binary diffs that need decoding to avoid this error when writing the
diff to stdout:

```
UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
```

There is no `decode` attribute in this case under Python 3.6.8 under
Ubuntu, so this patch checks for the `decode` attribute before using
it here.  Hopefully nothing else is needed when `decode` isn't
available.

It might take a couple more attempts to figure out what error
handling, if any, is needed for this decoding.

llvm-svn: 374665
2019-10-12 16:00:35 +00:00
Joel E. Denny 8259f7ca12 Revert r374657: "[lit] Try again to fix new tests that fail on Windows bots"
llvm-svn: 374664
2019-10-12 16:00:25 +00:00
Joel E. Denny 1f5823b788 [lit] Try again to fix new tests that fail on Windows bots
Based on the bot logs, when lit's internal diff runs on Windows, it
looks like binary diffs must be decoded also for Python 2.7.
Otherwise, writing the diff to stdout fails with:

```
UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
```

I did not need to decode using Python 2.7.15 under Ubuntu.  When I do
it anyway in that case, `errors="backslashreplace"` fails for me:

```
TypeError: don't know how to handle UnicodeDecodeError in error callback
```

However, `errors="ignore"` works, so this patch uses that, hoping
it'll work on Windows as well.

This patch leaves `errors="backslashreplace"` for Python >= 3.5 as
there's no evidence yet that doesn't work and it produces more
informative binary diffs.  This patch also adjusts some lit tests to
succeed for either error handler.

This patch adjusts changes introduced by D68664.

llvm-svn: 374657
2019-10-12 14:58:43 +00:00
Joel E. Denny 0e22cb6ce3 Revert r374654: "[lit] Try to fix new tests that fail on Windows bots"
llvm-svn: 374656
2019-10-12 14:58:30 +00:00
Joel E. Denny ba229557dd [lit] Try to fix new tests that fail on Windows bots
llvm-svn: 374654
2019-10-12 13:08:21 +00:00
Joel E. Denny 648875bbcf [lit] Fix a few oversights in r374651 that broke some bots
llvm-svn: 374653
2019-10-12 12:32:00 +00:00
Joel E. Denny 0f80927316 [lit] Fix internal diff's --strip-trailing-cr and use it
Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before
a `\n` at the end of a line.  Without this patch, lit's internal diff
only removes `\r` if it appears as the last character.  That seems
useless.  This patch fixes that.

This patch also adds `--strip-trailing-cr` to some tests that fail on
Windows bots when D68664 is applied.  Based on what I see in the bot
logs, I think the following is happening.  In each test there, lit
diff is comparing a file with `\r\n` line endings to a file with `\n`
line endings.  Without D68664, lit diff reads those files with
Python's universal newlines support activated, causing `\r` to be
dropped.  However, with D68664, lit diff reads the files in binary
mode instead and thus reports that every line is different, just as
GNU diff does (at least under Ubuntu).  Adding `--strip-trailing-cr`
to those tests restores the previous behavior while permitting the
behavior of lit diff to be more like GNU diff.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68839

llvm-svn: 374652
2019-10-12 11:58:30 +00:00
Joel E. Denny 92a8294f9e Reland r374392: [lit] Extend internal diff to support -U
To avoid breaking some tests, D66574, D68664, D67643, and D68668
landed together.  However, D68664 introduced an issue now addressed by
D68839, with which these are now all relanding.

Differential Revision: https://reviews.llvm.org/D68668

llvm-svn: 374651
2019-10-12 11:58:03 +00:00
Joel E. Denny 32096a86b2 Reland r374390: [lit] Extend internal diff to support `-` argument
To avoid breaking some tests, D66574, D68664, D67643, and D68668
landed together.  However, D68664 introduced an issue now addressed by
D68839, with which these are now all relanding.

Differential Revision: https://reviews.llvm.org/D67643

llvm-svn: 374650
2019-10-12 11:57:41 +00:00
Joel E. Denny e4f11a3192 Reland r374389: [lit] Clean up internal diff's encoding handling
To avoid breaking some tests, D66574, D68664, D67643, and D68668
landed together.  However, D68664 introduced an issue now addressed by
D68839, with which these are now all relanding.

Differential Revision: https://reviews.llvm.org/D68664

llvm-svn: 374649
2019-10-12 11:57:20 +00:00
Joel E. Denny daf42dc36d Reland r374388: [lit] Make internal diff work in pipelines
To avoid breaking some tests, D66574, D68664, D67643, and D68668
landed together.  However, D68664 introduced an issue now addressed by
D68839, with which these are now all relanding.

Differential Revision: https://reviews.llvm.org/D66574

llvm-svn: 374648
2019-10-12 11:56:57 +00:00
Martin Storsjo fe88be8c3a [lit] Remove setting of the target-windows feature
No other OSes use a target-<os> feature, and no tests depend on it
any lomger.

Differential Revision: https://reviews.llvm.org/D68450

llvm-svn: 374639
2019-10-12 06:40:24 +00:00
Nico Weber 1b82fb61c1 gn build: (manually) merge r374606 better
llvm-svn: 374611
2019-10-11 23:22:36 +00:00
GN Sync Bot 92e11e6d39 gn build: Merge r235758
llvm-svn: 374610
2019-10-11 23:12:04 +00:00
Nico Weber 71ecae9d54 gn build: Cmanually) merge r374590
llvm-svn: 374608
2019-10-11 23:05:24 +00:00
Julian Lettner afa8903ad6 [lit] Small cleanups in main.py
* Extract separate function for running tests from main
* Push single-usage imports to point of usage
* Remove unnecessary sys.exit(0) calls

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68836

llvm-svn: 374602
2019-10-11 21:57:09 +00:00
Julian Lettner ac36dafb69 [lit] Change regex filter to ignore case
Make regex filter `--filter=REGEX` option more lenient via
`re.IGNORECASE`.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D68834

llvm-svn: 374601
2019-10-11 21:57:06 +00:00
Nico Weber e695d3c695 gn build: (manually) merge r374110
llvm-svn: 374575
2019-10-11 17:42:24 +00:00
GN Sync Bot b67d3df1c1 gn build: Merge r374558
llvm-svn: 374560
2019-10-11 14:48:31 +00:00
Kai Nacke 5b5b2fd2b8 [FileCheck] Implement --ignore-case option.
The FileCheck utility is enhanced to support a `--ignore-case`
option. This is useful in cases where the output of Unix tools
differs in case (e.g. case not specified by Posix).

Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D68146

llvm-svn: 374538
2019-10-11 11:59:14 +00:00
QingShan Zhang bb8d540010 [TableGen] Fix a bug that MCSchedClassDesc is interfered between different SchedModel
Assume that, ModelA has scheduling resource for InstA and ModelB has scheduling resource for InstB. This is what the llvm::MCSchedClassDesc looks like:

llvm::MCSchedClassDesc ModelASchedClasses[] = {
...
InstA, 0, ...
InstB, -1,...
};

llvm::MCSchedClassDesc ModelBSchedClasses[] = {
...
InstA, -1,...
InstB, 0,...
};
The -1 means invalid num of macro ops, while it is valid if it is >=0. This is what we look like now:

llvm::MCSchedClassDesc ModelASchedClasses[] = {
...
InstA, 0, ...
InstB, 0,...
};

llvm::MCSchedClassDesc ModelBSchedClasses[] = {
...
InstA, 0,...
InstB, 0,...
};
And compiler hit the assertion here because the SCDesc is valid now for both InstA and InstB.

Differential Revision: https://reviews.llvm.org/D67950

llvm-svn: 374524
2019-10-11 08:36:54 +00:00
GN Sync Bot 85ec603d9e gn build: Merge r374476
llvm-svn: 374482
2019-10-10 23:49:59 +00:00
Julian Lettner 8d0744a8b5 [lit] Break main into smaller functions
This change is purely mechanical.  I will do further cleanups of
parameter usages.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68830

llvm-svn: 374452
2019-10-10 21:24:41 +00:00
Julian Lettner 3620e8fdb5 [lit] Add comment explaining the LIT_OPTS env var overrides command line options
Normally, command line options override environment variables.  Add
comment to state that we are doing the reverse on purpose.

llvm-svn: 374441
2019-10-10 20:23:28 +00:00
Julian Lettner b858895c85 [lit] Bring back `--threads` option alias
Bring back `--threads` option which was lost in the move of the
command line argument parsing code to cl_arguments.py.  Update docs
since `--workers` is preferred.

llvm-svn: 374432
2019-10-10 19:43:57 +00:00
Joel E. Denny a71511feb5 Revert r374388: "[lit] Make internal diff work in pipelines"
This breaks a Windows bot.

llvm-svn: 374429
2019-10-10 19:25:39 +00:00
Joel E. Denny 3e0b23d154 Revert r374389: "[lit] Clean up internal diff's encoding handling"
This breaks a Windows bot.

llvm-svn: 374427
2019-10-10 19:25:24 +00:00
Joel E. Denny bdbeccb387 Revert r374390: "[lit] Extend internal diff to support `-` argument"
This breaks a Windows bot.

llvm-svn: 374426
2019-10-10 19:25:11 +00:00
Joel E. Denny b5af1335be Revert r374392: "[lit] Extend internal diff to support -U"
This breaks a Windows bot.

llvm-svn: 374425
2019-10-10 19:24:57 +00:00
Julian Lettner 822946ceaa [lit] Leverage argparse features to remove some code
Reviewed By: rnk, serge-sans-paille

Differential Revision: https://reviews.llvm.org/D68589

llvm-svn: 374405
2019-10-10 18:03:37 +00:00
Julian Lettner 715bfa4ef8 [lit] Move argument parsing/validation to separate file
Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D68529

llvm-svn: 374400
2019-10-10 17:58:38 +00:00
Nico Weber 5ff60e160a gn build: restore tablegen restat optimization after r373664
llvm-svn: 374395
2019-10-10 17:47:18 +00:00
Joel E. Denny 61d7ecbf84 [lit] Extend internal diff to support -U
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 -U1 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 `-U` as a command-line option.  This patch adds `-U`
support.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68668

llvm-svn: 374392
2019-10-10 17:40:12 +00:00
Nico Weber a134d3cfc9 gn build: merge r374381 more (effectively a no-op)
llvm-svn: 374391
2019-10-10 17:40:00 +00:00
Joel E. Denny f4edce12ff [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

llvm-svn: 374390
2019-10-10 17:39:57 +00:00
Joel E. Denny 19e6bb25f0 [lit] Clean up internal diff's encoding handling
As suggested by rnk at D67643#1673043, instead of reading files
multiple times until an appropriate encoding is found, read them once
as binary, and then try to decode what was read.

For python >= 3.5, don't fail when attempting to decode the
`diff_bytes` output in order to print it.

Finally, add some tests for encoding handling.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68664

llvm-svn: 374389
2019-10-10 17:39:41 +00:00
Joel E. Denny df35ec8289 [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.

Reviewed By: probinson, stella.stamenova

Differential Revision: https://reviews.llvm.org/D66574

llvm-svn: 374388
2019-10-10 17:39:24 +00:00
GN Sync Bot dc895a325f gn build: Merge r374381
llvm-svn: 374383
2019-10-10 17:14:20 +00:00
Dmitri Gribenko d3aed7fc79 Revert "[FileCheck] Implement --ignore-case option."
This reverts commit r374339. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066

llvm-svn: 374359
2019-10-10 14:27:14 +00:00
Kai Nacke dfd2b6f07f [FileCheck] Implement --ignore-case option.
The FileCheck utility is enhanced to support a `--ignore-case`
option. This is useful in cases where the output of Unix tools
differs in case (e.g. case not specified by Posix).

Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D68146

llvm-svn: 374339
2019-10-10 13:15:41 +00:00
Simon Tatham 109c773ab5 [update_cc_test_checks] Support 'clang | opt | FileCheck'
Some clang lit tests use a pipeline of the form

// RUN: %clang [args] -O0 %s | opt [specific optimizations] | FileCheck %s

to make the expected test output depend on as few optimization phases
as possible, for stability. But when you write a RUN line of this
form, you lose the ability to use update_cc_test_checks.py to
automatically generate the expected output, because it only supports
two-stage pipelines consisting of '%clang | FileCheck' (or %clang_cc1).

This change extends the set of supported RUN lines so that pipelines
with an invocation of `opt` in the middle can still be automatically
handled.

To implement it, I've adjusted `get_function_body()` so that it can
cope with an arbitrary sequence of intermediate pipeline commands. But
the code that decides which RUN lines to consider is more
conservative: it only adds clang | opt | FileCheck to the set of
supported lines, because I didn't want to accidentally include some
other kind of line that doesn't output IR at all.

(Also in this commit is the minimal change to make this script work at
all, after r373912 added an extra parameter to `add_ir_checks`.)

Reviewers: MaskRay, xbolva00

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68406

llvm-svn: 374287
2019-10-10 08:25:34 +00:00
GN Sync Bot c05a875c8c gn build: Merge r374277
llvm-svn: 374278
2019-10-10 04:29:49 +00:00
Nico Weber 20fc20dfcf gn build: (manually) merge r374271
llvm-svn: 374272
2019-10-10 02:48:47 +00:00
GN Sync Bot 04f1effb99 gn build: Merge r374245
llvm-svn: 374260
2019-10-09 23:10:49 +00:00
Nico Weber b555ea5ff9 gn build: (manually) merge r374219
llvm-svn: 374249
2019-10-09 22:22:36 +00:00
Julian Lettner 72c7c21dda [lit] Refactor ProgressDisplay
Move progress display to separate file.  Simplify some code paths.
Decouple from other components via progress callback.  Remove unused
`_Display` class.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D68525

llvm-svn: 374194
2019-10-09 18:23:30 +00:00
James Molloy 9948fe6997 [TableGen] Fix crash when using HwModes in CodeEmitterGen
When an instruction has an encoding definition for only a subset of
the available HwModes, ensure we just avoid generating an encoding
rather than crash.

llvm-svn: 374150
2019-10-09 09:15:34 +00:00
Hans Wennborg 1e1e3ba252 Unify the two CRC implementations
David added the JamCRC implementation in r246590. More recently, Eugene
added a CRC-32 implementation in r357901, which falls back to zlib's
crc32 function if present.

These checksums are essentially the same, so having multiple
implementations seems unnecessary. This replaces the CRC-32
implementation with the simpler one from JamCRC, and implements the
JamCRC interface in terms of CRC-32 since this means it can use zlib's
implementation when available, saving a few bytes and potentially making
it faster.

JamCRC took an ArrayRef<char> argument, and CRC-32 took a StringRef.
This patch changes it to ArrayRef<uint8_t> which I think is the best
choice, and simplifies a few of the callers nicely.

Differential revision: https://reviews.llvm.org/D68570

llvm-svn: 374148
2019-10-09 09:06:30 +00:00
Nico Weber 8f7a32043d gn build: unbreak libcxx build after r374116 by restoring gen_link_script.py for gn
llvm-svn: 374129
2019-10-08 23:08:18 +00:00
Daniel Sanders 4b7cabf1e1 [tblgen] Add getOperatorAsDef() to Record
Summary:
While working with DagInit's, it's often the case that you expect the
operator to be a reference to a def. This patch adds a wrapper for this
common case to reduce the amount of boilerplate callers need to duplicate
repeatedly.

getOperatorAsDef() returns the record if the DagInit has an operator that is
a DefInit. Otherwise, it prints a fatal error.

There's only a few pre-existing examples in LLVM at the moment and I've
left a few instances of the code this simplifies as they had more specific
error messages than the generic one this produces. I'm going to be using
this a fair bit in my subsequent patches.

Reviewers: bogner, volkan, nhaehnle

Reviewed By: nhaehnle

Subscribers: nhaehnle, hiraditya, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68424

llvm-svn: 374101
2019-10-08 18:41:32 +00:00
David Greene eb66985726 [UpdateCCTestChecks] Detect function mangled name on separate line
Sometimes functions with large comment blocks in front of them have their
declarations output on several lines by c-index-test.  Hence the one-line
function name/line/mangled pattern will not work to detect them.  Break the
pattern up into two patterns and keep state after seeing the name/line
information until we finally see the mangled name.

Differential Revision: https://reviews.llvm.org/D68272

llvm-svn: 374078
2019-10-08 16:25:42 +00:00
GN Sync Bot 4e139f3871 gn build: Merge r374062
llvm-svn: 374065
2019-10-08 15:34:52 +00:00
GN Sync Bot d190f7679f gn build: Merge r374061
llvm-svn: 374064
2019-10-08 15:28:36 +00:00
GN Sync Bot ed5d1c12dc gn build: Merge r374058
llvm-svn: 374059
2019-10-08 15:12:38 +00:00
Andrew Trick cb194057b9 [LitConfig] Silenced notes/warnings on quiet.
Lit has a "quiet" option, -q, which is documented to "suppress no
error output". Previously, LitConfig displayed notes and warnings when
the quiet option was specified. The result was that it was not
possible to get only pertinent file/line information to be used by an
editor to jump to the location where checks were failing without
passing a number of unhelpful locations first. Here, the
implementations of LitConfig.note and LitConfig.warning are modified
to account for the quiet flag and avoid displaying if the flag has
indeed been set.

Patch by Nate Chandler

Reviewed by yln

Differential Revision: https://reviews.llvm.org/D68044

llvm-svn: 374009
2019-10-08 01:31:02 +00:00
Reid Kleckner f9b67b810e [X86] Add new calling convention that guarantees tail call optimization
When the target option GuaranteedTailCallOpt is specified, calls with
the fastcc calling convention will be transformed into tail calls if
they are in tail position. This diff adds a new calling convention,
tailcc, currently supported only on X86, which behaves the same way as
fastcc, except that the GuaranteedTailCallOpt flag does not need to
enabled in order to enable tail call optimization.

Patch by Dwight Guth <dwight.guth@runtimeverification.com>!

Reviewed By: lebedev.ri, paquette, rnk

Differential Revision: https://reviews.llvm.org/D67855

llvm-svn: 373976
2019-10-07 22:28:58 +00:00
Nico Weber 0d19662a6a gn build: try to make system-libs.windows.test pass
llvm-svn: 373948
2019-10-07 19:17:02 +00:00
Matt Arsenault 27269054d2 GlobalISel: Add target pre-isel instructions
Allows targets to introduce regbankselectable
pseudo-instructions. Currently the closet feature to this is an
intrinsic. However this requires creating a public intrinsic
declaration. This litters the public intrinsic namespace with
operations we don't necessarily want to expose to IR producers, and
would rather leave as private to the backend.

Use a new instruction bit. A previous attempt tried to keep using enum
value ranges, but it turned into a mess.

llvm-svn: 373937
2019-10-07 18:43:29 +00:00
David Greene a14ffc7eb7 Allow update_test_checks.py to not scrub names.
Add a --preserve-names option to tell the script not to replace IR names.
Sometimes tests want those names.  For example if a test is looking for a
modification to an existing instruction we'll want to make the names.

Differential Revision: https://reviews.llvm.org/D68081

llvm-svn: 373912
2019-10-07 14:37:20 +00:00
Nico Weber a1f5c258d6 gn build: use better triple on windows
The CMake build uses "x86_64-pc-windows-msvc". The "-msvc" suffix is
important because e.g. clang/test/lit.cfg.py matches against the
suffix "windows-msvc" to compute the presence of the "ms-sdk" and
the absence of the "LP64" feature.

Differential Revision: https://reviews.llvm.org/D68572

llvm-svn: 373899
2019-10-07 13:13:31 +00:00
James Molloy beb696e2a6 [TableGen] Pacify gcc-5.4 more
Followup to a previous pacification, this performs the same workaround
to the TableGen generated code for tuple automata.

llvm-svn: 373883
2019-10-07 08:23:20 +00:00
Nico Weber a30730f690 gn build: no-op style tweak in sync script
llvm-svn: 373873
2019-10-07 00:37:10 +00:00
Nico Weber 598e7a3a68 gn build: make windows build less broken
llvm-svn: 373858
2019-10-06 18:11:53 +00:00
Julian Lettner 68eefbb064 [lit] Use better name for "test in parallel" concept
In the past, lit used threads to run tests in parallel. Today we use
`multiprocessing.Pool`, which uses processes. Let's stay more abstract
and use "worker" everywhere.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68475

llvm-svn: 373794
2019-10-04 21:40:20 +00:00
Mikhail Maltsev cfe8bedca0 [utils] Fix incompatibility of bisect[-skip-count] with Python 3
Summary:
This change replaces the print statements with print function calls
and also replaces the '/' operator (which is integer division in Py2,
but becomes floating point division in Py3) with the '//' operator
which has the same semantics in Py2 and Py3.

Reviewers: greened, michaelplatings, gottesmm

Reviewed By: greened

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68138

llvm-svn: 373759
2019-10-04 16:44:18 +00:00
Nico Weber 90cfbf35c9 gn build: (manually) merge r373718
llvm-svn: 373726
2019-10-04 10:20:47 +00:00
James Molloy e667401055 [TableGen] Introduce a generic automaton (DFA) backend
Summary:
This patch introduces -gen-automata, a backend for generating deterministic finite-state automata.

DFAs are already generated by the -gen-dfa-packetizer backend. This backend is more generic and will
hopefully be used to implement the DFA generation (and determinization) for the packetizer in the
future.

This backend allows not only generation of a DFA from an NFA (nondeterministic finite-state
automaton), it also emits sidetables that allow a path through the DFA under a sequence of inputs to
be analyzed, and the equivalent set of all possible NFA transitions extracted.

This allows a user to not just answer "can my problem be solved?" but also "what is the
solution?". Clearly this analysis is more expensive than just playing a DFA forwards so is
opt-in. The DFAPacketizer has this behaviour already but this is a more compact and generic
representation.

Examples are bundled in unittests/TableGen/Automata.td. Some are trivial, but the BinPacking example
is a stripped-down version of the original target problem I set out to solve, where we pack values
(actually immediates) into bins (an immediate pool in a VLIW bundle) subject to a set of esoteric
constraints.

Reviewers: t.p.northover

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67968

llvm-svn: 373718
2019-10-04 09:03:36 +00:00
GN Sync Bot ea31d1807c gn build: Merge r373689
llvm-svn: 373690
2019-10-04 04:00:11 +00:00
Nico Weber 204623e05c Reland r349624: Let TableGen write output only if it changed, instead of doing so in cmake
Move the write-if-changed logic behind a flag and don't pass it
with the MSVC generator. msbuild doesn't have a restat optimization,
so not doing write-if-change there doesn't have a cost, and it
should fix whatever causes PR43385.

llvm-svn: 373664
2019-10-03 21:22:28 +00:00
Nico Weber c118a03e69 gn build: (manually) merge 373651 better
The reland uses a static library, not an object library.
Doesn't really matter for the gn build, but it's probalby
nice to have the same semantics for the target type.

llvm-svn: 373660
2019-10-03 20:41:57 +00:00
Nico Weber 6695ff62d0 Reland "gn build: (manually) merge r373551"
373551 relanded in 373651.

llvm-svn: 373654
2019-10-03 20:07:03 +00:00
Daniel Sanders 18350af159 [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion
Summary:
This will handle expansion of C++ fragments in the declarative combiner
including custom predicates, and escapes into C++ to aid the migration
effort.

Fixed the -DLLVM_LINK_LLVM_DYLIB=ON using DISABLE_LLVM_LINK_LLVM_DYLIB when
creating the library. Apparently it automatically links to libLLVM.dylib
and we don't want that from tablegen.

Reviewers: bogner, volkan

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68288

> llvm-svn: 373551

llvm-svn: 373651
2019-10-03 19:13:39 +00:00
Nico Weber b01ebd6c1d gn build: (manually) merge r373622
llvm-svn: 373627
2019-10-03 16:59:12 +00:00
Sanjay Patel 2c9c7d6809 [UpdateTestChecks] add basic support for parsing msp430 asm
llvm-svn: 373605
2019-10-03 14:34:28 +00:00
GN Sync Bot d1a4b82274 gn build: Merge r373601
llvm-svn: 373603
2019-10-03 14:28:27 +00:00
Djordje Todorovic de6b59cd20 [llvm-locstats] Copy the script only when needed; NFC
llvm-svn: 373596
2019-10-03 13:18:14 +00:00
Nico Weber ead8577aff gn build: Revert 373554 "gn build: (manually) merge r373551"
r373551 was reverted in r373581.

llvm-svn: 373586
2019-10-03 11:57:39 +00:00
Kristina Brooks 43817e1915 Revert 373551 (CodeExpander.cpp CMake issue)
Fix buildbots and revert the CodeExpander commit.

(See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190930/699857.html )

llvm-svn: 373581
2019-10-03 11:04:48 +00:00
Kristina Brooks abc35f1bd8 Revert 373555: libLLVM+modules failure with CMake 3.10.2
This reverts rL373555. I've sent an email out regarding the issue.

Commit on GitHub:
45f682f471

llvm-svn: 373579
2019-10-03 10:48:37 +00:00
GN Sync Bot d7f93154b3 gn build: Merge r373556
llvm-svn: 373558
2019-10-03 02:43:27 +00:00
Daniel Sanders 45f682f471 [gicombiner] Make rL373551 compatible with older cmakes
Newer cmakes appear to be more flexible w.r.t object libraries. Convert to
a static library so that it works with older cmakes too

llvm-svn: 373555
2019-10-03 01:49:04 +00:00
Nico Weber f79f68975d gn build: (manually) merge r373551
llvm-svn: 373554
2019-10-03 01:32:51 +00:00
Daniel Sanders eb27b5de53 [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion
Summary:
This will handle expansion of C++ fragments in the declarative combiner
including custom predicates, and escapes into C++ to aid the migration
effort.

Reviewers: bogner, volkan

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68288

llvm-svn: 373551
2019-10-03 01:04:42 +00:00
GN Sync Bot 81f2da4d09 gn build: Merge r373538
llvm-svn: 373550
2019-10-03 00:47:13 +00:00
Daniel Sanders 2a964eabaa [gicombiner] Fix a nullptr dereference when -combiners is given a name that isn't defined
This is unlikely to be the root cause for the windows bot failures but
it would explain the stack trace seen.

llvm-svn: 373543
2019-10-02 23:03:21 +00:00