Commit Graph

5435 Commits

Author SHA1 Message Date
Craig Topper
a1bedd75a0 [TableGen] Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238805 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 04:15:51 +00:00
Arnold Schwaighofer
5a0272c759 lit: Allow configurations to restrict the set of tests to run
By setting limit_to_features to a non empty list of features a configuration can
restrict the set of tests to run to only include tests that require a feature in
this list.

rdar://21082253

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238766 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 17:50:03 +00:00
Hans Wennborg
1758082f64 Drop remaining Dragonegg support in release scripts
r236077 and r236081 dropped Dragonegg support from the release scripts
but left some pieces. The most notable change is that Dragonegg won't
be tagged any more.

Patch by David Wiberg <dwiberg@gmail.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 15:37:58 +00:00
Benjamin Kramer
9589ff8949 Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.


Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 19:43:39 +00:00
Ahmed Bougacha
d4b59dcdba [TableGen][AsmMatcherEmitter] Only parse isolated tokens as registers.
Fixes PR23455, where, when TableGen generates the matcher from the
AsmString, it splits "cmp${cc}ss" into tokens, and the "ss" suffix
is recognized as the SS register.

I can't think of a situation where that's a feature, not a bug, hence:
when a token is "isolated", i.e., it is followed and preceded by
separators, it shouldn't be parsed as a register.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238536 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 01:03:37 +00:00
Ahmed Bougacha
85f66de8cc [TableGen][AsmMatcherEmitter] Factor out AsmOperand creation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238534 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 00:55:55 +00:00
Owen Anderson
2f6ca834ff Add support for the convergent flag at the MC and MachineInstr levels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:33:39 +00:00
Owen Anderson
ca67e337bf Expand the Flags field of MCInstrDesc to 64 bits, while simultaneously
shrinking the Size and NumDefs fields to offset the size growth, and
reordering the fields to preserve a good packing.

This is necessary in the short term for adding a convergent flag, and
simultaneously future-proofs us against more flags being added in the
future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:03:07 +00:00
Owen Anderson
13146c7e3b Add initial support for the convergent attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:48:40 +00:00
Tom Stellard
75775939fa AsmMatcherEmitter: Add an option to override custom converters for InstAlias
If there is an InstAlias defined for an instruction that had a custom
converter (AsmMatchConverter), then when the alias is matched,
the custom converter will be used rather than the converter generated
by the InstAlias.

This patch adds the UseInstAsmMatchConverter field to the InstAlias
class, which allows you to override this behavior and force the
converter generated by the InstAlias to be used.

This is required for some future improvemnts to the R600 assembler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 15:55:50 +00:00
Michael Kuperstein
d714fcf5c8 Use std::bitset for SubtargetFeatures.
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first several times this was committed (e.g. r229831, r233055), it caused several buildbot failures.
Apparently the reason for most failures was both clang and gcc's inability to deal with large numbers (> 10K) of bitset constructor calls in tablegen-generated initializers of instruction info tables. 
This should now be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 10:47:10 +00:00
Kit Barton
948ecae20e This patch adds support for the vector quadword add/sub instructions introduced
in POWER8:

vadduqm
vaddeuqm
vaddcuq
vaddecuq
vsubuqm
vsubeuqm
vsubcuq
vsubecuq
In addition to adding the instructions themselves, it also adds support for the
v1i128 type for intrinsics (Intrinsics.td, Function.cpp, and
IntrinsicEmitter.cpp).

http://reviews.llvm.org/D9081


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238144 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 15:49:26 +00:00
Renato Golin
39dd163cdb Improve check on git-svnrevert, better error message
When the commit is not in the tree at all, find-rev returns 0
and prints an empty string. We need to catch that problem too,
when trying to revert.

