1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

5708 Commits

Author SHA1 Message Date
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