6283 Commits

Author SHA1 Message Date
Brian Gesiak
5a69de7528 [lit] Fix order of checks in shtest-shell.py test
Summary:
An expectation in `utils/lit/tests/Inputs/shtest-shell/redirects.txt`
expects that first a string printed to stdout is seen, and then a
string printed to stderr. Add `flush()` calls to ensure that stdout is
printed before stderr, as expected.

Reviewers: rnk, mgorny, jroelofs

Reviewed By: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 16:50:40 +00:00
Daniel Sanders
064cf49c35 [globalisel][tablegen] Ensure MatchTable's are compile-time constants with constexpr. NFC.
This should prevent any re-occurence of the problem where the table was
initialized at run-time.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309267 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 12:47:31 +00:00
Daniel Sanders
e0714cfc0f Re-commit: r309094 [globalisel][tablegen] Fuse the generated tables together.
Summary:
Now that we have control flow in place, fuse the per-rule tables into a
single table. This is a compile-time saving at this point. However, this will
also enable the optimization of a table so that similar instructions can be
tested together, reducing the time spent on the matching the code.

This is NFC in terms of externally visible behaviour but some internals have
changed slightly. State.MIs is no longer reset between each rule that is
attempted because it's not necessary to do so. As a consequence of this the
restriction on the order that instructions are added to State.MIs has been
relaxed to only affect recorded instructions that require new elements to be
added to the vector. GIM_RecordInsn can now write to any element from 1 to
State.MIs.size() instead of just State.MIs.size().

The compile-time regressions from the last commit were caused by the ARM target
including a non-const variable (zero_reg) in the table and therefore generating
an initializer for it. That variable is now const.

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309264 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 11:03:45 +00:00
Reid Kleckner
990c9f7fd8 [lit] Fix race between shtest-shell and max-failures tests
Previously these tests would use the same Output directory leading to
flaky non-deterministic failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 22:57:32 +00:00
Reid Kleckner
89802515ff [lit] Fix shtest-shell and max-failures lit tests on Windows
Rewrite the write-to-stderr.sh and write-to-stdout-and-stderr.sh shell
scripts as python scripts and call python on them.

Fixes PR33940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 22:21:25 +00:00
Reid Kleckner
70c636feea [lit] Fix shtest-output-printing.py on Windows by matching either / or \\
Fixes PR33938

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 22:11:30 +00:00
Reid Kleckner
1dc238e090 [lit] Fix discovery.py on Windows by matching backslashes when necessary
Fixes PR33932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 22:00:38 +00:00
Reid Kleckner
690a4c706a [lit] Un-XFAIL selecting.py test on Windows
This passes locally for me, which fails the overall lit test suite. I
can't debug a passing test, but I will try to help debug the test when
we get some failing logs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 21:48:41 +00:00
Reid Kleckner
2dcf99d698 Un-XFAIL some internal lit tests on Windows, they pass for me locally
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 18:04:18 +00:00
George Karpenkov
370d1e47b2 Fix LIT test breakage
Differential Revision: https://reviews.llvm.org/D35867

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 17:19:36 +00:00
Brian Gesiak
8f6b2b6630 [lit] Mark several of lit's tests XFAIL on Windows
Summary:
rL257221 attempted to run lit's own test suite continuously, but that
commit was reverted because lit's test suite does not pass on Windows.
Because lit's tests do not run continuously, they often regress.

In order to un-revert rL257221, mark lit tests that fail as XFAIL for
Windows platforms.

Test Plan:
On a Windows development environment, follow the instructions in
utils/lit/README.txt to run lit's test suite:

```
utils/lit/lit.py \
    --path /path/to/your/llvm/build/bin \
    utils/lit/tests
```

Verify that the test suite is run and a successful exit code is
returned.

Reviewers: mgorny, rnk, delcypher, beanz

Reviewed By: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309123 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 15:10:50 +00:00
Brian Gesiak
1cb9d8ce7a [lit] Fix type error for parallelism groups
Summary:
Whereas rL299560 and rL309071 call `parallelism_groups.items()`, under the
assumption that `parallelism_groups` is a `dict` type, the default
parameter for that attribute is a `list`. Change the default to a
`dict` for type correctness.

