Commit Graph

5968 Commits

Author SHA1 Message Date
Daniel Sanders
ca24065b98 [globalisel] Tablegen-erate current Register Bank Information
Summary:
Adds a RegisterBank tablegen class that can be used to declare the register
banks and an associated tablegen pass to generate the necessary code.

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

Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 15:20:43 +00:00
Craig Topper
f031545412 [X86] Merge the disassemblers handling of the different TYPE_RELs by getting the size information from the ENCODING field. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292096 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 06:49:09 +00:00
Craig Topper
14d16cc514 [X86] Reduce the number of operand 'types' the disassembler needs to deal with. NFCI
We were frequently checking for a list of types and the different types
conveyed no real information. So lump them together explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292095 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 06:49:03 +00:00
Craig Topper
75deb64c6f [AVX-512] Begin giving the disassembler a way to recognize that VSIB is a different encoding than regular addressing modes.
This part first teaches it not to check error if EVEX.V2 is used by a VSIB instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292093 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 05:44:25 +00:00
Craig Topper
00915333a9 [AVX-512] Correct memory operand size for VPGATHERQPS and VPGATHERQD
with ZMM index. Similar for SCATTER and the prefetch gather and scatter
instructions.

Fixes PR31618.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:55:58 +00:00
Daniel Berlin
bd42d0623a Update update_test_checks so that . is a valid identifier character in addition to _
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292056 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 07:40:46 +00:00
Nikolai Bozhenov
d4a4367ac0 [utils] Improve extraction of check prefixes from RUN lines
Correct handling of the following FileCheck options is implemented in
update_llc_test_checks.py and update_test_checks.py scripts:

1) -check-prefix (with a single dash)
2) -check-prefixes (with multiple prefixes)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 09:39:35 +00:00
Daniel Berlin
9567625d9c Fix update_test_checks not to accidentally believe type names are variable names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:54:15 +00:00
Ivan Krasin
eccbfd44dd Fix UBSan bots by blacklisting bits/stl_tree.h.
Summary:
libstdc++ has some undefined behavior in bits/stl_tree.h that
has recently became excercised by some of the LLVM code.
Given that fixing libstdc++ will take years, adding the file
into a blacklist to fix bots seems like a necessity.

Reviewers: vitalybuka

Subscribers: llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 17:30:10 +00:00
Hans Wennborg
f6fc33e0fd Bump trunk version to 5.0.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 21:22:36 +00:00
Hans Wennborg
bc6b23e676 build_llvm_package.bat: Add note about what SWIG version to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:42:31 +00:00
Chandler Carruth
a618f4d4ce [gmock] Teach gmock ElementsAre and BeginEndDistanceIs matchers to
handle generic ranges by using std::begin and std::end rather than
requiring things to look exactly like an STL container.

Much of the credit for this goes to Dave Blaikie who helped me figure
out the right incantations.

This will probably be re-designed when I send this to the maintainers of
gmock, so I've instead structured it to change is little as possible
while it is a local patch. That makes it somewhat ugly, but I think a focused
change is better for getting this to work for LLVM today and letting the
upstream maintainers figure out the correct long-term pattern.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:16:03 +00:00
Chandler Carruth
054b6040e5 Add the 'googlemock' component of Google Test to LLVM's unittest libraries.
I have two immediate motivations for adding this:
1) It makes writing expectations in tests *dramatically* easier. A
   quick example that is a taste of what is possible:

     std::vector<int> v = ...;
     EXPECT_THAT(v, UnorderedElementsAre(1, 2, 3));

   This checks that v contains '1', '2', and '3' in some order. There
   are a wealth of other helpful matchers like this. They tend to be
   highly generic and STL-friendly so they will in almost all cases work
   out of the box even on custom LLVM data structures.

   I actually find the matcher syntax substantially easier to read even
   for simple assertions:

     EXPECT_THAT(a, Eq(b));
     EXPECT_THAT(b, Ne(c));

   Both of these make it clear what is being *tested* and what is being
   *expected*. With `EXPECT_EQ` this is implicit (the LHS is expected,
   the RHS is tested) and often confusing. With `EXPECT_NE` it is just
   not clear. Even the failure error messages are superior with the
   matcher based expectations.

2) When testing any kind of generic code, you are continually defining
   dummy types with interfaces and then trying to check that the
   interfaces are manipulated in a particular way. This is actually what
   mocks are *good* for -- testing *interface interactions*. With
   generic code, there is often no "fake" or other object that can be
   used.

   For a concrete example of where this is currently causing significant
   pain, look at the pass manager unittests which are riddled with
   counters incremented when methods are called. All of these could be
   replaced with mocks. The result would be more effective at testing
   the code by having tighter constraints. It would be substantially
   more readable and maintainable when updating the code. And the error
   messages on failure would have substantially more information as
   mocks automatically record stack traces and other information *when
   the API is misused* instead of trying to diagnose it after the fact.