Adding a list of possible problems, so that you can easily and
quickly correct without having to edit the script again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237516 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-16 10:23:48 +00:00
Craig Topper
1fbf73bae3 [TableGen] Remove ListInit::size() in favor of getSize() which does the same thing and is already used in most places. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-14 05:53:56 +00:00
Craig Topper
bbf57b36bb [TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() if it was just comparing to 0. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-14 05:53:53 +00:00
Alex Lorenz
b96942f6ec YAML: Implement block scalar parsing.
This commit implements the parsing of YAML block scalars.
Some code existed for it before, but it couldn't parse block
scalars.

This commit adds a new yaml node type to represent the block
scalar values. 

This commit also deletes the 'spec-09-27' and 'spec-09-28' tests
as they are identical to the test file 'spec-09-26'.

This commit introduces 3 new utility functions to the YAML scanner
class: `skip_s_space`, `advanceWhile` and `consumeLineBreakIfPresent`.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237314 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13 23:10:51 +00:00
Jim Grosbach
db703aaedd MC: Modernize MCOperand API naming. NFC.
MCOperand::Create*() methods renamed to MCOperand::create*().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13 18:37:00 +00:00
Michael Kuperstein
66112dd7f8 Reverting r237234, "Use std::bitset for SubtargetFeatures"
The buildbots are still not satisfied.
MIPS and ARM are failing (even though at least MIPS was expected to pass).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13 10:28:46 +00:00
Michael Kuperstein
1336daad86 Use std::bitset for SubtargetFeatures
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first two times this was committed (r229831, r233055), it caused several buildbot failures. 
At least some of the ARM and MIPS ones were due to gcc/binutils issues, and should now be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13 08:27:08 +00:00
James Y Knight
aeda490976 Fix tablegen's PrintFatalError function to run registered file
cleanups.

Also, change code in tablegen which printed a message and then called
"exit(1)" to use PrintFatalError, instead.

This fixes instances where an empty output file was left behind after
a failed tablegen invocation, which would confuse subsequent ninja
runs into not attempting to rebuild.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 22:17:13 +00:00
Tobias Grosser
fcae7eada1 Add polly support to sort_includes.py
Changes:
 -  Add "isl/" as a system library prefix. Even though isl is regularly
    imported into polly, it is still used like an external library.
 -  Add "json/" as a system library prefix. Polly uses json-cpp as external
    library.
 -  Distinguish between llvm and subproject libraries. Always sort subprojects
    before LLVM. This was already the case with clang, as 'clang' comes before
    'llvm', but we also want 'polly' to be sorted before 'llvm'.

The sorting of headers that are not part of Polly or isl remains unchanged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-09 09:08:56 +00:00
Alex Lorenz
12fe27fe05 Fix r236754: Add the missing yaml-bench dir to the makefile for utils.
This commit adds the missing yaml-bench utility to the
makefile in utils. It was missing before and it caused
the regression tests to fail on some buildbots when llvm-lit 
couldn't find yaml-bench when llvm was built without 
cmake after I committed r236754.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 18:48:48 +00:00
Alex Lorenz
9e31c0cf91 YAML: Enable the YAMLParser tests.
This commit enables the tests located in test/YAMLParser directory.
Those tests were never actually enabled, as llvm-lit didn't pick up the
files with the 'data' extension. The commit renames those test files to files
with the 'test' extension so that llvm-lit would find them.

This commit also modifies yaml-bench so that it returns an error status
if an error occurred during parsing. It also adds the '-use-color'
command line option to yaml-bench (to make sure that file check matches
the error messages in the output stream).

This commit modifies some of the renamed tests so that they wouldn't
fail. It gets rid of XFAILs and uses the 'not' command instead for
some of the tests that have to fail during parsing. This commit
also adds some 'FIXME' comments to a couple of tests that are
supposed to fail but currently pass because of various bugs
in the implementation of the yaml parser.

Reviewers: Justin Bogner

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 18:08:46 +00:00
Matthias Braun
79597d7489 Vim: Fix some bugs in llvm indent plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236464 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-04 21:41:25 +00:00
Matthias Braun
1ac87035b9 Vim: Set filetype=python for lit configuration files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-04 21:41:23 +00:00
Matthias Braun
cccd128a8a Lit: Allow overriding llvm tool paths+arguments, make -D an alias for --param
These changes allow usages where you want to pass an additional
commandline option to all invocations of a specific llvm tool. Example:

> llvm-lit -Dllc=llc -enable-misched -verify-machineinstrs

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236461 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-04 21:36:36 +00:00
Benjamin Kramer
fda9fd463d Remove std::move on return when it could prevent copy elision.
Found by -Wpessimizing-move, no functional change. The APFloat and
PassManager change doesn't affect codegen as returning a by-value
argument will always result in a move.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236316 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-01 15:16:11 +00:00
Chris Bieneman
65d5d2d117 [NFC] Updating FileCheck to reduce the std::vector interface used via cl::list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-29 21:45:24 +00:00
Hans Wennborg
af049033be Drop Dragonegg from the release export script
Follow-up to r236077.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-29 02:36:43 +00:00
Hans Wennborg
3d09e0e550 Drop Dragonegg support from the release script
It doesn't have a maintainer and none of the release testers test it,
so I don't think it should be part of the release.

http://reviews.llvm.org/D9331

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236077 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-29 02:14:26 +00:00
Hans Wennborg
bccc647eaa test-release.sh: Drop some unused command-line options.
These haven't done anything since before r142165.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236061 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-28 23:37:41 +00:00
Craig Topper
a9a01d9879 [TableGen] Don't leak Expanders and Operators in SetTheory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235697 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24 06:49:44 +00:00
Craig Topper
f8012eb826 [TableGen] Use 'isa' to identify UnsetInits rather than comparing with the singleton object created by UnsetInit::get(). Makes it more consistent with the other types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 02:09:45 +00:00
Elena Demikhovsky
bf704ed348 AVX-512: Added VPMOVx2M instructions for SKX,
fixed encoding of VPMOVM2x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 14:38:31 +00:00
Elena Demikhovsky
695922de3d AVX-512: Added VPTESTM and VPTESTNM instructions for SKX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 13:13:46 +00:00
Matthias Braun
b1675e5355 Enhanced vim support.
This brings the utils/vim folder into a more vim-like format by moving
the syntax hightlighting files into a syntax subdirectory. It adds
some minimal settings that everyone should agree on to ftdetect/ftplugin and
features a new indentation plugin for .ll files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-21 01:35:42 +00:00
Kit Barton
1e3da044d8 Add support for v1i128 type.
The v1i128 type is needed for the quadword add/substract instructions introduced
in POWER8. Futhermore, the PowerPC ABI specifies that parameters of type v1i128
are to be passed in a single vector register, while parameters of type i128 are
passed in pairs of GPRs. Thus, it is necessary to be able to differentiate
between v1i128 and i128 in LLVM.

http://reviews.llvm.org/D8564


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-17 16:11:05 +00:00
Richard Trieu
64b905a58d Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234963 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-15 01:21:15 +00:00
Daniel Berlin
9074dc73cf Add ladder graph utility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234917 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14 18:14:38 +00:00
Alexander Kornienko
c16fc54851 Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' \
    -j=32 -fix -format

http://reviews.llvm.org/D8925



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11 02:11:45 +00:00
Benjamin Kramer
0973b7ddb8 Reduce dyn_cast<> to isa<> or cast<> where possible.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-10 11:24:51 +00:00
Craig Topper
b82d5479b9 Use SmallVector instead of std::vector for uniquing X86 disassembler operand sets. The number of operands is a small fixed size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-09 04:08:48 +00:00
Craig Topper
13154acf19 Simplify some printing code by combining new lines onto previous strings. Don't work so hard not to print a comma on the last entry of an array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234464 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-09 04:08:46 +00:00
Craig Topper
684de8845e Don't convert enum to strings just to put them in the uniquing map. Use the enum directly. Only convert to a string for printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-09 04:08:42 +00:00
Craig Topper
a0400a7bf6 Revert r234389. It really was needed but really should have been cstring instead of string.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-08 06:03:17 +00:00
Craig Topper
5885e26abc Remove unnecessary include. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234389 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-08 05:56:30 +00:00
Pete Cooper
bf36adeed4 Add boolean to PrintStackTraceOnErrorSignal to disable crash reporting.
The current crash reporting on Mac OS is only disabled via an environment variable.
This adds a boolean (default false) which can also disable crash reporting.

The only client right now is the unittests which don't ever want crash reporting, but do want to detect killed programs.

Reduces the time to run the APFloat unittests on my machine from

[----------] 47 tests from APFloatTest (51250 ms total)

to

[----------] 47 tests from APFloatTest (765 ms total)

Reviewed by Reid Kleckner and Justin Bogner

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-07 20:43:23 +00:00
Reid Kleckner
285ec33f69 [lit] Allow disabling an entire gtest suite, as is done in tsan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234336 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-07 18:14:10 +00:00
Toma Tabacu
0e407e7bbf [TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.
Summary:
The loop which emits AssemblerPredicate conditions also links them together by emitting a '&&'.
If the 1st predicate is not an AssemblerPredicate, while the 2nd one is, nothing gets emitted for the 1st one, but we still emit the '&&' because of the 2nd predicate.
This generated code looks like "( && Cond2)" and is invalid.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234312 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-07 12:10:11 +00:00
Reid Kleckner
93d8e23940 [lit] Skip gtest names starting with DISABLED_
The sanitizer test suite uses this idiom to disable a test.  Now that we
actually check if a test ran after invoking it, we see that zero tests
ran, and complain.

Instead, ignore tests starting with DISABLED_ completely. Fixes the
sanitizer test suite failures on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234247 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-06 22:16:58 +00:00
Reid Kleckner
0123b6ee73 [lit] Fix running gtest type-parameterized tests on Windows
The '/' character in the test name of a type-parameterized test is not a
path separator, and should not be '\' on Windows. We were passing a test
name to --gtest_filter which found no tests, so the exit code was zero,
indicating a passed test.

This bug has been here since r84387 in 2009, when Jeff Yasskin added the
original lit support for type-paratermized tests. Somewhere along the
line some of the ValueMapTests started failing, but we can fix those
separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-06 21:49:55 +00:00
Matthias Braun
76a7f072ab TableGen: Generate more const goodness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233857 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01 22:09:55 +00:00
Matthias Braun
2c81f7d0a2 Fix AllocationPriority not getting set for derived register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 20:52:25 +00:00
Matthias Braun
8e4eaabdb8 RegAllocGreedy: Allow target to specify register class ordering.
Specify an allocation order with a register class. This is used by register
allocators with a greedy heuristic. This is usefull as it is sometimes
beneficial to color more constrained classes first.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 19:57:53 +00:00
Akira Hatanaka
f09378397e [MCInstPrinter] Enable MCInstPrinter to change its behavior based on the
per-function subtarget.

Currently, code-gen passes the default or generic subtarget to the constructors
of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which
enables some targets (AArch64, ARM, and X86) to change their instprinter's
behavior based on the subtarget feature bits. Since the backend can now use
different subtargets for each function, instprinter has to be changed to use the
per-function subtarget rather than the default subtarget.

This patch takes the first step towards enabling instprinter to change its
behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to
AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the
various print methods table-gen auto-generates. 

I will follow up with changes to instprinters of AArch64, ARM, and X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233411 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 20:36:02 +00:00
Michael Kuperstein
765aab84d6 Revert "Use std::bitset for SubtargetFeatures"
This reverts commit r233055.

It still causes buildbot failures (gcc running out of memory on several platforms, and a self-host failure on arm), although less than the previous time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233068 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-24 12:56:59 +00:00
Michael Kuperstein
d3ab717935 Use std::bitset for SubtargetFeatures
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first time this was committed (r229831), it caused several buildbot failures. 
At least some of the ARM ones were due to gcc/binutils issues, and should now be fixed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233055 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-24 09:17:25 +00:00
Benjamin Kramer
eef4a339b5 Another set of missing raw_ostream.h. Still no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232993 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 18:45:56 +00:00
Benjamin Kramer
ebe8742dd9 More missing includes only visible to MSVC.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232981 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 18:23:08 +00:00
Craig Topper
3220d112fa [Tablegen] Attempt to add support for patterns containing nodes with multiple results.
This is needed for AVX512 masked scatter/gather support.

The R600 change is necessary to remove a hack that was working around the lack of multiple results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-20 05:09:06 +00:00
Matthias Braun
5101c89f13 Do not track subregister liveness when it brings no benefits
Some subregisters are only to indicate different access sizes, while not
providing any way to actually divide the register up into multiple
disjunct parts. Avoid tracking subregister liveness in these cases as it
is not beneficial.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-19 00:21:58 +00:00
Matthias Braun
8b41add6ca TableGen: Fix register class lane masks being too conservative.
When calculating the lanemask of a register class we have to include the
masks of subregisters supported by any of the class members, not just
the ones supported by all class members.

This fixes problems when coalescing towards a subclass with additional
subregisters available.

The attached testcase works fine as is, but does crash if you enable
subregister liveness on x86 without this change applied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232652 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 17:56:09 +00:00
Yaron Keren
703b185464 Remove many superfluous SmallString::str() calls.
Now that SmallString is a first-class citizen, most SmallString::str()
calls are not required. This patch removes a whole bunch of them, yet
there are lots more.

There are two use cases where str() is really needed:
1) To use one of StringRef member functions which is not available in
SmallString.
2) To convert to std::string, as StringRef implicitly converts while 
SmallString do not. We may wish to change this, but it may introduce
ambiguity.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232622 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 10:17:07 +00:00
Eric Christopher
c666f5df88 Use the variable names from the TargetInstrInfo source when we
reference them in the generated files. A few characters aren't huge
here and CFSetupOpcode is much more readable than S0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13 01:26:39 +00:00
Eric Christopher
4223496f24 Add a return after the llvm namespace code for a little extra
readability in generated files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13 01:10:08 +00:00
Mehdi Amini
f7243645ff Fix FileCheck: substr() expect the length of the string as 2nd arg
The code assumed that substr() was taking start,end while it takes
start,length.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-12 00:07:29 +00:00
Eric Christopher
138fe781d2 Have getRegPressureSetLimit take a MachineFunction so that a
we can inspect the subtarget and function when computing values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231951 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:34:58 +00:00
Chandler Carruth
8ec61c101a Fix a grammar issue I introduced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231894 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:19:01 +00:00
Chandler Carruth
bc026689ab Inspired by r231891, use gender neutral pronouns in the places I've
found in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231893 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:15:44 +00:00
Yaron Keren
1132d0cc5b Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 07:33:23 +00:00
Craig Topper
d4843f4c45 Improve and simplify EnforceSmallerThan for vector types.
Explicitly compare the size of the scalar types and the whole vector size rather than just comparing enum encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:25:07 +00:00
Craig Topper
541e68ea57 Remove extra indentation of entire function body. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:25:04 +00:00
Reid Kleckner
fe8490c22e TableGen: Use 'enum : uint64_t' for feature flags to fix -Wmicrosoft
clang-cl would warn that this value is not representable in 'int':
  enum { FeatureX = 1ULL << 31 };