This regression in the unit tests would have been caught if the
unit tests were being run continously. It also would have been caught
if the lit project used a Python type checker such as `mypy`.

Test Plan:
As per the instructions in `utils/lit/README.txt`, run the lit unit
test suite:

```
utils/lit/lit.py \
    --path /path/to/your/llvm/build/bin \
    utils/lit/tests
```

Verify that the test `lit :: unit/TestRunner.py` fails before applying this
patch, but passes once this patch is applied.

Reviewers: mgorny, rnk, rafael

Reviewed By: mgorny

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309122 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 15:02:05 +00:00
Brian Gesiak
0f1c53205c Revert "[lit] Remove dead code not referenced in the LLVM SVN repo."
Summary:
This reverts rL306623, which removed `FileBasedTest`, an abstract base class,
but did not also remove the usages of that class in the lit unit tests.
The revert fixes four test failures in the lit unit test suite.

Test plan:
As per the instructions in `utils/lit/README.txt`, run the lit unit
test suite:

```
utils/lit/lit.py \
    --path /path/to/your/llvm/build/bin \
    utils/lit/tests
```

Verify that the following tests fail before applying this patch, and
pass once the patch is applied:

```
lit :: test-data.py
lit :: test-output.py
lit :: xunit-output.py
```

In addition, run `check-llvm` to make sure the existing LLVM test suite
executes normally.

Reviewers: george.karpenkov, mgorny, dlj

Reviewed By: mgorny

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309120 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 14:59:36 +00:00
Daniel Sanders
d0d2059ec3 Revert r309094: [globalisel][tablegen] Fuse the generated tables together.
The ARM bots have started failing and while this patch should be an improvement
for these bots, it's also the only suspect in the blamelist. Reverting while
Diana and I investigate the problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 13:28:40 +00:00
Daniel Sanders
18698d1733 [globalisel][tablegen] Fuse the generated tables together.
Summary:
Now that we have control flow in place, fuse the per-rule tables into a
single table. This is a compile-time saving at this point. However, this will
also enable the optimization of a table so that similar instructions can be
tested together, reducing the time spent on the matching the code.

This is NFC in terms of externally visible behaviour but some internals have
changed slightly. State.MIs is no longer reset between each rule that is
attempted because it's not necessary to do so. As a consequence of this the
restriction on the order that instructions are added to State.MIs has been
relaxed to only affect recorded instructions that require new elements to be
added to the vector. GIM_RecordInsn can now write to any element from 1 to
State.MIs.size() instead of just State.MIs.size().

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309094 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:20:56 +00:00
Reid Kleckner
59859d9950 [lit] Attempt to fix Python unittest adaptor logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 01:27:18 +00:00
Michal Gorny
5b4c3ec15d [lit] Fix UnboundLocalError for invalid shtest redirects
Replace the incorrect variable reference when invalid redirect is used.
This fixes the following issue:

  File "/usr/src/llvm/utils/lit/lit/TestRunner.py", line 316, in processRedirects
    raise InternalShellError(cmd, "Unsupported redirect: %r" % (r,))
UnboundLocalError: local variable 'r' referenced before assignment

which in turn broke shtest-shell.py and max-failures.py lit tests.

The breakage was introduced during refactoring in rL307310.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309044 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:38:31 +00:00
Tom Stellard
df6678d054 test-release.sh: Fix phase2 and phase3 binary comparision
Summary:
scudo_utils.cpp.o from compiler-rt has one of the host compiler's builtin
include paths stored in the .debug_line section.  So we need to do
sed 's,Phase1,Phase2,g` on the Phase2 object file so it matches Phase3.

Reviewers: hans

