Commit Graph

5840 Commits

Author SHA1 Message Date
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
Justin Bogner
ea4e88c5cf TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC
This mapping is between pointers, which DenseMap is particularly good
at. Most targets aren't really affected, but if there's a lot of
subregister composition this can shave off a good chunk of time from
generating registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26 22:29:36 +00:00
Saleem Abdulrasool
4403f2ccc1 FileCheck: Minor cleanup of the class Pattern
1. Add the "explicit" specifier to the single-argument constructor of Pattern
2. Reorder the fields to remove excessive padding (8 bytes).

Patch by Alexander Shaposhnikov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26 16:18:40 +00:00
Craig Topper
08f89d57a0 [X86] Create a new instruction format to handle 4VOp3 encoding. This saves one bit in TSFlags and simplifies MRMSrcMem/MRMSrcReg format handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 07:38:50 +00:00
Craig Topper
91e5e5818d [X86] Create a new instruction format to handle MemOp4 encoding. This saves one bit in TSFlags and simplifies MRMSrcMem/MRMSrcReg format handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 07:38:45 +00:00
Craig Topper
b663f7015c [X86] Space out the encodings of X86 instruction formats. I plan to add some new encodings in future commits and this will reduce the size of those commits. NFC
This tries to keep all the ModRM memory and register forms in their own regions of the encodings. Hoping to make it simple on some of the switch statements that operate on these encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 07:38:41 +00:00
Craig Topper
6e07b06d38 [X86] Merge small helper function into the switch that calls it since they both operate on the same variable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 07:38:36 +00:00
Craig Topper
d30b1a1614 [X86] Explicitly list all X86 instruction forms in switch statement so its easier to detect when one is missing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 07:38:30 +00:00
Justin Bogner
7d7a23e700 Replace a few more "fall through" comments with LLVM_FALLTHROUGH
Follow up to r278902. I had missed "fall through", with a space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 20:30:52 +00:00
David Majnemer
5d08e375ab Use the range variant of remove_if instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 04:32:37 +00:00
David Majnemer
2d62ce6ee8 Use the range variant of find/find_if instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 03:55:06 +00:00
David Majnemer
b0353c6db2 Use the range variant of find_if instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 00:18:03 +00:00
David Majnemer
975248e4fb Use the range variant of find instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 22:21:41 +00:00