Commit Graph

5919 Commits

Author SHA1 Message Date
Weiming Zhao
943496ffc4 Summary: Currently there is no way to disable deprecated warning from asm like this
clang  -target arm deprecated-asm.s -c
  deprecated-asm.s:30:9: warning: use of SP or PC in the list is deprecated
       stmia   r4!, {r12-r14}

We have to have an option what can disable it.

Patched by Yin Ma!

Reviewers: joey, echristo, weimingz

Subscribers: llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:55:13 +00:00
Eric Fiselier
5b9f351e17 [lit] Support custom parsers in parseIntegratedTestScript
Summary:
Libc++ frequently has the need to parse more than just the builtin *test keywords* (`RUN`, `REQUIRES`, `XFAIL`, ect). For example libc++ currently needs a new keyword `MODULES-DEFINES: macro list...`. Instead of re-implementing the script parsing in libc++ this patch allows `parseIntegratedTestScript` to take custom parsers.

This patch introduces a new class `IntegratedTestKeywordParser` which implements the logic to parse/process a test keyword. Parsing of various keyword "kinds" are supported out of the box, including 'TAG', 'COMMAND', and 'LIST', which parse keywords such as `END.`, `RUN:` and `XFAIL:` respectively.

As an example after this change libc++ can implement the `MODULES-DEFINES` simply using: 
```
mparser = IntegratedTestKeywordParser('MODULES-DEFINES:', ParserKind.LIST)
parseIntegratedTestScript(test, additional_parsers=[mparser])
macro_list = mparser.getValue()
```


Reviewers: ddunbar, modocache, rnk, danalbert, jroelofs

Subscribers: mgrang, llvm-commits, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:21:21 +00:00
Matthias Braun
9478556f8f TableGen/AsmMatcherEmitter: Bring sorting check back under EXPENSIVE_CHECKS
Bring the sorting check back that I removed in r288655 but put it under
EXPENSIVE_CHECKS this time. Also document that this the check isn't
purely about having a sorted list but also about operator < having the
correct transitive behavior.

Apply the same to the other check in the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 19:44:31 +00:00
Matthias Braun
25801f0f22 TableGen/AsmMatcherEmitter: Trust that stable_sort works
A debug build of AsmMatcherEmitter would use a quadratic algorithm to
check whether std::stable_sort() actually sorted. Let's hope the authors
of our C++ standard library did that testing for us. Removing the check
gives a 3x speedup in the X86 case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 08:15:57 +00:00
Matthias Braun
ddbd6db517 TableGen: Use StringInit instead of std::string for DagInit arg names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:00:46 +00:00
Matthias Braun
205e9501a0 TableGen: Use StringInit instead of std::string for DagInit name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:00:41 +00:00
Matthias Braun
0c517c8dff 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-04 05:48:16 +00:00
Vedant Kumar
74ae925619 [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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 19:38:50 +00:00
Vedant Kumar
38026e26bd Remove unused header, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 19:38:48 +00:00
Kuba Mracek
0be1dd284d 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 '/'.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:45:22 +00:00
Mehdi Amini
19ef8ff90c [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 19:12:53 +00:00
Eugene Zelenko
c02caf5200 Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 17:48:10 +00:00
Benjamin Kramer
bf60ce0ebd Apply clang-tidy's 'performance-faster-string-find' check to LLVM.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 10:01:11 +00:00
Jacob Baungard Hansen
e6ee79fbc5 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 08:53:28 +00:00
Vedant Kumar
6e1a44693e 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 20:51:09 +00:00
Andrew Kaylor
a5156e5797 Add IntrInaccessibleMemOnly property for intrinsics
Differential Revision: https://reviews.llvm.org/D26485



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287680 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:16:04 +00:00
Craig Topper
619a7d461f [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 07:00:06 +00:00
Jacob Baungard Hansen
6ea9891f93 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 09:33:05 +00:00
Craig Topper
80f1fb4ea1 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 04:07:58 +00:00
Daniel Sanders
c170429d49 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 14:47:41 +00:00
Daniel Sanders
b313c742da 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 13:05:44 +00:00
Daniel Sanders
90085b5841 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 12:21:34 +00:00
Kuba Mracek
f3fc2834ab [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 23:25:57 +00:00
Matthias Braun
9262f00f1a 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:43:18 +00:00
Daniel Sanders
027cab5914 Fix -Wunused introduced in r286945 for release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 10:13:09 +00:00
Daniel Sanders
57a599ec1a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 09:51:02 +00:00
Adam Nemet
d921006280 [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/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 08:40:51 +00:00
Adam Nemet
f963245479 [opt-viewer] Don't fail with remarks without debug location
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 18:38:48 +00:00
Stephan Bergmann
0ff9becff3 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 17:07:09 +00:00
Mehdi Amini
8524467ebd Improve git llvm push to suggest git pull when applying patch fails
Differential Revision: https://reviews.llvm.org/D26565

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 01:17:59 +00:00
Richard Trieu
d085da51ef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 23:26:28 +00:00
Adam Nemet
29e1623323 [opt-viewer] Make it work in the absence of hotness information
In this case the index page is sorted by the source location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286572 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 06:11:56 +00:00
Mandeep Singh Grang
c75e3c2fd2 [opt-viewer] PEPify opt-viewer.py
Reviewers: anemet

Subscribers: fhahn

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286564 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:51:27 +00:00
Adam Nemet
58da39449b [opt-viewer] Add column number support
With this the yellow (bubble) part of the remark shows up under the
corresponding expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286545 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 01:51:34 +00:00
Adam Nemet
9295796ca7 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286537 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 01:25:04 +00:00
Adam Nemet
9781343884 [opt-viewer] Add option to set source directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286536 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 01:08:02 +00:00
Adam Nemet
2cb2d87568 [opt-viewer] Mention Pygments in the description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 01:08:00 +00:00
Adam Nemet
c2e5ee3641 [opt-viewer] Add syntax highlighting
Uses pygments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 00:51:32 +00:00
Adam Nemet
e13ecb7d13 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 18:42:56 +00:00
Peter Collingbourne
027f4d03c6 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 23:53:43 +00:00
Peter Collingbourne
7deb9eea89 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 18:17:50 +00:00
Peter Collingbourne
7e3e10aad3 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 17:51:58 +00:00
Adam Nemet
3fbb1a90c3 [opt-viewer] Avoid division by zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 23:12:13 +00:00
Adam Nemet
330e12bad4 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:41:13 +00:00
Reid Kleckner
14b08acb1e [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 21:06:20 +00:00
Mehdi Amini
59bbd3ca9e Fix git-llvm script to handle git worktree setups correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:35:02 +00:00
Mehdi Amini
7e34ddb6ca 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 20:00:47 +00:00
Zvi Rackover
58d02e0f92 [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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 18:08:19 +00:00
Zvi Rackover
b54369e188 [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 17:47:21 +00:00
Mehdi Amini
ad83acaba5 Revert "Add some facilities to work with a git monorepo (experimental setup)"
This reverts commit r286123, accidentally commited while testing itself...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 17:43:08 +00:00