1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

6020 Commits

Author SHA1 Message Date
Craig Topper
29537fe87e [TableGen] Remove some copies around PatternToMatch.
Summary:
This patch does a few things that should remove some copies around PatternsToMatch. These were noticed while reviewing code for D34341.

Change constructor to take Dstregs by value and move it into the class. Change one of the callers to add std::move to the argument so that it gets moved.

Make AddPatternToMatch take PatternToMatch by rvalue reference so we can move it into the PatternsToMatch vector. I believe we should have a implicit default move constructor available on PatternToMatch. I chose rvalue reference because both callers call it with temporaries already.

Reviewers: RKSimon, aymanmus, spatel

Reviewed By: aymanmus

Subscribers: llvm-commits

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

llvm-svn: 306251
2017-06-25 17:33:49 +00:00
Brian Gesiak
b0b7e2b937 [opt-viewer] Remove positional arg checks (NFC)
Summary:
opt-stats.py and opt-viewer.py's argument parsers both take a positional
argument 'yaml_files'. Positional arguments in Python's argparse module are
required by default, so the subsequent checks for `len(args.yaml_files) == 0`
are unnecessary -- if the length was zero, then the call to
`parser.parse_args()` would have thrown an error already.

Because there is no way for `len(args.yaml_files)` to be zero at these
points, removing the code is NFC.

Reviewers: anemet, davidxl

Reviewed By: anemet

Subscribers: llvm-commits, fhahn

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

llvm-svn: 306147
2017-06-23 20:06:34 +00:00
Craig Topper
fac5b9df49 [TableGen] Take a parameter by reference instead of pointer so we don't have to add & on both callers. NFC
llvm-svn: 305807
2017-06-20 16:34:37 +00:00
Craig Topper
0391f937fe [TableGen] Use range based for loop. NFC
llvm-svn: 305806
2017-06-20 16:34:35 +00:00
Yuka Takahashi
3b19a660ec [GSoC] Flag value completion for clang
This is patch for GSoC project, bash-completion for clang.

To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.

In this patch, Options.td was mainly changed in order to add value class
in Options.inc.

llvm-svn: 305805
2017-06-20 16:31:31 +00:00
Daniel Sanders
0c5795464b [globalisel][tablegen] Add support for COPY_TO_REGCLASS.
Summary:
As part of this
* Emitted instructions now have named MachineInstr variables associated
  with them. This isn't particularly important yet but it's a small step
  towards multiple-insn emission.
* constrainSelectedInstRegOperands() is no longer hardcoded. It's now added
  as the ConstrainOperandsToDefinitionAction() action. COPY_TO_REGCLASS uses
  an alternate constraint mechanism ConstrainOperandToRegClassAction() which
  supports arbitrary constraints such as that defined by COPY_TO_REGCLASS.

Reviewers: ab, qcolombet, t.p.northover, rovka, kristof.beyls, aditya_nandakumar

Reviewed By: ab

Subscribers: javed.absar, igorb, llvm-commits

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

llvm-svn: 305791
2017-06-20 12:36:34 +00:00
Pengxuan Zheng
4bf7cb91e6 [test-release.sh] Enable Polly by default
Reviewers: grosser, hans, zinob, bollu

Reviewed By: grosser, hans

Subscribers: tstellar, llvm-commits

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

llvm-svn: 305763
2017-06-20 01:04:25 +00:00
Peter Collingbourne
3b89f3ca38 Revert r305598, "utils: Add a git-r utility for mapping svn revisions to git revisions in the monorepo."
$ git revert `git r 305598`

We need to decide whether we want development tools to be written in
Go first.

llvm-svn: 305741
2017-06-19 20:43:09 +00:00
Simon Pilgrim
93c2f98ef7 Use range for loops. NFCI.
llvm-svn: 305693
2017-06-19 13:24:12 +00:00
Peter Collingbourne
ab0bdae718 utils: Add a git-r utility for mapping svn revisions to git revisions in the monorepo.
llvm-svn: 305598
2017-06-16 22:15:18 +00:00
Krzysztof Parzyszek
877f78ec39 [TableGen] Do not assume that the first variant is the original pattern
The variant generation for commutative/associative patterns would simply
delete the first output from the list assuming that it was identical to
the original pattern. This does not have to be the case, and a legitimate
variant could actually be removed that way. 