I expect that #1 will be the overwhelming majority of the uses of gmock,
but I think that is sufficient to justify having it. I would actually
like to update the coding standards to encourage the use of matchers
rather than any other form of `EXPECT_...` macros as they are IMO
a strict superset in terms of functionality and readability.

I think that #2 is relatively rarely useful, but there *are* cases where
it is useful. Historically, I think misuse of actual mocking as
described in #2 has led to resistance towards this framework. I am
actually sympathetic to this -- mocking can easily be overused. However
I think this is not a significant concern in LLVM. First and foremost,
LLVM has very careful and rare exposure of abstract interfaces or
dependency injection, which are the most prone to abuse with mocks. So
there are few opportunities to abuse them. Second, a large fraction of
LLVM's unittests are testing *generic code* where mocks actually make
tremendous sense. And gmock is well suited to building interfaces that
exercise generic libraries. Finally, I still think we should be willing
to have testing utilities in tree even if they should be used rarely. We
can use code review to help guide the usage here.

For a longer and more complete discussion of this, see the llvm-dev
thread here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108672.html

The general consensus seems that this is a reasonable direction to start
down, but that doesn't mean we should race ahead and use this
everywhere. I have one test that is blocked on this to land and that was
specifically used as an example. Before widespread adoption, I'm going
to work up some (brief) guidelines as some of these facilities should be
used sparingly and carefully.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 22:32:26 +00:00
Daniel Berlin
d7c9322f96 Fix function regex in update_tests so it can handle {}'s in function args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 19:24:19 +00:00
Daniel Berlin
91a00349ed Update update_test_checks to work properly with phi nodes and other fun things.
Summary:
Prior to this change, phi nodes were never considered defs, and so we ended up with undefined variables for any loop.  Now, instead of trying to find just defs, we iterate over each actual IR value in the line, and replace them one by one with either a definition or a use.

We also don't try to match anything in the comment portions of the line.

I've tested it even on things like function pointer calls, etc, and against existing test cases uses update_test_checks
With this change, we are able to use update_tests on the cyclic cases in newgvn.

The only case i'm aware of that will misfire is if you have a string with which contains a valid token.
However, this is the same as it is now, with a slightly larger set of strings that may misfire.
Prior to this change, a test with the string " %a =" would be replaced.

Reviewers: spatel, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 19:04:59 +00:00
Chandler Carruth
2ff6bc0d1d [gtest] Detect warning flags using the positive spelling.
Some GCC versions will accept any warning flag name after a '-Wno-',
which would cause us to try to disable warnings with names GCC didn't
understand. This will silently succeed unless there is some other output
from GCC in which case we get weird cc1plus warnings about the warning
name being bogus.

There is still the issue that gtest sets warning flags for building
gtest-all.cc using weird 'add_definitions' and the fact that there is
a GCC version which warns on the variadic macro usage in gtest under
-pedantic, but has no flag analogous to Clang's
-Wgnu-zero-variadic-macro-argumnets to suppress this warning. I haven't
been able to come up with any good solution here. The closest is to turn
off -pedantic for those versions of GCC, but that seems really nasty.
For now, those versinos of GCC aren't warning clean. If anyone is broken
by this, I'll work on CMake logic to detect and disable -pedantic in
these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:16:00 +00:00
Chandler Carruth
7db9a51605 [gtest] Work around broken installs of libc++ where we don't have
a cxxabi.h in the include search paths.

This comes up when libc++ is installed with some other abi library. At
some points in time in history we have had CMake hackery to try and get
a cxxabi.h installed that would work, but there are lots of examples
lacking this. Also, the just-built tree with libc++ seems to not quite
get this right.

To let folks make progress, we can easily work around this by detecting
that the header is missing and disabling the relevant parts of gtest.
This should fix the last remainging build bot failures. While these
failures are typically indicative of a questionable install, I don't
think gtest should be the thing that surfaces those issues and I don't
want folks blocked on this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 01:41:49 +00:00
Reid Kleckner
eb7f57f21d Patch gtest to move GTEST_IS_THREADSAFE out of unrelated GTEST_HAS_SEH ifdef
Fixes the sanitizer Windows build, which happens to set
-DGTEST_HAS_SEH=0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 00:00:05 +00:00
Chandler Carruth
4be13d6363 [gtest] Upgrade googletest to version 1.8.0, minimizing local changes.
This required re-working the streaming support and lit's support for
'--gtest_list_tests' but otherwise seems to be a clean upgrade.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 23:06:03 +00:00
Bryant Wong
e0c04cd12c Fix indentation in r290716.
Use two-space indentation like the rest of the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-29 20:05:51 +00:00
Bryant Wong
1470f5b2ad Correctly handle multi-lined RUN lines.
`utils/update_{llc_test,test}_checks` ought to be able to handle RUN commands
that span multiple lines, as shown in the example at
http://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-29 19:32:34 +00:00
Eric Fiselier
10a1d173cc Mark comparator call operator as const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-27 23:15:58 +00:00
Bryant Wong
efdef29733 Fix update_test_checks.py bug that incorrectly truncates IR body.
Differential Revision: https://reviews.llvm.org/D26619

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 23:46:55 +00:00
NAKAMURA Takumi
c9cceceaf3 KillTheDoctor.cpp: Appease cases on case-senstitive host, like mingw on linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 01:39:26 +00:00
NAKAMURA Takumi
0b79f4e661 KillTheDoctor: Add a required system lib, psapi. KillTheDoctor itself uses Win32 API directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 01:39:20 +00:00
Tim Shen
1fdcb62832 [PowerPC] Add ppc support to update_llc_test_checks.py, and ppc tests. NFC.
Reviewers: chandlerc, hfinkel, echristo, iteratee

