Commit Graph

5852 Commits

Author SHA1 Message Date
Michal Gorny
dee2afd336 [lit] Fix test shtest-timeout.py for modern output
Update the CHECK lines in the shtest-timeout.py lit test to account for
the current output. The output has been changed in r271610 without
adjusting the tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 21:40:08 +00:00
Michal Gorny
e58533d1b8 [lit] Fix FormatError on individual test timeout
Differential Revision: https://reviews.llvm.org/D25195

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 21:40:04 +00:00
Brian Gesiak
53d343b998 [lit] Run unit tests as part of lit test suite
Summary:
The Python file `utils/lit/lit/ShUtil.py` contains:

1. Logic used by lit itself
2. A set of unit tests for that logic, which can be run by invoking
  `python utils/lit/lit/ShUtil.py`

Move these unit tests to a `tests/unit` subdirectory of lit, and run
the tests as part of lit's test suite. This ensures that, should the
lit test suite be included in LLVM's own regression test suite, these
unit tests will also be run.

(Instructions on how to run lit's test suite can be found in
`utils/lit/README.txt`.)

Reviewers: ddunbar, echristo, delcypher, beanz

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 03:35:04 +00:00
Adam Nemet
f4b8d7badd [opt-viewer] Remove unnecessary call to demangle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 16:20:40 +00:00
Adam Nemet
2b64f4d24f [opt-viewer] Print hotness as percentage of the maximum hotness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 16:20:38 +00:00
Adam Nemet
43573fb650 [opt-viewer] Convert another HTML output to use a multiline string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 16:19:06 +00:00
Chris Matthews
420b9a4e2b Fix issue which cases lit installed with setup.py to not resolve main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 23:22:11 +00:00
NAKAMURA Takumi
cf0683e0fd Fix llvm-lit.in corresponding to r283710.
Traceback (most recent call last):
    File "bin/llvm-lit", line 44, in <module>
      lit.main(builtin_parameters)
  AttributeError: 'module' object has no attribute 'main'