llvm-svn: 305556
2017-06-16 13:44:34 +00:00
Tom Stellard
57022a74dc test-release.sh: Run the test-suite using phase3 clang
Summary: We were using the system compiler to run the test suite.

Reviewers: hansw

Subscribers: llvm-commits

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

llvm-svn: 305525
2017-06-15 23:05:21 +00:00
Sanjay Patel
e611980be7 [utils] remove ability to generate llc check lines from update_test_checks.py
The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing just causes confusion. Now, this script will only work with 
opt to produce check lines for IR transforms.

llvm-svn: 305208
2017-06-12 17:44:30 +00:00
Brian Gesiak
17a2687c76 [opt-viewer] Include default values in help output
Summary:
Python's argparse module includes a `%(default)s` format specifier that
can be used to print the default value of an option in its help text.
Use this for opt-viewer utilities' `--jobs` arguments.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits, fhahn

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

llvm-svn: 305155
2017-06-10 21:33:27 +00:00
Tom Stellard
68fcdf646b test-release.sh: Remove workaround for test-suite build
Summary: We aren't actually building the test suite, so this isn't needed.

Reviewers: rengolin, hansw

Reviewed By: rengolin

Subscribers: rengolin, llvm-commits

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

llvm-svn: 305017
2017-06-08 21:31:59 +00:00
Filipe Cabecinhas
50c626039c PR33331 - opt-viewer.py produces broken output for directories with spaces
Fix: Properly quote href attributes.

Patch by Simon Whittaker!

llvm-svn: 304919
2017-06-07 14:57:20 +00:00
Benjamin Kramer
8fcc607c3a [FileCheck] Don't scan past the closing CHECK-DAG for CHECK-NOT inside CHECK-DAG
If there's enough data in fron of it the skipped region would just
become arbitrarily large, and we scan for the CHECK-NOT everywhere.

llvm-svn: 304900
2017-06-07 12:06:45 +00:00
Chandler Carruth
b47927165c [x86] Revert the X86FoldTablesEmitter due to more miscompiles.
In testing, we've found yet another miscompile caused by the new tables.
And this one is even less clear how to fix (we could teach it to fold
a 16-bit load instead of the 32-bit load it wants, or block folding
entirely).

Also, the approach to excluding instructions seems increasingly to not
scale well.