Subscribers: mehdi_amini, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22 20:59:39 +00:00
Reid Kleckner
1d481d5a86 Build KillTheDoctor with mingw-w64
compiler-rt uses it in its lit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22 19:11:42 +00:00
Ahmed Bougacha
8097fcb40b [GlobalISel] Add basic Selector-emitter tblgen backend.
This adds a basic tablegen backend that analyzes the SelectionDAG
patterns to find simple ones that are eligible for GlobalISel-emission.

That's similar to FastISel, with one notable difference: we're not fed
ISD opcodes, so we need to map the SDNode operators to generic opcodes.
That's done using GINodeEquiv in TargetGlobalISel.td.

Otherwise, this is mostly boilerplate, and lots of filtering of any kind
of "complicated" pattern. On AArch64, this is sufficient to match G_ADD
up to s64 (to ADDWrr/ADDXrr) and G_BR (to B).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 23:26:20 +00:00
Antonio Maiorano
a7e8ae4b08 Improve natvis for llvm::SmallString so that it correctly displays only the valid portion of the string
The usual method, and the one employed before my change, of displaying strings in natvis is to make use of the "<variable>,s" format specifier; however, this method only works for null-terminated strings. My fix here is to use the "<pointer>,[size]" format specifier to display a bounded array, and then cast it to "const char*", which in the MSVC debugger has the desired effect of rendering the character array as a string.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 01:05:29 +00:00
Rui Ueyama
ab968f698e Remove extraneous space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 05:49:56 +00:00
Eli Friedman
97cbb36487 Add ARM support to update_llc_test_checks.py
Just the minimal support to get it working at the moment.

