1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

5829 Commits

Author SHA1 Message Date
Matthias Braun
2bcd3146a4 TableGen: Use StringInit instead of std::string for DagInit arg names
llvm-svn: 288644
2016-12-05 06:00:46 +00:00
Matthias Braun
b307bcfb02 TableGen: Use StringInit instead of std::string for DagInit name
llvm-svn: 288643
2016-12-05 06:00:41 +00:00
Matthias Braun
9e5ef1c46f TableGen: Use StringRef instead of const std::string& in return vals.
This will allow to switch to a different string storage in an upcoming
commit.

llvm-svn: 288612
2016-12-04 05:48:16 +00:00
Vedant Kumar
907de80fa2 [tablegen] Delete duplicates from a vector without skipping elements
Tablegen's -gen-instr-info pass has a bug in its emitEnums() routine.
The function intends for values in a vector to be deduplicated, but it
accidentally skips over elements after performing a deletion.

I think there are smarter ways of doing this deduplication, but we can
do that in a follow-up commit if there's interest. See the thread:
[PATCH] TableGen InstrMapping Bug fix.

Patch by Tyler Kenney!

llvm-svn: 288408
2016-12-01 19:38:50 +00:00
Vedant Kumar
20cf34db97 Remove unused header, NFC.
llvm-svn: 288407
2016-12-01 19:38:48 +00:00
Kuba Mracek
57a1014fb2 Recommit r287403 (reverted in r287804): [lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path.
This shouls now be safe and not break any more bots.  It's strictly better to use '--sdk macosx', otherwise xcrun can return weird things for example when you have Command Line Tools or the SDK installed into '/'.

llvm-svn: 288385
2016-12-01 17:45:22 +00:00
Mehdi Amini
8b7ab68531 [git-llvm] Use --force-interactive when commiting to enable SVN to prompt password
When svn does not know the password and it has to prompt, it needs to query.
However it won't when invoked from the Python script and instead fails with:

svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option

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

llvm-svn: 288266
2016-11-30 19:12:53 +00:00
Eugene Zelenko
78b21da28a Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.

llvm-svn: 288256
2016-11-30 17:48:10 +00:00
Benjamin Kramer
cc27780987 Apply clang-tidy's 'performance-faster-string-find' check to LLVM.
No functionality change intended.

llvm-svn: 288235
2016-11-30 10:01:11 +00:00
Jacob Baungard Hansen
8766e146a7 TableGen: Allow signed immediates for instruction aliases
Patch by Daniel Cederman.

Reviewers: stoklund, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 287856
2016-11-24 08:53:28 +00:00
Vedant Kumar
8cd1c5209c Revert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path."
This reverts commit r287403. It breaks an internal asan bot. According
to Kuba, a fix is up for review here: https://reviews.llvm.org/D26929

llvm-svn: 287804
2016-11-23 20:51:09 +00:00
Andrew Kaylor
4ae6506d2b Add IntrInaccessibleMemOnly property for intrinsics
Differential Revision: https://reviews.llvm.org/D26485

llvm-svn: 287680
2016-11-22 19:16:04 +00:00
Craig Topper
bdb08b1040 [TableGen][ISel] When factoring ScopeMatcher, if the child of the ScopeMatcher we're working on is also a ScopeMatcher, merge all its children into the one we're working on.
There were several cases in X86 where we were unable to fully factor a ScopeMatcher but created nested ScopeMatchers for some portions of it. Then we created a SwitchType that split it up and further factored it so that we ended up with something like this:

SwitchType
  Scope
    Scope
      Sequence of matchers
      Some other sequence of matchers
    EndScope
    Another sequence of matchers
  EndScope
...Next type

This change turns it into this:

SwitchType
  Scope
    Sequence of matchers
    Some other sequence of matchers
    Another sequence of matchers
  EndScope
...Next type

Several other in-tree targets had similar nested scopes like this. Overall this doesn't save many bytes, but makes the isel output a little more regular.

llvm-svn: 287624
2016-11-22 07:00:06 +00:00
Jacob Baungard Hansen
bc964a0654 [Sparc] Use target name instead of namespace as prefix for MCRegisterClasses array
Summary:
For Sparc the namespace (SP) is different from the target name (Sparc),
which causes the name of the array in this declaration to differ from
the name used in the definition.

Patch by Daniel Cederman.

Reviewers: jyknight

Subscribers: llvm-commits, jyknight

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

llvm-svn: 287528
2016-11-21 09:33:05 +00:00
Craig Topper
c5ad05d406 [TableGen][ISel] Do a better job of factoring ScopeMatchers created during creation of SwitchTypeMatcher.
Previously we were factoring when the ScopeMatcher was initially created, but it might get more Matchers added to it later. Delay factoring until we have fully created/populated the ScopeMatchers.

This reduces X86 isel tables by 154 bytes.

llvm-svn: 287520
2016-11-21 04:07:58 +00:00
Daniel Sanders
206a49e5a7 Try again to fix unused variable warning on lld-x86_64-darwin13 after r287439.
The previous attempt didn't work. I assume LLVM_ATTRIBUTE_UNUSED isn't
available on that machine.

llvm-svn: 287442
2016-11-19 14:47:41 +00:00
Daniel Sanders
811dc2eda3 Check that emitted instructions meet their predicates on all targets except ARM, Mips, and X86.
Summary:
* ARM is omitted from this patch because this check appears to expose bugs in this target.
* Mips is omitted from this patch because this check either detects bugs or deliberate
  emission of instructions that don't satisfy their predicates. One deliberate
  use is the SYNC instruction where the version with an operand is correctly
  defined as requiring MIPS32 while the version without an operand is defined
  as an alias of 'SYNC 0' and requires MIPS2.
* X86 is omitted from this patch because it doesn't use the tablegen-erated
  MCCodeEmitter infrastructure.

Patches for ARM and Mips will follow.

Depends on D25617

Reviewers: tstellarAMD, jmolloy

Subscribers: wdng, jmolloy, aemerson, rengolin, arsenm, jyknight, nemanjai, nhaehnle, tstellarAMD, llvm-commits

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

llvm-svn: 287439
2016-11-19 13:05:44 +00:00
Daniel Sanders
83b3fb38b8 [tablegen] Merge duplicate definitions of getMinimalTypeForRange. NFC.
Summary: Depends on D25614

Reviewers: qcolombet

Subscribers: qcolombet, beanz, mgorny, llvm-commits

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

llvm-svn: 287438
2016-11-19 12:21:34 +00:00
Kuba Mracek
d9a5ffbbe0 [lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path.
This will make sure that we find an actual path in case you have Command Line Tools installed.

llvm-svn: 287403
2016-11-18 23:25:57 +00:00
Matthias Braun
bcd40e41de Timer: Track name and description.
The previously used "names" are rather descriptions (they use multiple
words and contain spaces), use short programming language identifier
like strings for the "names" which should be used when exporting to
machine parseable formats.

Also removed a unused TimerGroup from Hexxagon.

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

llvm-svn: 287369
2016-11-18 19:43:18 +00:00
Daniel Sanders
a7874b33b4 Fix -Wunused introduced in r286945 for release builds.
llvm-svn: 286946
2016-11-15 10:13:09 +00:00
Daniel Sanders
9f8662ee6e [tablegen] Extract portions of AsmMatcherEmitter for re-use by another generator. NFC.
Summary:
This change is preparation for a change that will allow targets to verify that the instructions
they emit meet the predicates they specify. This is useful to ensure that C++
legalization/lowering/instruction-selection doesn't incorrectly select code for a different
subtarget than intended. Such cases are not caught by the integrated assembler when emitting
instructions directly to an object file.

Reviewers: qcolombet

Subscribers: qcolombet, beanz, mgorny, llvm-commits, modocache

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

llvm-svn: 286945
2016-11-15 09:51:02 +00:00
Adam Nemet
26f675cbf1 [opt-viewer] Add support for libYAML for faster parsing
This results in a speed-up of over 6x on sqlite3.

Before:

$ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html
  real 415.07
  user 410.00
  sys 4.66

After with libYAML:

$ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html
  real 63.96
  user 60.03
  sys 3.67

I followed these steps to get libYAML working with PyYAML: http://rmcgibbo.github.io/blog/2013/05/23/faster-yaml-parsing-with-libyaml/

llvm-svn: 286942
2016-11-15 08:40:51 +00:00
Adam Nemet
f025804d9c [opt-viewer] Don't fail with remarks without debug location
llvm-svn: 286861
2016-11-14 18:38:48 +00:00
Stephan Bergmann
c8546c7af1 Handle non-inlined clang::Type::getAs specializations in extract_symbols.py
The existing logic was to discard any symbols representing function template
instantiations, as the definitions were assumed to be inline. But there are
three explicit specializations of clang::Type::getAs that are only defined in
Clang's lib/AST/Type.cpp, and at least the plugin used by the LibreOffice build
(https://wiki.documentfoundation.org/Development/Clang_plugins) uses those
functions.

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

llvm-svn: 286841
2016-11-14 17:07:09 +00:00
Mehdi Amini
e56043cb3d Improve git llvm push to suggest git pull when applying patch fails
Differential Revision: https://reviews.llvm.org/D26565

llvm-svn: 286695
2016-11-12 01:17:59 +00:00
Richard Trieu
f6cbc4ff7c Print correct directory in merge script.
When providing the project directory to the merge script, print it out in the
commit instructions instead of the default project directory.

llvm-svn: 286675
2016-11-11 23:26:28 +00:00
Adam Nemet
e1a960b7a5 [opt-viewer] Make it work in the absence of hotness information
In this case the index page is sorted by the source location.

llvm-svn: 286572
2016-11-11 06:11:56 +00:00
Mandeep Singh Grang
a28582ba38 [opt-viewer] PEPify opt-viewer.py
Reviewers: anemet

Subscribers: fhahn

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

llvm-svn: 286564
2016-11-11 04:51:27 +00:00
Adam Nemet
eb13622ad7 [opt-viewer] Add column number support
With this the yellow (bubble) part of the remark shows up under the
corresponding expression.

llvm-svn: 286545
2016-11-11 01:51:34 +00:00
Adam Nemet
30161c9292 [opt-viewer] Display inlining context
When a function is inlined, each instance is optimized in their own
inlining context.  This can produce different remarks all pointing to
the same source line.

This adds a new column on the source view to display the inlining
context.

llvm-svn: 286537
2016-11-11 01:25:04 +00:00
Adam Nemet
f5ebf8ea93 [opt-viewer] Add option to set source directory
llvm-svn: 286536
2016-11-11 01:08:02 +00:00
Adam Nemet
02063796f2 [opt-viewer] Mention Pygments in the description
llvm-svn: 286535
2016-11-11 01:08:00 +00:00
Adam Nemet
2eb6f1f69f [opt-viewer] Add syntax highlighting
Uses pygments.

llvm-svn: 286532
2016-11-11 00:51:32 +00:00
Adam Nemet
217f9f4002 [opt-viewer] Avoid duplicated remarks
This can happen if a pass is run multiple times or if the code is in a
header file which is included multiple times.

llvm-svn: 286489
2016-11-10 18:42:56 +00:00
Peter Collingbourne
53c709eaaf Re-apply r286384, "X86: Introduce the "relocImm" ComplexPattern, which represents a relocatable immediate.", with a fix for 32-bit x86.
Teach X86InstrInfo::analyzeCompare() not to crash on CMP and SUB instructions
that take a global address operand.

llvm-svn: 286420
2016-11-09 23:53:43 +00:00
Peter Collingbourne
5b818e4321 Revert r286384, "X86: Introduce the "relocImm" ComplexPattern, which represents a relocatable immediate."
Suspected to be the cause of a sanitizer-windows bot failure:
Assertion failed: isImm() && "Wrong MachineOperand accessor", file C:\b\slave\sanitizer-windows\llvm\include\llvm/CodeGen/MachineOperand.h, line 420

llvm-svn: 286385
2016-11-09 18:17:50 +00:00
Peter Collingbourne
b305b8de78 X86: Introduce the "relocImm" ComplexPattern, which represents a relocatable immediate.
A relocatable immediate is either an immediate operand or an operand that
can be relocated by the linker to an immediate, such as a regular symbol
in non-PIC code.

Start using relocImm for 32-bit and 64-bit MOV instructions, and for operands
of type "imm32_su". Remove a number of now-redundant patterns.

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

llvm-svn: 286384
2016-11-09 17:51:58 +00:00
Adam Nemet
d19e635a8e [opt-viewer] Avoid division by zero
llvm-svn: 286172
2016-11-07 23:12:13 +00:00
Adam Nemet
afb5f69d51 [OptDiag, opt-viewer] Save callee's location and display as link
With this we get a new field in the YAML record if the value being
streamed out has a debug location.  For examples, please see the changes
to the tests.

This is then used in opt-viewer to display a link for the callee
function in the inlining remarks.

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

llvm-svn: 286169
2016-11-07 22:41:13 +00:00
Reid Kleckner
24254f0cd7 [lit] Print negative exit codes on Windows in hex
Negative exit codes are usually exceptions. They're easier to recognize
in hex. Compare -1073741502 to 0xc0000142.

llvm-svn: 286150
2016-11-07 21:06:20 +00:00
Mehdi Amini
96bf571dea Fix git-llvm script to handle git worktree setups correctly
llvm-svn: 286140
2016-11-07 20:35:02 +00:00
Mehdi Amini
d3832fef63 Add some facilities to work with a git monorepo (experimental setup)
Add a new script in llvm/utils/git-svn/. When present in the $PATH,
it enables a `git llvm` command. It is providing at this
point only the ability to push from the git monorepo: `git llvm push`.
It is intended to evolves with more features, for instance I plan on
features like `git llvm show r284955` to help working with sequential
revision numbers.
The push feature is taken from Justin Lebar's script available here:
https://github.com/jlebar/llvm-repo-tools/

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

llvm-svn: 286138
2016-11-07 20:00:47 +00:00
Zvi Rackover
0aeddbcd3d [X86] Fix test checks script to satisfy pyflakes
- Remove unused imports.
- Initialize the variable 'name' before its (static) uses, and rename it to a
  more descriptive name.

llvm-svn: 286128
2016-11-07 18:08:19 +00:00
Zvi Rackover
5bd65d0e91 [X86] Fix test checks script to handle run lines with no pipe checks
Fixes crashes in tests such as test/CodeGen/X86/masked_gather_scatter.ll which
contains a RUN: with no pipe chain.

llvm-svn: 286125
2016-11-07 17:47:21 +00:00
Mehdi Amini
296f7ccf4f Revert "Add some facilities to work with a git monorepo (experimental setup)"
This reverts commit r286123, accidentally commited while testing itself...

llvm-svn: 286124
2016-11-07 17:43:08 +00:00
Mehdi Amini
aab2cc8976 Add some facilities to work with a git monorepo (experimental setup)
Summary:
Some changes are made to cmake, especially the addition of a new
LLVM_ENABLE_PROJECTS option that makes the build system aware of
the monorepo directory structure.

Also a new script is added in llvm/utils/git-svn/. When present in
the $PATH, it enables a `git llvm` command. It is providing at this
point only the ability to push from the git monorepo: `git llvm push`.
It is intended to evolves with more features, for instance I plan on
features like `git llvm show r284955` to help working with sequential
revision numbers.
The push feature is taken from Justin Lebar's script available here:
https://github.com/jlebar/llvm-repo-tools/

Reviewers: jlebar

Subscribers: mgorny, modocache, llvm-commits

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

llvm-svn: 286123
2016-11-07 17:40:28 +00:00
Brian Gesiak
fd11f97abb [lit] Remove TODO
Summary:
Instead of keeping track of TODOs for lit in a file checked into source
control, use LLVM's bug tracker. The TODOs have been migrated to the
following bugs:

* https://llvm.org/bugs/show_bug.cgi?id=30666
* https://llvm.org/bugs/show_bug.cgi?id=30667
* https://llvm.org/bugs/show_bug.cgi?id=30668
* https://llvm.org/bugs/show_bug.cgi?id=30669
* https://llvm.org/bugs/show_bug.cgi?id=30670
* https://llvm.org/bugs/show_bug.cgi?id=30671

Reviewers: ddunbar, beanz, echristo, delcypher

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 285973
2016-11-03 23:41:49 +00:00
Saleem Abdulrasool
df691a0c97 vim: special case the CHECK prefix
A large number of tests in the LLVM tree use the default (CHECK) prefix
to indicate checked expressions via FileCheck.  Highlight it as a
special comment.  Although this wont get all the instances of the
checked patters, it is strictly better than the current state.

llvm-svn: 285927
2016-11-03 15:56:06 +00:00
Elena Demikhovsky
b7390e8f47 Expandload and Compressstore intrinsics
2 new intrinsics covering AVX-512 compress/expand functionality.
This implementation includes syntax, DAG builder, operation lowering and tests.
Does not include: handling of illegal data types, codegen prepare pass and the cost model.

llvm-svn: 285876
2016-11-03 03:23:55 +00:00
Alex Bradbury
2fa138eff6 [TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h
As it stands, the OperandMatchResultTy is only included in the generated
header if there is custom operand parsing. However, almost all backends
make use of MatchOperand_Success and friends from OperandMatchResultTy for
e.g. parseRegister. This is a pain when starting an AsmParser for a new
backend that doesn't yet have custom operand parsing. Move the enum to
MCTargetAsmParser.h.

This patch is a prerequisite for D23563

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

llvm-svn: 285705
2016-11-01 16:32:05 +00:00
Ulrich Weigand
294499cc04 Fix per-processor model scheduler definition completeness check
The CodeGenSchedModels::checkCompleteness routine in TableGen/
CodeGenSchedule.cpp is supposed to verify for each processor
model that is marked as "complete" that it actually defines a
scheduling class for each instruction.

However, this did not work correctly due to an incorrect
check whether a scheduling class has an itinerary.

Reviewer: atrick
Differential revision: https://reviews.llvm.org/D26156

llvm-svn: 285622
2016-10-31 18:59:52 +00:00
Vedant Kumar
b60ba08907 [utils] Add a '--unified-report' option to the code coverage prep script
In --unified-report mode, a single coverage report is prepared for all
specified binaries and written to *report_dir*. This mode is compatible
with all existing script options, including the --restrict mode which is
used to limit coverage reporting to certain files or directories.

This should not break any existing users of the script.

llvm-svn: 285249
2016-10-26 22:07:39 +00:00
Vedant Kumar
f146b009b8 [utils] Use print_function in the code coverage prep script, NFC.
llvm-svn: 285248
2016-10-26 22:07:37 +00:00
Vedant Kumar
0ef1917cef [utils] Add an '--only-merge' option to the code coverage prep script
In --only-merge mode, the script terminates after the profile merging
step.  This makes the script less stateful: it's more natural to split
the merge out into a separate step instead of relying on the first
invocation of the script to do it.

This should not break any existing users of the script.

llvm-svn: 285247
2016-10-26 22:07:35 +00:00
Reid Kleckner
7dfe7f827f [lit] Work around Windows MSys command line tokenization bug
Summary:
This will allow us to revert LLD r284768, which added spaces to get MSys
echo to print what we want.

Reviewers: ruiu, inglorion, rafael

Subscribers: modocache, llvm-commits

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

llvm-svn: 285237
2016-10-26 20:29:27 +00:00
Nico Weber
3aa7b1071c Revert 285087.
The sanitizer-windows bot turned red with:

FAILED: utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/IntrinsicEmitter.cpp.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe ... -c
    C:\...\llvm\utils\TableGen\IntrinsicEmitter.cpp
c:\...\llvm\utils\tablegen\intrinsicemitter.cpp(254) :
  fatal error C1001: An internal error has occurred in the compiler.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/114/steps/build%20clang%20lld/logs/stdio

llvm-svn: 285089
2016-10-25 17:46:29 +00:00
Nico Weber
5c84f61813 Try removing an MSVC2010 workaround.
Things seem to build fine locally without this, so let's
see what the bots think.

llvm-svn: 285087
2016-10-25 17:35:00 +00:00
Brian Gesiak
e8d7fa30fe [lit] Add more testing instructions to README
Summary:
r283710 introduced two regressions, one to llvm-lit, and the other to
lit executables that were installed via setuptools. Add instructions on
how to test for these regressions in the future.

Reviewers: ddunbar, delcypher, beanz, chapuni, cmatthews, echristo

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 284919
2016-10-22 17:27:31 +00:00
Justin Lebar
f5bab4e23c Switch SmallSetVector to use DenseSet when it overflows its inline space.
Summary:
SetVector already used DenseSet, but SmallSetVector used std::set.  This
leads to surprising performance differences.  Moreover, it means that
the set of key types accepted by SetVector and SmallSetVector are
quite different!

In order to make this change, we had to convert some callsites that used
SmallSetVector<std::string, N> to use SmallSetVector<CachedHashString, N>
instead.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284887
2016-10-21 21:45:01 +00:00
Andrew Trick
ca38d0b9a2 Improve tablegen gen-subtarget diagnostics for missing machine models.
-debug-only=subtarget-emitter prints a lot of machine model diagnostics.
This prunes the output so that the "No machine model for XXX on processor YYY"
only appears when there is definitely no machine model for that opcode.
Previously it was printing that error even if the opcode was covered by
a more general scheduling class.

<rdar://problem/15919845> [TableGen][CodeGenSchedule] Debug output does not help spotting the missing scheduling classes

llvm-svn: 284452
2016-10-18 04:17:44 +00:00
Saleem Abdulrasool
6db78758e9 vim: add norecurse attribute
Add missing attribute to the keyword set.

llvm-svn: 284270
2016-10-14 19:48:34 +00:00
Saleem Abdulrasool
3fe8f442d0 vim: add comdat keyword
The attribute may be applied to a function.  Highlight it as a keyword.

llvm-svn: 284269
2016-10-14 19:48:31 +00:00
Michal Gorny
7a8aed281b [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

llvm-svn: 284057
2016-10-12 21:40:08 +00:00
Michal Gorny
6a0d340d17 [lit] Fix FormatError on individual test timeout
Differential Revision: https://reviews.llvm.org/D25195

llvm-svn: 284056
2016-10-12 21:40:04 +00:00
Brian Gesiak
eab338b7d5 [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

llvm-svn: 283968
2016-10-12 03:35:04 +00:00
Adam Nemet
1b02274c11 [opt-viewer] Remove unnecessary call to demangle
llvm-svn: 283898
2016-10-11 16:20:40 +00:00
Adam Nemet
ee4aced190 [opt-viewer] Print hotness as percentage of the maximum hotness
llvm-svn: 283897
2016-10-11 16:20:38 +00:00
Adam Nemet
27f691d520 [opt-viewer] Convert another HTML output to use a multiline string
llvm-svn: 283896
2016-10-11 16:19:06 +00:00
Chris Matthews
2fa8e84ed6 Fix issue which cases lit installed with setup.py to not resolve main
llvm-svn: 283818
2016-10-10 23:22:11 +00:00
NAKAMURA Takumi
f7d2c2c56c 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.

llvm-svn: 283816
2016-10-10 23:02:42 +00:00
Peter Collingbourne
861bb221e9 Revert r283690, "MC: Remove unused entities."
llvm-svn: 283814
2016-10-10 22:49:37 +00:00
Mehdi Amini
3003721ba0 Use StringRef in TableGen generated Intrinsics.gen file (NFC)
llvm-svn: 283792
2016-10-10 19:31:09 +00:00
Brian Gesiak
c06864a754 [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

llvm-svn: 283710
2016-10-10 01:22:06 +00:00
Brian Gesiak
beb38d584e [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

llvm-svn: 283709
2016-10-10 01:20:43 +00:00
Brian Gesiak
8421c838ab [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

llvm-svn: 283708
2016-10-10 01:19:27 +00:00
Brian Gesiak
eb592dbc2b [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

llvm-svn: 283707
2016-10-10 01:18:14 +00:00
Brian Gesiak
d7ea6205eb [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

llvm-svn: 283706
2016-10-10 01:15:33 +00:00
Brian Gesiak
8f43f1be6f [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

llvm-svn: 283705
2016-10-10 01:11:52 +00:00
Peter Collingbourne
99affdec93 MC: Remove unused entities.
llvm-svn: 283691
2016-10-09 04:39:13 +00:00
Mehdi Amini
a6cfd067ac 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

llvm-svn: 283671
2016-10-08 19:41:06 +00:00
Adam Nemet
1496f9df72 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

llvm-svn: 283571
2016-10-07 17:06:34 +00:00
Peter Collingbourne
62f8bfacb0 FastISel: Remove unused/un-overridden entry points. NFCI.
llvm-svn: 283366
2016-10-05 19:25:20 +00:00
Mehdi Amini
fb6150f41d Use StringRef in TableGen (NFC)
llvm-svn: 283273
2016-10-04 23:47:33 +00:00
Mehdi Amini
fd0cf3c2dc Use StringRef in TableGen emitted API for attribute (NFC)
llvm-svn: 283268
2016-10-04 23:31:39 +00:00
Brian Gesiak
7b8f593578 [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

llvm-svn: 283169
2016-10-04 00:15:37 +00:00
Chris Bieneman
b448adb807 [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

llvm-svn: 283152
2016-10-03 22:12:42 +00:00
Chris Bieneman
54624e7eed [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

llvm-svn: 283090
2016-10-03 04:48:22 +00:00
Chris Bieneman
eccb1ef284 [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

llvm-svn: 283089
2016-10-03 04:48:18 +00:00
Chris Bieneman
e4053503bf [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

llvm-svn: 283088
2016-10-03 04:48:13 +00:00
Mehdi Amini
fb4ac0f217 Use StringRef for MemoryBuffer identifier API (NFC)
llvm-svn: 283043
2016-10-01 16:38:28 +00:00
Joerg Sonnenberger
70d55cf1cb Remove LLVM_CONFIGTIME, left-overs from when reproducable builds where
not the default.

llvm-svn: 282765
2016-09-29 21:00:53 +00:00
Daniel Dunbar
314bc61cf5 [lit] Add instructions to run lit's test suite
- Patch by Brian Gesiak.
 
 - https://reviews.llvm.org/D24968

llvm-svn: 282525
2016-09-27 18:58:50 +00:00
Daniel Dunbar
d445a1ca19 [lit] Fix refacto introduced by rL282479.
llvm-svn: 282501
2016-09-27 16:17:42 +00:00
Dimitar Vlahovski
98a4670ca6 Trying to fix lldb build breakage probably caused by rL282452
llvm-svn: 282479
2016-09-27 10:34:43 +00:00
Daniel Dunbar
52f97afa1b [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.

llvm-svn: 282452
2016-09-26 23:38:23 +00:00
Vedant Kumar
ad52945c14 [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.

llvm-svn: 282204
2016-09-22 21:49:49 +00:00
Justin Bogner
a393b70886 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.

llvm-svn: 282040
2016-09-21 00:25:45 +00:00
Vedant Kumar
36110a2aff [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).

llvm-svn: 281871
2016-09-19 00:38:11 +00:00
Hans Wennborg
714f9a7d08 build_llvm_package.bat: Update to VS2015 and include LLDB
llvm-svn: 281676
2016-09-15 23:01:03 +00:00
Sjoerd Meijer
54f48e4444 This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.

llvm-svn: 281447
2016-09-14 08:20:03 +00:00
Sjoerd Meijer
5ee27a5b66 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.

llvm-svn: 281306
2016-09-13 08:51:59 +00:00
Sjoerd Meijer
095b2fb29c 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

llvm-svn: 281304
2016-09-13 08:08:06 +00:00
Michael Gottesman
9087caae4d [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.

llvm-svn: 281085
2016-09-09 19:45:34 +00:00
Sam Kolton
6ad991b7fc [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

llvm-svn: 280952
2016-09-08 15:50:52 +00:00
Ahmed Bougacha
839e711a0e [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.

llvm-svn: 280674
2016-09-05 20:53:14 +00:00
NAKAMURA Takumi
4061732e88 lit/util.py: Another fix for py3.
'str' object has no attribute 'decode'.

llvm-svn: 280641
2016-09-05 00:00:40 +00:00
NAKAMURA Takumi
268d2fea8e Make lit/util.py py3-compatible.
llvm-svn: 280579
2016-09-03 04:06:37 +00:00
Ivan Krasin
4b81ffc655 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

llvm-svn: 280550
2016-09-02 22:31:24 +00:00
Reid Kleckner
5b4ee7e91b Quick fix to make LIT_PRESERVES_TMP work again
llvm-svn: 280502
2016-09-02 16:33:15 +00:00
Reid Kleckner
57587191e1 [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

llvm-svn: 280501
2016-09-02 16:29:24 +00:00
Greg Parker
21ef229d64 [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.

llvm-svn: 280455
2016-09-02 02:44:07 +00:00
Reid Kleckner
6c388e7dba [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 )

llvm-svn: 280382
2016-09-01 17:19:44 +00:00
Justin Bogner
927551b112 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.

llvm-svn: 279875
2016-08-26 22:29:36 +00:00
Saleem Abdulrasool
2c5173b70a 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!

llvm-svn: 279832
2016-08-26 16:18:40 +00:00
Craig Topper
21e185006b [X86] Create a new instruction format to handle 4VOp3 encoding. This saves one bit in TSFlags and simplifies MRMSrcMem/MRMSrcReg format handling.
llvm-svn: 279424
2016-08-22 07:38:50 +00:00
Craig Topper
5943c6520e [X86] Create a new instruction format to handle MemOp4 encoding. This saves one bit in TSFlags and simplifies MRMSrcMem/MRMSrcReg format handling.
llvm-svn: 279423
2016-08-22 07:38:45 +00:00
Craig Topper
a84ffb2a7b [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.

llvm-svn: 279422
2016-08-22 07:38:41 +00:00
Craig Topper
dd6e3c3fd7 [X86] Merge small helper function into the switch that calls it since they both operate on the same variable. NFC
llvm-svn: 279421
2016-08-22 07:38:36 +00:00
Craig Topper
6cae7b1fcb [X86] Explicitly list all X86 instruction forms in switch statement so its easier to detect when one is missing. NFC
llvm-svn: 279420
2016-08-22 07:38:30 +00:00
Justin Bogner
507d362929 Replace a few more "fall through" comments with LLVM_FALLTHROUGH
Follow up to r278902. I had missed "fall through", with a space.

llvm-svn: 278970
2016-08-17 20:30:52 +00:00
David Majnemer
9880e078f0 Use the range variant of remove_if instead of unpacking begin/end
No functionality change is intended.

llvm-svn: 278475
2016-08-12 04:32:37 +00:00
David Majnemer
319d420e44 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.

llvm-svn: 278469
2016-08-12 03:55:06 +00:00
David Majnemer
ae16160dfe Use the range variant of find_if instead of unpacking begin/end
No functionality change is intended.

llvm-svn: 278443
2016-08-12 00:18:03 +00:00
David Majnemer
85242fb9f9 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.

llvm-svn: 278433
2016-08-11 22:21:41 +00:00
David Majnemer
5423e4bff5 Use range algorithms instead of unpacking begin/end
No functionality change is intended.

llvm-svn: 278417
2016-08-11 21:15:00 +00:00
David Majnemer
61a7d953e4 [vim] Add more attributes to llvm.vim
llvm-svn: 278415
2016-08-11 21:14:05 +00:00
David Majnemer
1075cbd4a4 [vim] Update the llvm.vim syntax file
We never updated this file to contain the WinEH instructions.
Also, add the dereferenceable attribute.

llvm-svn: 278146
2016-08-09 18:34:19 +00:00
Hans Wennborg
de7c3dc7d6 test-release.sh: Drop autoconf support
The autoconf build was deleted some time ago.

llvm-svn: 278133
2016-08-09 16:46:02 +00:00
Igor Kudrin
cb0d62f90e Fix gdb pretty printers to work with Python 3.
Differential Revision: https://reviews.llvm.org/D23202

llvm-svn: 277833
2016-08-05 16:48:31 +00:00
Hans Wennborg
dabd6a89e3 build_llvm_package.bat: try tests three times
Sometimes they're flaky on Windows, and starting the whole thing
over is painful.

llvm-svn: 276913
2016-07-27 20:38:01 +00:00
Daniel Sanders
1eaf2533cd [mips][ias] Check '$rs = $rd' constraints when both registers are in AsmText.
Summary:
This is one possible solution to the problem of ignoring constraints that Simon
raised in D21473 but it's a bit of a hack.

The integrated assembler currently ignores violations of the tied register
constraints when the operands involved in a tie are both present in the AsmText.
For example, 'dati $rs, $rt, $imm' with the '$rs = $rt' will silently replace
$rt with $rs. So 'dati $2, $3, 1' is processed as if the user provided
'dati $2, $2, 1' without any diagnostic being emitted.

This is difficult to solve properly because there are multiple parts of the
matcher that are silently forcing these constraints to be met. Tied operands are
rendered to instructions by cloning previously rendered operands but this is
unnecessary because the matcher was already instructed to render the operand it
would have cloned. This is also unnecessary because earlier code has already
replaced the MCParsedOperand with the one it was tied to (so the parsed input
is matched as if it were 'dati <RegIdx 2>, <RegIdx 2>, <Imm 1>'). As a result,
it looks like fixing this properly amounts to a rewrite of the tied operand
handling which affects all targets.

This patch however, merely inserts a checking hook just before the
substitution of MCParsedOperands and the Mips target overrides it. It's not
possible to accurately check the registers are the same this early (because
numeric registers haven't been bound to a register class yet) so it cheats a
bit and checks that the tokens that produced the operand are lexically
identical. This works because tied registers need to have the same register
class but it does have a flaw. It will reject 'dati $4, $a0, 1' for violating
the constraint even though $a0 ends up as the same register as $4.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

llvm-svn: 276867
2016-07-27 13:49:44 +00:00
Benjamin Kramer
f94b1c2c1a [tblgen] Compare const char * with strcmp instead of creating StringRef.
Avoids a call to strlen on both strings which always reads the entire
string. strcmp can use early exit.

llvm-svn: 276737
2016-07-26 09:27:51 +00:00
Vedant Kumar
5af4b0792f [utils] Update coverage regression checking script
r276409 changed the coverage summary format. Update the script so that
it can parse the new output, and incorporate the new information into
its warnings.

llvm-svn: 276446
2016-07-22 17:38:03 +00:00
Daniel Dunbar
7617e34f33 [lit] Use full config path in diagnostics.
- This allows tools like emacs to automatically find the config file path when
   you step through errors.

 - Patch by Dave Abrahams.

llvm-svn: 276357
2016-07-21 23:20:41 +00:00
Daniel Dunbar
9df5b532ab [lit] Bump version number.
llvm-svn: 276353
2016-07-21 23:17:44 +00:00
Tim Northover
e0ea323e71 GlobalISel: Remove explicit enumerator values from .def file.
They were all auto-incremented from 0 anyway, and I'm getting really annoying
conflicts and runtime failures when different people add more for GlobalISel
(and even when I'm refactoring my own patches).

NFC.

llvm-svn: 276204
2016-07-20 22:58:01 +00:00
Vedant Kumar
5b19d0d059 [utils] Add script to check for code coverage regressions
Differential Revision: https://reviews.llvm.org/D22544

llvm-svn: 276199
2016-07-20 22:44:16 +00:00
Matt Arsenault
c431d0b6a1 TableGen: Allow custom register operand decoder method
This is for a situation where the encoding for a register may be
different depending on the specific operand. For some instructions,
we want to apply additional restrictions beyond the encoding's
constraints.

In AMDGPU some operands are VSrc_32, using the VS_32 pseudo register
class which accept VGPRs, SGPRs, or immediates in the encoding.
Some specific instructions with the same encoding operand do not want
to allow immediates or SGPRs, but the encoding format is different
in this case than a regular VGPR_32 operand.

This allows specifying the encoding should be treated the same
without introducing yet another dummy register class.

llvm-svn: 275929
2016-07-18 23:20:46 +00:00
Vedant Kumar
271dba4dc2 [utils] Generate html reports with the code coverage utility script
Instead of extracting raw coverage mappings into an artifact directory,
actually generate useful html reports for a given list of binaries with
symbol demangling turned on.

No tests, but this is actively being used to drive the (still nascent)
coverage bot.

llvm-svn: 275927
2016-07-18 22:50:10 +00:00
Hans Wennborg
1cc961d882 build_llvm_package.bat: update version to 4.0.0
llvm-svn: 275903
2016-07-18 20:26:46 +00:00
Hans Wennborg
d1d3ea8114 Revert r273099 "If the revision number starts with r, drop it. It will get added back"
This doesn't seem to work with Bash:

$ /work/llvm/utils/release/merge.sh --proj llvm --rev r275870
/work/llvm/utils/release/merge.sh: line 34: ${$1#r}: bad substitution

I get the same error with and without a leading 'r'.

llvm-svn: 275898
2016-07-18 20:06:27 +00:00
Justin Bogner
5a8c8a3672 IR: Sort generic intrinsics before target specific ones
This splits out the intrinsic table such that generic intrinsics come
first and target specific intrinsics are grouped by target. From here
we can find out which target an intrinsic is for or differentiate
between generic and target intrinsics.

The motivation here is to make it easier to move target specific
intrinsic handling out of generic code.

llvm-svn: 275575
2016-07-15 16:31:37 +00:00
Justin Bogner
45e70b6850 TableGen: Fix a confusing use of both i and I as variables. NFC
llvm-svn: 275450
2016-07-14 18:08:33 +00:00
Dean Michael Berris
b3cb9bd89d XRay: Add entry and exit sleds
Summary:
In this patch we implement the following parts of XRay:

- Supporting a function attribute named 'function-instrument' which currently only supports 'xray-always'. We should be able to use this attribute for other instrumentation approaches.
- Supporting a function attribute named 'xray-instruction-threshold' used to determine whether a function is instrumented with a minimum number of instructions (IR instruction counts).
- X86-specific nop sleds as described in the white paper.
- A machine function pass that adds the different instrumentation marker instructions at a very late stage.
- A way of identifying which return opcode is considered "normal" for each architecture.

There are some caveats here:

1) We don't handle PATCHABLE_RET in platforms other than x86_64 yet -- this means if IR used PATCHABLE_RET directly instead of a normal ret, instruction lowering for that platform might do the wrong thing. We think this should be handled at instruction selection time to by default be unpacked for platforms where XRay is not availble yet.

2) The generated section for X86 is different from what is described from the white paper for the sole reason that LLVM allows us to do this neatly. We're taking the opportunity to deviate from the white paper from this perspective to allow us to get richer information from the runtime library.

Reviewers: sanjoy, eugenis, kcc, pcc, echristo, rnk

Subscribers: niravd, majnemer, atrick, rnk, emaste, bmakam, mcrosier, mehdi_amini, llvm-commits

Differential Revision: http://reviews.llvm.org/D19904

llvm-svn: 275367
2016-07-14 04:06:33 +00:00
Saleem Abdulrasool
a7b7b3ed35 vim: separate the keywords into one per line
This achieves the same result as previously by using line wrapping.  This allows
us to have one keyword per line which makes adding a new keyword significantly
easier, especially if they are inserted in a lexicographical sort order as you
no longer need to reflow the content around it.

This only does the keywords as that is the group which changes more often.

llvm-svn: 275248
2016-07-13 03:47:58 +00:00
Saleem Abdulrasool
ea53e31958 vim: add local_unnamed_addr keyword
The `local_unnamed_addr` was introduced in SVN r272709.  Update the syntax
highlighting rules.

llvm-svn: 275245
2016-07-13 03:36:05 +00:00
Hal Finkel
ad4e59155b Add a 'Returned' intrinsic property corresponding to the 'returned' argument attribute
This will be used by the upcoming llvm.noalias intrinsic.

Differential Revision: http://reviews.llvm.org/D22201

llvm-svn: 275034
2016-07-11 01:28:42 +00:00
Justin Bogner
daec247313 TableGen: Update style in CodeGenIntrinsics. NFC
Ran clang-format to remove the namespace indentation, and stopped
repeating names in doc comments since I was updating every line
anyway.

llvm-svn: 274919
2016-07-08 20:14:27 +00:00
Tim Northover
16a302fa3c TableGen: avoid string copy.
llvm-svn: 274584
2016-07-05 22:51:30 +00:00