I have left a more detailed analysis on the review log for the original
patch (https://reviews.llvm.org/D32684) along with suggested path
forward. I will land an additional test case that I wrote which covers
the code that was miscompiling (folding into the output of `pextrw`) in
a subsequent commit to keep this a pure revert.

For each commit reverted here, I've restricted the revert to the
non-test code touching the x86 fold table emission until the last commit
where I did revert the test updates. This means the *new* test cases
added for `insertps` and `xchg` remain untouched (and continue to pass).

Reverted commits:
r304540: [X86] Don't fold into memory operands into insertps in the ...
r304347: [TableGen] Adapt more places to getValueAsString now ...
r304163: [X86] Don't fold away the memory operand of an xchg.
r304123: Don't capture a temporary std::string in a StringRef.
r304122: Resubmit "[X86] Adding new LLVM TableGen backend that ..."

Original commit was in r304088, and after a string of fixes was reverted
previously in r304121 to fix build bots, and then re-landed in r304122.

llvm-svn: 304762
2017-06-06 02:15:31 +00:00
Peter Collingbourne
c3802e1e28 git-llvm: Update the project list for the llvm-project-20170507 monorepo.
llvm-svn: 304691
2017-06-04 22:18:57 +00:00
David Blaikie
29b3c9797d Make the Twine pretty-printer work with GDB 7.11
Apparently ::NodeKind is sometimes part of the name in GDB.
Without this patch I get the following error message from GDB:
`Unhandled NodeKind llvm::Twine::NodeKind::EmptyKind`.

Patch by Alexander Richardson!

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

llvm-svn: 304675
2017-06-04 03:27:12 +00:00
Alex Lorenz
9f2c1b5601 [lit][macOS] Add a utility function to find the platform SDK version
on macOS

This function will be used to tie Clang's Integeration tests to a particular
SDK version. See https://reviews.llvm.org/D32178 for more context.

llvm-svn: 304541
2017-06-02 11:21:37 +00:00
Benjamin Kramer
14bb5040f2 [X86] Don't fold into memory operands into insertps in the generated folding tables.
insertps behaves differently, the register form selects from an input
register based on the immediate operand while the memory form just loads
the given address. We have custom code to change the immediate in cases
where that's legal, so completely remove insertps from the generated
tables.

llvm-svn: 304540
2017-06-02 10:50:22 +00:00
Craig Topper
a50fc1fdcf [TableGen] Remove code for renaming anonymous register classes as it can never execute.
It tried to detect 9 letters (the length of anonymous) followed by a period. But anonymous classes start with "anonymous_" rather than "anonymous." these days.

llvm-svn: 304387
2017-06-01 06:56:13 +00:00
Craig Topper
c1dcc79554 [TableGen] Use StringRef to capture getValueAsString in a couple more places. NFC
llvm-svn: 304386
2017-06-01 06:56:11 +00:00
Craig Topper
78cbee780b [TableGen] Adapt more places to getValueAsString now returning a StringRef instead of a std::string.
llvm-svn: 304347
2017-05-31 21:12:46 +00:00
Craig Topper
1622520c04 [TableGen] Make Record::getValueAsString and getValueAsListOfStrings return StringRefs instead of std::string
Internally both these methods just return the result of getValue on either a StringInit or a CodeInit object. In both cases this returns a StringRef pointing to a string allocated in the BumpPtrAllocator so its not going anywhere. So we can just pass that StringRef along.

This is a fairly naive patch that targets just the build failures caused by this change. There's additional work that can be done to avoid creating std::string at call sites that still think getValueAsString returns a std::string. I'll try to clean those up in future patches.

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

llvm-svn: 304325
2017-05-31 19:01:11 +00:00
Craig Topper
4e4cbf5b26 [TableGen] Introduce DagInit::getArgs that returns an ArrayRef. Use it to fix 80 column violations in arg_begin/arg_end. Remove DagInit::args and use getArgs instead. NFC
llvm-svn: 304177
2017-05-29 21:49:34 +00:00
Benjamin Kramer
762b23a6e9 [X86] Don't fold away the memory operand of an xchg.
xchg with a mem operand has different locking semantics. If we unfold it
into a xchg r,r we will loose the implicit lock. Likewise we never want
to fold a register xchg into a memory one as it would be a lot slower.

This triggers during LLVM selfhost.

llvm-svn: 304163
2017-05-29 16:25:20 +00:00
Zachary Turner
2dbeb58c9c Don't capture a temporary std::string in a StringRef.
This fixes the breakages in llvm-tblgen.

llvm-svn: 304123
2017-05-29 02:20:12 +00:00
Zachary Turner
2b08c71118 Resubmit "[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables."
This was reverted due to buildbot breakages and I was not familiar
with this code to investigate it.  But while trying to get a
useful backtrace for the author, it turns out the fix was very
obvious.  Resubmitting this patch as is, and will submit the
fix in a followup so that the fix is not hidden in the larger
CL.

llvm-svn: 304122
2017-05-29 02:19:37 +00:00
Zachary Turner
2b8f4fb1c1 Revert "[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables."
This reverts commit 28cb1003507f287726f43c771024a1dc102c45fe as well
as all subsequent followups.  llvm-tblgen currently segfaults with
this change, and it seems it has been broken on the bots all
day with no fixes in preparation.  See, for example:

http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/

llvm-svn: 304121
2017-05-29 01:48:53 +00:00
Craig Topper
ba7ab27974 [TableGen][X86] Fix formatting I accidentally messed up in r304099. NFC
llvm-svn: 304115
2017-05-28 23:47:17 +00:00
Craig Topper
5330f48935 [TableGen][X86] Use CHAR_BIT with sizeof instead of hardcoded 8. NFC
llvm-svn: 304100
2017-05-28 18:24:43 +00:00
Craig Topper
944f3546a3 [TableGen][X86] Mark a couple global tables as const. NFC
llvm-svn: 304099
2017-05-28 18:24:41 +00:00
Craig Topper
47644fbcc3 [TableGen][X86] Improve formatting of the fold table output by indenting the body of the table and adding blank lines between tables. NFC
llvm-svn: 304098
2017-05-28 18:24:39 +00:00
Craig Topper
aa5d72854c [TableGen][X86] Add an llvm_unreachable to a switch so we get an error if we need expansion in the future.
llvm-svn: 304097
2017-05-28 18:24:37 +00:00
Craig Topper
4a8a50dee7 [TableGen][X86] Remove unnecessary std::string creations. NFC
llvm-svn: 304096
2017-05-28 18:24:35 +00:00
Craig Topper
21fd411f97 [TableGen][X86] Replace a global std::vector with a regular array. llvm::find works on arrays, just need to use std::end to check the result.
llvm-svn: 304095
2017-05-28 18:24:32 +00:00
Craig Topper
113510488b [TableGen][X86] getValueAsString returns a std::string not a StringRef. Capture it that way to avoid a StringRef to a temporary.
llvm-svn: 304093
2017-05-28 17:48:41 +00:00
Ayman Musa
a0ce195843 [X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables.
X86 backend holds huge tables in order to map between the register and memory forms of each instruction.
This TableGen Backend automatically generated all these tables with the appropriate flags for each entry.

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

llvm-svn: 304088
2017-05-28 12:55:36 +00:00
Dimitry Andric
a48f1cdc08 Return a lit.Test.Result object from TestRunner's executeShTest()
Summary:
For various clang analyzer tests, which were unsupported, I got lit
exceptions, similar to the following:

    Exception during script execution:
    Traceback (most recent call last):
      File "utils/lit/lit/run.py", line 190, in execute_test
        result = test.config.test_format.execute(test, lit_config)
      File "tools/clang/test/Analysis/analyzer_test.py", line 11, in execute
        if result.code == lit.Test.FAIL:
    AttributeError: 'tuple' object has no attribute 'code'

This is because executeShTest() in utils/lit/lit/TestRunner.py is
supposed to return a lit.Test.Result object, but in case of unsupported
tests, it returns a plain tuple.

Fix this by returning a properly initialized lit.Test.Result object
instead.

Reviewers: rnk, rafael, modocache

Subscribers: llvm-commits

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

llvm-svn: 303943
2017-05-25 23:56:44 +00:00
Galina Kistanova
99635b8b60 Fixed nondeterminism in RuleMatcher::emit.
llvm-svn: 303829
2017-05-25 01:51:53 +00:00
Zachary Turner
b94565d13f git-llvm script should add .exe on Windows.
llvm-svn: 303708
2017-05-24 00:28:46 +00:00
Rui Ueyama
647132cc23 [git-llvm] Check if svn is installed.
The error message that git-llvm script prints out when svn is missing
is very cryptic. I spent a fair amount of time to find what was wrong
with my environment. It looks like many newcomers also exprienced a
hard time to submit their first patches due to this error.

This patch adds a more user-friendly error message.

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

llvm-svn: 303696
2017-05-23 21:50:40 +00:00
Francis Visoiu Mistrih
9515ddb7fd abtest: remove duplicate script
This is fixing a mistake from r303690.

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

llvm-svn: 303692
2017-05-23 21:28:41 +00:00
Francis Visoiu Mistrih
4aa7483a63 AsmPrinter: mark the beginning and the end of a function in verbose mode
llvm-svn: 303690
2017-05-23 21:22:16 +00:00
Tom Stellard
082356cda2 merge-request.sh: Use https url for bugzilla
With the http url, the script fails with:

Connection lost/failed: 411 Client Error: Length Required

llvm-svn: 303685
2017-05-23 20:35:38 +00:00
Daniel Sanders
00072f58f8 Fix unused variable warnings after r303678
This should fix lld-x86_64-darwin13

llvm-svn: 303683
2017-05-23 20:02:48 +00:00
Daniel Sanders
fa3e6b4d4e [globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.
Summary:
It's rare but a small number of patterns use IntInit's at the root of the match.
On X86, one such rule is enabled by the OptForSize predicate and causes the
compiler to use the smaller:
	%0 = MOV32r1
instead of the usual:
	%0 = MOV32ri 1

This patch adds support for matching IntInit's at the root and uses this as a
test case for the optsize attribute that was implemented in r301750

Reviewers: qcolombet, ab, t.p.northover, rovka, kristof.beyls, aditya_nandakumar

Reviewed By: qcolombet

Subscribers: igorb, llvm-commits

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

llvm-svn: 303678
2017-05-23 19:33:16 +00:00
Daniel Sanders
4ecbdc4da7 Revert r303259 - [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
It's causing some buildbots to timeout whenever tablegen needs re-compilation,
particularly those with -fsanitize=memory but not only them. A compile time
regression was expected since it triples the amount of SelectionDAG rules we
are able to import but it's currently too high.

llvm-svn: 303542
2017-05-22 10:14:33 +00:00