Includes checks for test/CodeGen/ARM/vzip.ll as an example.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 23:09:51 +00:00
Craig Topper
7e2d9b02d8 [TableGen] Use 'unsigned' instead of 'bool' in a place where the code conditionally assigns numeric values. They happen to be 0 and 1 so this is NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 08:35:08 +00:00
Tom de Vries
8d31c8a13a [FileCheck] Fix --strict-whitespace --match-full-lines
Make sure FileCheck --strict-whitespace --match-full-lines translates
'CHECK: bla ' into pattern '^ bla $' instead of pattern '^bla$'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 20:45:59 +00:00
Tom de Vries
9cbd609664 [FileCheck] Fix comment in ReadCheckFile
The comment in ReadCheckFile claims that both leading and trailing whitespace
are removed, but the associated statement only removes leading whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 09:41:20 +00:00
David Blaikie
980f5c56b4 GDB pretty printers: Basic DenseMap support
Still prints the empty/tombstone keys (which some people would prefer,
but I find pretty noisy) because I haven't yet found a reliable way to
skip them (it requires calling into the running process to do so, which
isn't ideal for a pretty printer (doesn't work on a core file, for
example) - and gdb's ability to do so (or my ability to figure out how
to get gdb to do so) is limited) left some breadcrumbs for the next
person who might try to address that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 23:53:14 +00:00
David Blaikie
4bdcc320cf GDB pretty printer for llvm::Optional
(some other implementations of an optional pretty printer print the full
name of the optional type (including template parameter) - but seems if
the template parameter isn't printed for std::vector, not sure why it
would be printed for optional, so erring on the side of consistency in
that direction here - compact, etc, as well)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:16:22 +00:00
Krzysztof Parzyszek
308c60d0cb Implement LaneBitmask::any(), use it to replace !none(), NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:11:56 +00:00
Krzysztof Parzyszek
65440dd40b Fix ubsan failures in lane mask shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 16:08:49 +00:00
Krzysztof Parzyszek
d6ca3f019d Extract LaneBitmask into a separate type
Specifically avoid implicit conversions from/to integral types to
avoid potential errors when changing the underlying type. For example,
a typical initialization of a "full" mask was "LaneMask = ~0u", which
would result in a value of 0x00000000FFFFFFFF if the type was extended
to uint64_t.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 14:36:06 +00:00
Dylan McKay
9a24ed6ddc [AVR] Whitelist the avrlit config environment variables
This allows us to use `lit` to run on-target execution tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:04:53 +00:00
Renato Golin
d3ab946f0d Revert "[AVR] Add the very first on-target test"
This reverts commit r289648, as it's an execution test and relies on the
emulator/dispatcher being available on all builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289651 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 13:24:20 +00:00
Dylan McKay
36bda32697 [AVR] Add the very first on-target test
This test runs on actual AVR hardware.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 12:03:39 +00:00
Eugene Zelenko
359c877504 [AMDGPU, PowerPC, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-12 22:23:53 +00:00
Chandler Carruth
fb88888f75 [FileCheck] Re-implement the logic to find each check prefix in the
check file to not be unreasonably slow in the face of multiple check
prefixes.

The previous logic would repeatedly scan potentially large portions of
the check file looking for alternative prefixes. In the worst case this
would scan most of the file looking for a rare prefix between every
single occurance of a common prefix. Even if we bounded the scan, this
would do bad things if the order of the prefixes was "unlucky" and the
distant prefix was scanned for first.

None of this is necessary. It is straightforward to build a state
machine that recognizes the first, longest of the set of alternative
prefixes. That is in fact exactly whan a regular expression does.

This patch builds a regular expression once for the set of prefixes and
then uses it to search incrementally for the next prefix. This requires
some threading of state but actually makes the code dramatically
simpler. I've also added a big comment describing the algorithm as it
was not at all obvious to me when I started.

With this patch, several previously pathological test cases in
test/CodeGen/X86 are 5x and more faster. Overall, running all tests
under test/CodeGen/X86 uses 10% less CPU after this, and because all the
slowest tests were hitting this, finishes in 40% less wall time on my
system (going from just over 5.38s to just over 3.23s) on a release
build! This patch substantially improves the time of all 7 X86 tests
that were in the top 20 reported by --time-tests, 5 of them are
completely off the list and the remaining 2 are much lower. (Sadly, the
new tests on the list include 2 new X86 ones that are slow for unrelated
reasons, so the count stays at 4 of the top 20.)

It isn't clear how much this helps debug builds in aggregate in part
because of the noise, but it again makes mane of the slowest x86 tests
significantly faster (10% or more improvement).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 12:49:05 +00:00
Chandler Carruth
9585dcb77c [FileCheck] Remove a parameter that was simply always set to
a commandline flag and test the flag directly. NFC.

If we ever need this generality it can be added back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 10:22:17 +00:00
Chandler Carruth
ac7830ed77 [FileCheck] Clean up doxygen comments throughout. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 10:16:21 +00:00
Chandler Carruth
b541b81d2d [FileCheck] Run clang-format over this code. NFC.
This fixes one formatting goof I left in my previous commit and *many*
other inconsistencies.

I'm planning to make substantial changes here and so wanted to get to
a clean baseline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 09:54:36 +00:00
Chandler Carruth
79aaa0b849 Refactor FileCheck some to reduce memory allocation and copying. Also
make some readability improvements.

Both the check file and input file have to be fully buffered to
normalize their whitespace. But previously this would be done in a stack
SmallString and then copied into a heap allocated MemoryBuffer. That
seems pretty wasteful, especially for something like FileCheck where
there are only ever two such entities.

This just rearranges the code so that we can keep the canonicalized
buffers on the stack of the main function, use reasonably large stack
buffers to reduce allocation. A rough estimate seems to show that about
80% of LLVM's .ll and .s files will fit into a 4k buffer, so this should
completely avoid heap allocation for the buffer in those cases. My
system's malloc is fast enough that the allocations don't directly show
up in timings. However, on some very slow test cases, this saves 1% - 2%
by avoiding the copy into the heap allocated buffer.

This also splits out the code which checks the input into a helper much
like the code to build the checks as that made the code much more
readable to me. Nit picks and suggestions welcome here. It has really
exposed a *bunch* of stuff that could be cleaned up though, so I'm
probably going to go and spring clean all of this code as I have more
changes coming to speed things up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289378 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 09:50:05 +00:00
Eugene Zelenko
43dec7d682 [AMDGPU, PowerPC, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 22:06:55 +00:00
Weiming Zhao
943496ffc4 Summary: Currently there is no way to disable deprecated warning from asm like this
clang  -target arm deprecated-asm.s -c
  deprecated-asm.s:30:9: warning: use of SP or PC in the list is deprecated
       stmia   r4!, {r12-r14}

We have to have an option what can disable it.

Patched by Yin Ma!

Reviewers: joey, echristo, weimingz

Subscribers: llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:55:13 +00:00