Reviewed By: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24 19:28:30 +00:00
Ilya Biryukov
194f31ae02 NFC. Fixed typos in the comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24 16:02:29 +00:00
Krzysztof Parzyszek
cf138ec142 Implement LaneBitmask::getNumLanes and LaneBitmask::getHighestLane
This should eliminate most uses of countPopulation and Log2_32 on
the lane mask values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308658 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20 19:43:19 +00:00
Daniel Sanders
1d22eb0749 [globalisel][tablegen] Add control-flow to the MatchTable.
Summary:
This will allow us to merge the various sub-tables into a single table. This is a
compile-time saving at this point. However, this will also enable the optimization
of a table so that similar instructions can be tested together, reducing the time
spent on the matching the code.

The bulk of this patch is a mechanical conversion to the new MatchTable object
which is responsible for tracking label definitions and filling in the index of
the jump targets. It is also responsible for nicely formatting the table.

This was necessary to support the new GIM_Try opcode which takes the index to
jump to if the match should fail. This value is unknown during table
construction and is filled in during emission. To support nesting try-blocks
(although we currently don't emit tables with nested try-blocks), GIM_Reject
has been re-introduced to explicitly exit a try-block or fail the overall match
if there are no active try-blocks.

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20 09:25:44 +00:00
Ilya Biryukov
c6a5d73cf6 Handle clang-tools-extra project in docker scripts.
Reviewers: klimek, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20 08:30:44 +00:00
Hans Wennborg
89fb1f68e3 Update trunk version to 6.0.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308442 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 12:19:01 +00:00
Martin Storsjo
6c132cb749 [AArch64] Extend CallingConv::X86_64_Win64 to AArch64 as well
Rename the enum value from X86_64_Win64 to plain Win64.

The symbol exposed in the textual IR is changed from 'x86_64_win64cc'
to 'win64cc', but the numeric value is kept, keeping support for
old bitcode.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-17 20:05:19 +00:00
Craig Topper
c68f8f2fd3 [TableGen][MC] Fix a few places where we didn't hide the underlying type of LaneBitmask very well.
One place compared with 32, which I've replaced with LaneBitmask::BitWidth.

The other places are shifts of a constant 1 by a lane number. But if LaneBitmask were to be a larger type than 32-bits like 64-bits, the 1 would need to be 1ULL to do a 64-bit shift. To hide this I've added a LanebitMask::getLane that hides the shift and make sures the 1 is casted to correct type first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 18:30:09 +00:00
George Karpenkov
92aa19c981 [lit] add a -vv option to echo all executed commands.
Debugging LIT scripts can be rather painful, as LIT directly does not
specify which line has failed.
Rather, FileCheck is expected to report the failing location, but it can
be often ambiguous if multiple commands are tested against the same
prefix.  This change adds a -vv option, which echoes all output.
Then detecting the error becomes straightforward: last printed line is
the failing one.

Of course, it could be desired to try to get failing line number
directly from bash, but it involves excessive hacks on older bash
versions (cf.
https://stackoverflow.com/questions/24398691/how-to-get-the-real-line-number-of-a-failing-bash-command)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307938 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 19:26:27 +00:00
Reid Kleckner
05c2cd15d0 [lit] Fix import StringIO errors in Python 3
Remove the cStringIO micro-optimization, as it isn't portable to Python
3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 16:12:53 +00:00
Reid Kleckner
dbeb61f22e [lit] Implement non-pipelined echo commands internally
Summary:
This speeds up the LLD test suite on Windows by 3x. Most of the time is
spent on lld/test/ELF/linkerscript/diagnostics.s, which repeatedly
constructs linker scripts with appending echo commands.

Reviewers: dlj, zturner, modocache

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 16:05:50 +00:00
Daniel Sanders
a216c3246b [globalisel][tablegen] Fix an multi-insn match bug where ComplexPattern is used on multiple insns.
In each rule, each use of ComplexPattern is assigned an element in the Renderers
array. The matcher then collects renderer functions in this array and they are
used to render instructions. This works well for a single instruction but a
bug in the allocation mechanism causes the elements to be assigned on a
per-instruction basis rather than a per-rule basis.

So in the case of:
  (set GPR32:$dst, (Op complex:$src1, complex:$src2))
tablegen currently assigns elements 0 and 1 to $src1 and $src2 respectively,
but for:
  (set GPR32:$dst, (Op complex:$src1, (Op complex:$src2)))
it currently assigned both $src1 and $src2 the same element (0). This results in
one complex operand being rendered twice and the other being forgotten.
This patch corrects the allocation such that $src1 and $src2 are still allocated
different elements in this case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 10:40:18 +00:00
Daniel Sanders
ec48fd1277 [globalisel][tablegen] Correct matching of intrinsic ID's.
TreePatternNode considers them to be plain integers but MachineInstr considers
them to be a distinct kind of operand.

The tweak to AArch64InstrInfo.td to produce a simple test case is a NFC for
everything except GlobalISelEmitter (confirmed by diffing the tablegenerated
files). GlobalISelEmitter is currently unable to infer the type of operands in
the Dst pattern from the operands in the Src pattern.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 08:57:29 +00:00
Craig Topper
41cafc737b vim: add 'builtin', 'nobuiltin', 'nonnull', and 'speculatable' to the keyword list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:28:45 +00:00
Craig Topper
dc02fd0b4d [TableGen] Cleanup capturing of instruction namespace for the fast isel emitter to remove a std::string and duplicated code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307363 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 06:22:36 +00:00
Craig Topper
77eddb74c0 [TableGen] Use StringRef instead of std::string for CodeGenInstruction namespace. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 06:22:35 +00:00
Craig Topper
3e595d0a2b [TableGen] Fix some mismatches in the use of Namespace fields versus Target name in some of our emitters.
Some of our emitters were using the name of the Target to reference things that were created by others emitters using Namespace.

Apparently all targets have the same Target name as their instruction and register Namespace field?

Someone on IRC had a target that didn't do this and was getting build errors. This patch is a necessary, but maybe not sufficient fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307358 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 05:19:25 +00:00
George Karpenkov
80c7e63a6d [lit] Modify LIT to accept environment variable LIT_FILTER to select tests.
This is especially useful when lit is invoked indirectly by the build
system, and additional arguments can not be easily specified.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307339 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 00:22:11 +00:00
Reid Kleckner
f5757f7649 [lit] Factor out some shell input/output redirection logic, NFC
This is a very light refactoring aimed at improving readability. There
is definitely still room for improvement here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 20:40:27 +00:00
Adam Nemet
a5a5f8ef6f [opt-viewer] Move under tools, install it
We weren't installing opt-viewer and co before, this fixes the omission.  I am
also moving the tools from utils/ to tools/.  I believe that this is more
appropriate since these tools have matured greatly in the past year through
contributions by multiple people (thanks!) so they are ready to become
external tools.

The tools are installed under <install>/share/opt-viewer/.

I am *not* adding the llvm- prefix.  If people feel strongly about adding
that, this is probably a good time since the new location will require some
mental adjustment anyway.

Fixes PR33521

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 17:51:15 +00:00
Ilya Biryukov
d8c53d08c3 Fixes to Dockerfile scripts.
- Put buildfiles into /tmp/clang-build/build, instead of /tmp/clang-build.
  We checkout the sources to /tmp/clang-build/src and running
  cmake in /tmp/clang-build was done by mistake.
- Don't add an extra ';' at the start of enabled projects list.
  It worked either way, but looked strange.
- Minor comment update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 13:10:55 +00:00
Ilya Biryukov
45bbe61cd4 Made a script to build docker images easier to use.
Summary:
- Removed double indirection via command-line args (i.e. two `--`
  options of `build_docker_image.sh`).
- Added a comment on how to build 2-stage clang install into the
  `build_docker_image.sh`, it used to be only in the `docs/Docker.rst`.

Reviewers: klimek, mehdi_amini

Reviewed By: klimek

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 12:46:51 +00:00
Daniel Sanders
77d17433e6 [globalisel][tablegen] Rename and re-comment render functions to match the new MatchTables. NFC.
The conversion to MatchTable left the function names and comments referring to
C++ statements and expressions. Updated the names and comments to account for
the fact that they're no longer unconstrained statements/expressions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 10:37:17 +00:00
Daniel Sanders
168fe35d8a [globalisel][tablegen] Rename and re-comment to match the new MatchTables. NFC.
The conversion to MatchTable left the function names and comments referring to
C++ statements and expressions. Updated the names and comments to account for
the fact that they're no longer unconstrained statements/expressions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 10:06:12 +00:00
Daniel Sanders
2e93b3845f [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
Summary:
As of this patch, 1018 out of 3938 rules are currently imported.

Depends on D32275

Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar

Reviewed By: qcolombet

Subscribers: dberris, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 08:12:20 +00:00
David L. Jones
7e0b3ee2a6 [lit] Fix unit test discovery for Visual Studio builds.
Fix by Andrew Ng!

The Visual Studio build can contain output for multiple configuration types (
e.g. Debug, Release & RelWithDebInfo) within the same build output
directory. Therefore when discovering unit tests, the "build mode" sub directory
containing the appropriate configuration is included in the search. This sub
directory may not always be present, so a test for its existence is required.

Reviewers: zturner, modocache, dlj

Reviewed By: zturner, dlj

Subscribers: grimar, bd1976llvm, gbreynoo, edd, jhenderson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 03:23:18 +00:00
Alexander Shaposhnikov
18b16185df [tablegen] Avoid creating temporary strings
If a method / function returns a StringRef but the 
variable is of type const std::string& a temporary string is
created (StringRef has a cast operator to std::string),
which is a suboptimal behavior.

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

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 20:14:54 +00:00
Daniel Sanders
b26b47eeb0 [globalisel][tablegen] Finish fixing compile-time regressions by merging the matcher and emitter state machines.
Summary:
Also, made a few minor tweaks to shave off a little more cumulative memory consumption:
* All rules share a single NewMIs instead of constructing their own. Only one
  will end up using it.
* Use MIs.resize(1) instead of MIs.clear();MIs.push_back(I) and prevent
  GIM_RecordInsn from changing MIs[0].

Depends on D33764

Reviewers: rovka, vitalybuka, ab, t.p.northover, qcolombet, aditya_nandakumar

Reviewed By: ab

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 14:50:18 +00:00
Sjoerd Meijer
8b755a3a21 [AsmParser] Mnemonic Spell Corrector
This implements suggesting other mnemonics when an invalid one is specified,
for example:

$ echo "adXd r1,r2,#3" | llvm-mc -triple arm
<stdin>:1:1: error: invalid instruction, did you mean: add, qadd?
adXd r1,r2,#3
^

The implementation is target agnostic, but as a first step I have added it only
to the ARM backend; so the ARM backend is a good example if someone wants to
enable this too for another target.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307148 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 12:39:13 +00:00
Daniel Sanders
c61a590775 [globalisel][tablegen] Fix the misuse of STATISTICS() on release builds (like r307088) after r307133.
r307133 brought back a couple instances of the same mistake that was already
fixed by r307088. Fixed it again.

Using NumPatternEmitted as a unique id for the tables is not valid on release
builds since the counters don't count in that case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 12:14:18 +00:00
Daniel Sanders
71e8bec63a [globalisel][tablegen] Added instruction emission to the state-machine-based matcher.
Summary:
This further improves the compile-time regressions that will be caused by a
re-commit of r303259.

Also added included preliminary work in preparation for the multi-insn emitter
since I needed to change the relevant part of the API for this patch anyway.

Depends on D33758

Reviewers: rovka, vitalybuka, ab, t.p.northover, qcolombet, aditya_nandakumar

Reviewed By: ab

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 09:39:33 +00:00
Daniel Sanders
32b8ab6f1e [globalisel][tablegen] Fix release builds after r307079
Using NumPatternEmitted as a unique id for the tables is not valid on release
builds since the counters don't count in that case.

Also fix an unused variable warning.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-04 15:31:50 +00:00
Ilya Biryukov
3248821e75 NFC. Removed mention of missing script from build_docker_image.sh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-04 14:41:21 +00:00