Suggested by Artem Belevich.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 23:02:42 +00:00
Peter Collingbourne
d735fd7ffe Revert r283690, "MC: Remove unused entities."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 22:49:37 +00:00
Mehdi Amini
15796d29d8 Use StringRef in TableGen generated Intrinsics.gen file (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 19:31:09 +00:00
Brian Gesiak
56f40f8937 [lit] Remove (or allow specific) unused imports
Summary:
Using Python linter flake8 on the utils/lit reveals several linter
warnings designated "F401: Unused import". Fix or silence these
warnings.

Some of these unused imports are legitimate, while some are part of lit's API.
For example, users of lit expect to be able to access `lit.formats.ShTest` in
their `lit.cfg`, despite the module hierarchy for that symbol actually being
`lit.formats.shtest.ShTest`. To silence linter errors for these lines,
include a "noqa" directive.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 01:22:06 +00:00
Brian Gesiak
996fc5bb65 [lit] Remove unused TestingProgressDisplay attr
Summary:
`TestingProgressDisplay` initializes its `current` attribute to `None`, but
never reads or writes the value again. Remove it.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 01:20:43 +00:00
Brian Gesiak
cb351a4ca1 [lit] Fix undefined symbol ArgumentError
Summary:
`ArgumentError` is not defined by the Python standard library.
Executing this line of code would throw a exception, but not the
intended one. It would throw a `NameError` exception, since `ArgumentError`
is undefined.

Use `ValueError` instead, which is defined by the Python standard
library.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 01:19:27 +00:00
Brian Gesiak
4bf8ed1328 [lit] Remove semicolons in Python code
Summary:
Semicolons aren't necessary as statement terminators in Python, and
each of these uses are superfluous as they appear at the end of a line.
The convention is to not use semicolons where not needed, so remove them.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 01:18:14 +00:00
Brian Gesiak
ef541878bd [lit] Remove unused variable in googletest format
Summary: `prefix` is written to but never read.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 01:15:33 +00:00
Brian Gesiak
f475fa9394 [lit] Remove Python 2.6 and below exec workaround
Summary:
The minimum version of Python required to run LLVM's test suite is 2.7.
Remove a workaround for older Python versions.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 01:11:52 +00:00
Peter Collingbourne
c0eb209775 MC: Remove unused entities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 04:39:13 +00:00
Mehdi Amini
3ffe113e11 Turn cl::values() (for enum) from a vararg function to using C++ variadic template
The core of the change is supposed to be NFC, however it also fixes
what I believe was an undefined behavior when calling:

 va_start(ValueArgs, Desc);

with Desc being a StringRef.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 19:41:06 +00:00
Adam Nemet
db695f404d New utility to visualize optimization records
This is a new tool built on top of the new YAML ouput generated from
optimization remarks.  It produces HTML for easy navigation and
visualization.

The tool assumes that hotness information for the remarks is available
(the YAML file was produced with PGO).  It uses hotness to list the
remarks prioritized by the hotness on the index page.  Clicking the
source location of the remark in the list takes you the source where the
remarks are rendedered inline in the source.

For now, the tool is meant as prototype.

It's written in Python.  It uses PyYAML to parse the input.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 17:06:34 +00:00
Peter Collingbourne
81c297eebe FastISel: Remove unused/un-overridden entry points. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 19:25:20 +00:00
Mehdi Amini
d0bf4476a9 Use StringRef in TableGen (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:47:33 +00:00
Mehdi Amini
13e0592eaf Use StringRef in TableGen emitted API for attribute (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:31:39 +00:00
Brian Gesiak
6b3629eb07 [lit] Remove workaround for Python 2.5
Summary:
The minimum version of Python necessary to run the LLVM test suite is
2.7. Code to work around Python 2.5 and lower isn't necessary.

Reviewers: ddunbar, echristo, delcypher, beanz

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 00:15:37 +00:00
Chris Bieneman
6eb10d97ee [lit] Use argparse instead of optparse
Summary:
optparse is deprecated in Python 2.7, which is the minimum version of
Python required to run the LLVM test suite. Replace its usage in lit
with argparse, optparse's 2.7 replacement module.

argparse has several benefits over optparse, but this commit does not
make use of those benefits yet. Instead, it simply uses the new API,
and attempts to keep the number of changes to a minimum.

Confirmed that lit's test suite, as well as LLVM's regression test suite,
still pass with these changes.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz, delcypher

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:12:42 +00:00
Chris Bieneman
1184da191c [lit] Throw in unimplemented method (NFC)
Summary:
lit's `OneCommandFileTest` class implements an abstract method that
raises if called. However, it raises by referencing an undefined
symbol. Instead, raise explicitly by throwing a `NotImplementedError`.
This is clearer, and appeases Python linters.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:48:22 +00:00
Chris Bieneman
245ab62a27 [lit] Remove unused imports (NFC)
Reviewers: ddunbar, echristo, beanz

Patch by Brian Gesiak!

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:48:18 +00:00
Chris Bieneman
47cdc1615e [lit] Compare to None using identity, not equality
Summary:
In Python, `None` is a singleton, so checking whether a variable is
`None` may be done with `is` or `is not`. This has a slight advantage
over equiality comparisons `== None` and `!= None`, since `__eq__` may
be overridden in Python to produce sometimes unexpected results.

Using `is None` and `is not None` is also recommended practice in
https://www.python.org/dev/peps/pep-0008:

> Comparisons to singletons like `None` should always be done with `is` or
> `is not`, never the equality operators.

Patch by Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:48:13 +00:00
Mehdi Amini
793d2a4ced Use StringRef for MemoryBuffer identifier API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 16:38:28 +00:00
Joerg Sonnenberger
f98f3575ee Remove LLVM_CONFIGTIME, left-overs from when reproducable builds where
not the default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 21:00:53 +00:00
Daniel Dunbar
97c9e0212d [lit] Add instructions to run lit's test suite
- Patch by Brian Gesiak.
 
 - https://reviews.llvm.org/D24968

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 18:58:50 +00:00
Daniel Dunbar
09e2479ca3 [lit] Fix refacto introduced by rL282479.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 16:17:42 +00:00
Dimitar Vlahovski
6be6db9224 Trying to fix lldb build breakage probably caused by rL282452
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 10:34:43 +00:00
Daniel Dunbar
cd04c01efb [lit] Add a --max-failures option.
- This is primarily useful as a "fail fast" mode for lit, where it will stop
   running tests after the first failure.

 - Patch by Max Moiseev.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 23:38:23 +00:00
Vedant Kumar
c2ac1a71c3 [utils] Teach the code coverage prep script about --restrict
Add two options to the code coverage artifact prep script:

  * --use-existing-profdata: Use an existing indexed profile instead of
    merging the same profiles again.
  * --restrict: Restrict the coverage reporting to the given list of
    source directories.

With this in place, we can teach the coverage bot how to prepare
separate reports for each of the llvm tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:49 +00:00
Justin Bogner
40e5ccb260 Revert "TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC"
It turns out we iterate over this map a fair amount and the order
matters for clang to be deterministic. See:

  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160919/391315.html

This reverts r279875.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 00:25:45 +00:00
Vedant Kumar
7b1bb280cd [utils] Delete the 'check-coverage-regressions' script
In practice, it's way too noisy.

It's also a maintenance burden, since we apparently can't add tests for
it without breaking some Windows setups (see: D22692).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:11 +00:00
Hans Wennborg
837806b92c build_llvm_package.bat: Update to VS2015 and include LLDB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 23:01:03 +00:00
Sjoerd Meijer
82d457bf36 This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:20:03 +00:00
Sjoerd Meijer
48f6957bd7 Revert of r281304 as it is causing build bot failures in hexagon
hwloop regression tests. These tests pass locally; will be investigating
where these differences come from.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281306 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 08:51:59 +00:00
Sjoerd Meijer
0298251f19 This adds a new field isAdd to MCInstrDesc. The ARM and Hexagon instruction
descriptions now tag add instructions, and the Hexagon backend is using this to
identify loop induction statements.

Patch by Sam Parker and Sjoerd Meijer.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 08:08:06 +00:00
Michael Gottesman
1f4e68f079 [cmake] Export gtest/gtest_main and its dependencies via a special build tree only cmake exports file.
Previously, gtest/gtest_main were not exported via cmake. The intention here was
to ensure that users whom are linking against the LLVM install tree would not
get the gtest/gtest_main targets. This prevents downstream projects that link
against the LLVM build tree (i.e. Swift) from getting this dependency
information in their cmake builds. Without such dependency information, linker
issues can result on linux due to LLVMSupport being put before gtest on the
linker command line.

This commit preserves behavior that we want for the install tree, while adding
support for the build tree by:

1. The special casing for gtest/gtest_main in the add_llvm_library code is
removed in favor of a flag called "BUILDTREE_ONLY". If this is set, then the
library is communicating that it is only meant to be exported into the build
tree and is not meant to be installed or exported via the install tree. This
part is just a tweak to remove the special case, the underlying code is the
same.

2. The cmake code that exports cmake targets for the build tree has special code
to import an additional targets file called
LLVMBuildTreeOnlyExports.cmake. Additionally the extra targets are added to the
LLVMConfig.cmake's LLVM_EXPORTED_TARGETS variable. In contrast, the
"installation" cmake file uses the normal LLVM_EXPORTS_TARGETS as before and
does not include the extra exports file. This is implemented by
defining/undefining variables when performing a configure of the build/install
tree LLVMConfig.cmake files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 19:45:34 +00:00
Sam Kolton
e3aa0d989e [TableGen] AsmMatcher: Add AsmVariantName to Instruction class.
Summary:
This allows specifying instructions that are available only in specific assembler variant. If AsmVariantName is specified then instruction will be presented only in MatchTable for this variant. If not specified then assembler variants will be determined based on AsmString.
Also this allows splitting assembler match tables in same way as it is done in dissasembler.

Reviewers: ab, tstellarAMD, craig.topper, vpykhtin

Subscribers: wdng

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 15:50:52 +00:00
Ahmed Bougacha
7c60fc0c62 [lit] Downgrade error to warning on gtest crashes during discovery.
Lots of unittests started failing under asan after r280455.  It seems
they've been failing for a long time, but lit silently ignored them.

Downgrade the error so we can figure out what is going on.
Filed http://llvm.org/PR30285.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-05 20:53:14 +00:00
NAKAMURA Takumi
2b9ec0812b lit/util.py: Another fix for py3.
'str' object has no attribute 'decode'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280641 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-05 00:00:40 +00:00
NAKAMURA Takumi
3be2bb7988 Make lit/util.py py3-compatible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-03 04:06:37 +00:00
Ivan Krasin
0c194fe701 lit: print process output, if getting the list of google-tests failed.
Summary:
This is a follow up to r280455, where a check for the process exit code
was introduced. Some ASAN bots throw this error now, but it's impossible
to understand what's wrong with them, and the issue is not reproducible.

Reviewers: vitalybuka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 22:31:24 +00:00
Reid Kleckner
b60590f078 Quick fix to make LIT_PRESERVES_TMP work again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 16:33:15 +00:00
Reid Kleckner
5dd7b750fc [lit] Clean up temporary files created by tests
Do this by creating a temp directory in the normal system temp
directory, and cleaning it up on exit.

It is still possible for this temp directory to leak if Python exits
abnormally, but this is probably good enough for now.

Fixes PR18335

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 16:29:24 +00:00
Greg Parker
f931a64158 [lit] Fail testing if a googletest executable crashes during test discovery
googletest formatted tests are discovered by running the test executable. 
Previously testing would silently succeed if the test executable crashed 
during the discovery process. Now testing fails with "error: unable to 
discover google-tests ..." if the test executable exits with a non-zero status.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 02:44:07 +00:00
Reid Kleckner
23bc604438 [lit] Use multiprocessing by default on Windows
Apparently nobody evaluated multiprocessing on Windows since Daniel
enabled multiprocessing on Unix in r193279. It works so far as I can
tell.

Today this is worth about an 8x speedup (631.29s to 73.25s) on my 24
core Windows machine. Hopefully this will improve Windows buildbot cycle
time, where currently it takes more time to run check-all than it does
to self-host with assertions enabled:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/20
  build stage 2 ninja all ( 28 mins, 22 secs )
  ninja check 2 stage 2   ( 37 mins, 38 secs )

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 17:19:44 +00:00