All MS enums are 'ints' unless otherwise specified, so we have to use an
explicit type.  The AMDGPU target just hit 32 features, triggering this
warning.

Now that we have C++11 strong enum types, we can also eliminate the
'const uint64_t' codepath from tablegen and just use 'enum : uint64_t'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231697 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 20:23:14 +00:00
Tom Stellard
98225d9c9c TableGen: Initialize ErrorInfo to ~0ULL in the MatchInstructionImpl
This is what all the targets check for and is consistent with the
initialized value of MissingFeatures, which is sometimes assinged
to ErrorInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231397 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 19:46:55 +00:00
Craig Topper
bc55462859 Revert "[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns."
This is failing on several build bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231358 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 07:17:52 +00:00
Craig Topper
256cb3b576 [TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns.
This should help with the AVX512 masked gather changes Elena is working on. This patch is derived from some of the changes Elena made to tablegen, but modified by me to support arbitrary number of results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231357 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 07:11:36 +00:00
Craig Topper
8ad519fd3c [TableGen] Add support constraining a vector type in a pattern to have a specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 07:11:34 +00:00
David Blaikie
5109ec06a6 Add a FIXME for PR22796, broken ordering of ClassInfo in TableGen
As discussed (at length) in code review of r222935, with Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231282 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 19:56:44 +00:00
Craig Topper
b660ece860 [Tablegen] Use correct result number variables with the pattern nodes they go with when handling SDTCisSameAs. No functional change as they are always both 0 unless you try to define a multi result type profile that uses SDTCisSame on one of the other results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 09:04:54 +00:00
David Blaikie
317ccafdbd Revert "Remove the explicit SDNodeIterator::operator= in favor of the implicit default"
Accidentally committed a few more of these cleanup changes than
intended. Still breaking these out & tidying them up.

This reverts commit r231135.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 21:18:16 +00:00
David Blaikie
b13215ec3b Remove the explicit SDNodeIterator::operator= in favor of the implicit default
There doesn't seem to be any need to assert that iterator assignment is
between iterators over the same node - if you want to reuse an iterator
variable to iterate another node, that's perfectly acceptable. Just
don't mix comparisons between iterators into disjoint sequences, as
usual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 21:17:08 +00:00
David Blaikie
24a7df3690 Avoid explicitly declaring the copy assignment operator, as this unnecessarily makes the copy ctor deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 18:29:27 +00:00
Nick Lewycky
ca99858baa Switch up whitespace with better whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231059 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 07:59:45 +00:00
Nick Lewycky
146db69645 Revert the non-cleanup part of r230769 because it introduced a non-determinism found only in the names of symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 07:57:45 +00:00
Reid Kleckner
2dc2d3f820 lit: Add 'cd' support to the internal shell and port some tests
The internal shell was already threading around a 'cwd' parameter. We
just have to make it mutable so that we can update it as the test script
executes.

If the shell ever grows support for environment variable substitution,
we could also implement support for export.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231017 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 21:33:18 +00:00
Hans Wennborg
f0c07c3691 export.sh: Make sure umask is not too restrictive (PR22742)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230977 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 17:30:42 +00:00
Benjamin Kramer
e1244e83b9 TblGen: Remove copy of SmallVector::operator==. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 15:24:30 +00:00
Benjamin Kramer
d59c5f9a06 Add missing includes. make_unique proliferated everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 21:28:53 +00:00
Elena Demikhovsky
bf4d9a8aaf Reverted 230471 - gather scatter handling in table gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230892 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 08:23:41 +00:00
Elena Demikhovsky
975e9b99aa AVX-512: Added mask and rounding mode for scalar arithmetics
Added more tests for scalar instructions to destinguish between AVX and AVX-512 forms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230891 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 07:44:04 +00:00
Yaron Keren
fa22cce8d7 Silence variable set but not used warning in CodeGenRegisters.cpp, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 15:54:04 +00:00
Benjamin Kramer
31fbd9f7b0 Replace std::copy with a back inserter with vector append where feasible
All of the cases were just appending from random access iterators to a
vector. Using insert/append can grow the vector to the perfect size
directly and moves the growing out of the loop. No intended functionalty
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 10:11:12 +00:00
Owen Anderson
ecf670391b Switch a std::map to a DenseMap in CodeGenRegisters.
The keys of the map are unique by pointer address, so there's no need
to use the llvm::less comparator. This allows us to use DenseMap
instead, which reduces tblgen time by 20% on my stress test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230769 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 17:57:01 +00:00
Reid Kleckner
138aa39eac Re-instate the pragma optimize hack for MSVC, but not clang-cl
Reverts commit r230686 with define modifications.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 21:34:11 +00:00
Reid Kleckner
cc3bcaea20 Remove stale pragma hack for an unsupported MSVC version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 21:08:27 +00:00
Duncan P. N. Exon Smith
9379c31520 FileCheck: Add CHECK-SAME
Add `CHECK-SAME`, which requires that the pattern matches on the *same*
line as the previous `CHECK`/`CHECK-NEXT` -- in other words, no newline
is allowed in the skipped region.  This is similar to `CHECK-NEXT`,
which requires exactly 1 newline in the skipped region.

My motivation is to simplify checking the long lines of LLVM assembly
for the new debug info hierarchy.  This allows CHECK sequences like the
following:

    CHECK:      ![[REF]] = !SomeMDNode(
    CHECK-SAME: file: ![[FILE:[0-9]+]]
    CHECK-SAME: otherField: 93{{[,)]}}

which is equivalent to:

    CHECK: ![[REF]] = !SomeMDNode({{.*}}file: ![[FILE:[0-9]+]]{{.*}}otherField: 93{{[,)]}}

While this example just has two fields, many nodes in debug info have
more than that.  `CHECK-SAME` will keep the logic easy to follow.

Morever, it enables interleaving `CHECK-NOT`s without allowing newlines.
Consider the following:

    CHECK:      ![[REF]] = !SomeMDNode(
    CHECK-SAME: file: ![[FILE:[0-9]+]]
    CHECK-NOT:  unexpectedField:
    CHECK-SAME: otherField: 93{{[,)]}}
    CHECK-NOT:  otherUnexpectedField:
    CHECK-SAME: )

which doesn't seem to have an equivalent `CHECK` line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 04:53:00 +00:00
Eric Christopher
435571ada6 Fix a couple of depedent->dependent typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 00:00:33 +00:00
Elena Demikhovsky
4105fd49d4 AVX-512: Gather and Scatter patterns
Gather and scatter instructions additionally write to one of the source operands - mask register.
In this case Gather has 2 destination values - the loaded value and the mask.
Till now we did not support code gen pattern for gather - the instruction was generated from 
intrinsic only and machine node was hardcoded.
When we introduce the masked_gather node, we need to select instruction automatically,
in the standard way.
I added a flag "hasTwoExplicitDefs" that allows to handle 2 destination operands.

(Some code in the X86InstrFragmentsSIMD.td is commented out, just to split one big
patch in many small patches)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 09:46:31 +00:00
Tim Northover
ca7e0787f0 CodeGen: convert CCState interface to using ArrayRefs
Everyone except R600 was manually passing the length of a static array
at each callsite, calculated in a variety of interesting ways. Far
easier to let ArrayRef handle that.

There should be no functional change, but out of tree targets may have
to tweak their calls as with these examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230118 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:11:17 +00:00
Duncan P. N. Exon Smith
9f8d4037a6 AsmParser/Writer: Handle symbolic constants in DI 'flags:'
Parse (and write) symbolic constants in debug info `flags:` fields.
This prevents a readability (and CHECK-ability) regression with the new
debug info hierarchy.

Old (well, current) assembly, with pretty-printing:

    !{!"...\\0016387", ...} ; ... [public] [rvalue reference]

Flags field without this change:

   !MDDerivedType(flags: 16387, ...)

Flags field with this change:

   !MDDerivedType(flags: DIFlagPublic | DIFlagRValueReference, ...)

As discussed in the review thread, this isn't a final state.  Most of
these flags correspond to `DW_AT_` symbolic constants, and we might
eventually want to support arbitrary attributes in some form.  However,
as it stands now, some of the flags correspond to other concepts (like
`FlagStaticMember`); until things are refactored this is the simplest
way to move forward without regressing assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 01:02:18 +00:00