Commit Graph

5435 Commits

Author SHA1 Message Date
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
Justin Bogner
fa5fd07866 utils: Teach lldbDataFormatters about llvm::Optional
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 02:55:22 +00:00
Michael Kuperstein
2b5910a767 Reverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229841 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 11:38:11 +00:00
Michael Kuperstein
23dd089d8f 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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229831 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 09:01:04 +00:00
Chandler Carruth
4f1b92cece [shuffles] Tweak my shufflevector fuzz test generation script to produce
more useful output. No more null bytes printed, and now with a newline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229599 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 01:36:45 +00:00
Aaron Ballman
4e521d9500 MSVC 2013 does not ICE on this code in the same fashion that MSVC 2012 did; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229422 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 19:33:36 +00:00
Aaron Ballman
66981fe208 Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 22:54:22 +00:00
NAKAMURA Takumi
068db0bdb8 Reapply r229185(cbieneman) -- Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 17:53:10 +00:00
Craig Topper
e2f7231e45 [X86] Add the remaining 11 possible exact ModRM formats. This makes their encodings linear which can then be used to simplify some other code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 04:16:44 +00:00
Chandler Carruth
da0198de41 [x86] Teach my test updating script about another quirk of the printed
asm and port the mmx vector shuffle test to it.

Not thrilled with how it handles the stack manipulation logic, but I'm
much less bothered by that than I am by updating the test manually. =]
If anyone wants to teach the test checks management script about stack
adjustment patterns, that'd be cool too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 00:08:01 +00:00
Chandler Carruth
c9864d8a73 Revert r229224: Make the 'llvm-lit' utility defend against a system where Python3
Apparantly python2.7 also doesn't work. Awesome.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 07:11:25 +00:00
Chandler Carruth
9230ff9ba3 [lit] Make the 'llvm-lit' utility defend against a system where Python3
is the default.

The lit.cfg files are not all valid Python3 and I've no idea if anyone
is really prepared to update them. The easiest way I know of to ensure
that this script uses Python 2 is to use 'python2.7' in the command. Mac
and Linux are definitely fine with this and I think other platforms will
be as well, but if anyone struggles with this set up and has better
ideas, let me know.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 07:05:15 +00:00
NAKAMURA Takumi
6b098c4a26 Revert r229185, "Raising minimum required Visual Studio version to 2013."
All builders are not ready yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 00:45:32 +00:00
Chris Bieneman
c4300b9c01 Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:24:14 +00:00
Craig Topper
f3455f13a2 [X86] Add support for parsing and printing the mnemonic aliases for the XOP VPCOM instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 07:42:25 +00:00
Duncan P. N. Exon Smith
a034e076c2 AsmWriter/Bitcode: MDExpression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229023 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:42:09 +00:00
Duncan P. N. Exon Smith
4730b909f6 AsmWriter: MDSubprogram: Recognize DW_VIRTUALITY in 'virtuality'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:28:16 +00:00
Duncan P. N. Exon Smith
65e1227b37 AsmWriter: MDCompositeType: Recognize DW_LANG in 'runtimeLang'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:21:25 +00:00
Duncan P. N. Exon Smith
95d7135727 AsmWriter: MDBasicType: Recognize DW_ATE in 'encoding'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229006 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:17:35 +00:00
Benjamin Kramer
d913d9d2c3 MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:35:40 +00:00
Ramkumar Ramachandra
218eccd638 [emacs] Get llvm-mode to font-lock "personality"
Differential Revision: http://reviews.llvm.org/D7494

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228555 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-09 00:30:03 +00:00
Elena Demikhovsky
8be39c81b0 Masked Gather and Scatter Intrinsics.
Gather and Scatter are new introduced intrinsics, comming after recently implemented masked load and store.
This is the first patch for Gather and Scatter intrinsics. It includes only the syntax, parsing and verification.

Gather and Scatter intrinsics allow to perform multiple memory accesses (read/write) in one vector instruction.
The intrinsics are not target specific and will have the following syntax:
Gather:
declare <16 x i32> @llvm.masked.gather.v16i32(<16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1> <mask>, <16 x i32> <passthru>)
declare <8 x float> @llvm.masked.gather.v8f32(<8 x float*><vector of ptrs>, i32 <alignment>, <8 x i1> <mask>, <8 x float><passthru>)

Scatter:
declare void @llvm.masked.scatter.v8i32(<8 x i32><vector value to be stored> , <8 x i32*><vector of ptrs> , i32 <alignment>, <8 x i1> <mask>)
declare void @llvm.masked.scatter.v16i32(<16 x i32> <vector value to be stored> , <16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1><mask> )

Vector of ptrs - a set of source/destination addresses, to load/store the value. 
Mask - switches on/off vector lanes to prevent memory access for switched-off lanes
vector of ptrs, value and mask should have the same vector width.

These are code examples where gather / scatter should be used and will allow function vectorization
;void foo1(int * restrict A, int * restrict B, int * restrict C) {
; for (int i=0; i<SIZE; i++) {
; A[i] = B[C[i]];
; }
;}

;void foo3(int * restrict A, int * restrict B) {
; for (int i=0; i<SIZE; i++) {
; A[B[i]] = i+5;
; }
;}

Tests will come in the following patches, with CodeGen and Vectorizer.

http://reviews.llvm.org/D7433



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08 08:27:19 +00:00
Rafael Espindola
3fb6dcc570 Correcting keyword highlighting in llvm-mode.el.
llvm-mode was previously confused when variable names contained keywords.
This changes ensures that keywords are only highlighted when they're standalone.

Patch by Wilfred Hughes!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228396 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 13:57:58 +00:00
Reid Kleckner
304821b21b Don't warn or note if bash is missing
We haven't needed bash on Windows to run the test suite for a long time
now.

Patch by Michael Edwards!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:36:52 +00:00
Chandler Carruth
f95422a37c [x86] Teach the test update script to strip trailing whitespace.
This is done in a bit of a strange way to use a multiline RE instead of
looping over the lines. Suggestions welcome here for a more pythonic way
of doing this as long as its reasonably fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 10:46:48 +00:00
Duncan P. N. Exon Smith
1602e58745 AsmParser: Recognize DW_TAG_* constants
Recognize `DW_TAG_` constants in assembly, and output it by default for
`GenericDebugNode`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:56:01 +00:00
Chandler Carruth
dc5e49a1c4 [x86] Tweak my update script to use test case function names starting
with 'stress' to indicate that the specific output isn't interesting and
relax them to only check the last instruction (a ret).

I've updated the one test case that really uses this to name the one
'stress_test' which was actually producing output we can directly check.
With this, the script doesn't introduce noise when run over the v16 test
file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:26:45 +00:00
David Blaikie
fb29a70867 STLExtras: Provide less/equal functors with templated function call operators, plus a deref'ing functor template utility
Similar to the C++14 void specializations of these templates, useful as
a stop-gap until LLVM switches to '14.

Example use-cases in tblgen because I saw some functors that looked like
they could be simplified/refactored.

Reviewers: dexonsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:35:10 +00:00
Sylvestre Ledru
8931c49efa Fix some bashims. More information on https://wiki.ubuntu.com/DashAsBinSh. Reported initially on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772302 & https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772301
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 14:55:43 +00:00
Owen Anderson
41a9ae532e Replace another std::set in the core of CodeGenRegister, this time with sorted arrays.
The hot path through this region of code does lots of batch inserts into sets. By storing them as sorted arrays, we can defer the sorting to the end of the batch, which is dramatically more efficient. This reduces tblgen runtime by 25% on my worst-case target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 09:13:36 +00:00
Owen Anderson
35da384515 Change more of the guts of CodeGenRegister's RegUnit tracking to be based on bit vectors.
This is a continuation of my prior work to move some of the inner workings for CodeGenRegister to use bit vectors when computing about register units. This is highly beneficial to TableGen runtime on targets with large, dense register files. This patch represents a ~40% runtime reduction over and above my earlier improvement on a stress test of this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 07:49:41 +00:00
Owen Anderson
bc227b65c2 Change a very hot piece of code in TableGen's register unit computations to use bit vectors rather than arrays.
For target descriptions with very large and very dense register files, TableGen
can take an extremely long time to run.  This change makes a dent in that (~15%
in my measurements) by accelerating the single hottest operation with better data
structures.

I believe there's still a lot of room to make this even faster with more global
changes that require replacing some of the existing datastructures in this area
with bit vectors, but that's a more involved change and I wanted to get this
simpler improvement in first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 09:05:49 +00:00
Craig Topper
aef361807e [X86] Teach disassembler to handle illegal immediates on AVX512 integer compare instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 10:09:56 +00:00
Eric Christopher
04bcc11905 Move DataLayout back to the TargetMachine from TargetSubtargetInfo
derived classes.

Since global data alignment, layout, and mangling is often based on the
DataLayout, move it to the TargetMachine. This ensures that global
data is going to be layed out and mangled consistently if the subtarget
changes on a per function basis. Prior to this all targets(*) have
had subtarget dependent code moved out and onto the TargetMachine.

*One target hasn't been migrated as part of this change: R600. The
R600 port has, as a subtarget feature, the size of pointers and
this affects global data layout. I've currently hacked in a FIXME
to enable progress, but the port needs to be updated to either pass
the 64-bitness to the TargetMachine, or fix the DataLayout to
avoid subtarget dependent features.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-26 19:03:15 +00:00
Craig Topper
896c1e9b70 [X86] Replace i32i8imm on SSE/AVX instructions with i32u8imm which will make the assembler bounds check them. It will also make them print as unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227032 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-25 02:21:16 +00:00
Ramkumar Ramachandra
ae597a058a [emacs] llvm-mode: fix parens, font-lock i*
In llvm-mode, with electric-pair-mode turned on, typing a literal '['
would print out '[[', and '(' would print a '(('. This was a very
annoying bug caused by overzealous syntax-table entries: the parens are
already part of the '(' and ')' class by default. Fix this.

While at it, notice that i32, i64, i1 etc. are not font-locked despite a
clear intent to do so. The issue is that regexp-opt doesn't accept
regular expressions. So, spell out the common literal integers with
different widths.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-23 19:45:35 +00:00
Ramkumar Ramachandra
c429da847f [emacs] Use c-mode-common-hook, derive from "gnu"
Make it clear that the "llvm.org" style is deriving from "gnu" style,
and use the c-mode-common-hook instead of c-mode-hook and c++-mode-hook.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22 20:56:25 +00:00
Ramkumar Ramachandra
230796b278 Intrinsics: introduce llvm_any_ty aka ValueType Any
Specifically, gc.result benefits from this greatly. Instead of:

gc.result.int.*
gc.result.float.*
gc.result.ptr.*
...

We now have a gc.result.* that can specialize to literally any type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226857 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22 20:14:38 +00:00
Eric Fiselier
b727b13f61 [lit] Format JSONMetricValue strings better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226672 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21 16:38:31 +00:00
Craig Topper
951d088ae7 [X86] Convert all the i8imm used by SSE and AVX instructions to u8imm.
This makes the assembler check their size and removes a hack from the disassembler to avoid sign extending the immediate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21 08:15:54 +00:00
Rafael Espindola
e4f11175cb Use -Wl,defs when linking.
ELF linkers by default allow shared libraries to contain undefined references
and it is up to the dynamic linker to look for them.

On COFF and MachO, that is not the case.

This creates a situation where a .so might build on an ELF system, but the build
of the corresponding .dylib or .dll will fail.

This patch changes the cmake build to use -Wl,-z,defs when linking and updates
the dependencies so that -DBUILD_SHARED_LIBS=ON build still works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20 21:23:15 +00:00
Alexander Kornienko
b4c6267f7c Replace size method call of containers to empty method where appropriate
This patch was generated by a clang tidy checker that is being open sourced.
The documentation of that checker is the following:

/// The emptiness of a container should be checked using the empty method
/// instead of the size method. It is not guaranteed that size is a
/// constant-time function, and it is generally more efficient and also shows
/// clearer intent to use empty. Furthermore some containers may implement the
/// empty method but not implement the size method. Using empty whenever
/// possible makes it easier to switch to another container in the future.

Patch by Gábor Horváth!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226161 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 11:41:30 +00:00
Hans Wennborg
961f28cd71 utils/release/tag.sh: fix -revision vs. -rc check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 04:36:20 +00:00
Hal Finkel
5a40bef797 [TableGen] Add support for negative immediates to AsmMatcherEmitter
This adds support for creating an InstAlias with a negative immediate, i.e.:

  def NOT : InstAlias<"not $dst, $src", (XORI GR32:$dst, GR32:$src, -1)>;

by resolving this problem:

RISCVGenAsmMatcher.inc:95:11: error: expected '= constant-expression' or end of enumerator definition
  CVT_imm_-1,
  ^^^^^^^^^^

Patch by Jordy Potman, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226073 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 01:33:00 +00:00
Rafael Espindola
7c845683ea Don't set LD_PRELOAD to ''. It doesn't work on OpenBSD.
Patch by Brad Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 00:39:56 +00:00
Duncan P. N. Exon Smith
3b0fe4ec0a AsmParser/Bitcode: Add support for MDLocation
This adds assembly and bitcode support for `MDLocation`.  The assembly
side is rather big, since this is the first `MDNode` subclass (that
isn't `MDTuple`).  Part of PR21433.

(If you're wondering where the mountains of testcase updates are, we
don't need them until I update `DILocation` and `DebugLoc` to actually
use this class.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 21:10:44 +00:00
Reid Kleckner
221a7075cf Add the llvm.frameallocate and llvm.recoverframeallocation intrinsics
These intrinsics allow multiple functions to share a single stack
allocation from one function's call frame. The function with the
allocation may only perform one allocation, and it must be in the entry
block.

Functions accessing the allocation call llvm.recoverframeallocation with
the function whose frame they are accessing and a frame pointer from an
active call frame of that function.

These intrinsics are very difficult to inline correctly, so the
intention is that they be introduced rarely, or at least very late
during EH preparation.

Reviewers: echristo, andrew.w.kaylor

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 00:48:10 +00:00
Hans Wennborg
7472c76052 Release merge script: don't actually commit the merge
Instead, just present the command for committing it. This way,
the user can test the merge locally, resolve conflicts, etc.
before committing, which seems much safer to me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 00:07:31 +00:00
Hans Wennborg
589d1a16b5 Release tag script: add -revision option
It seems useful to be able to create the branch at a revision that looks good
on the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225736 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 00:07:29 +00:00
Hans Wennborg
ab860e7a08 Release tag script: add -dry-run flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225735 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 00:07:22 +00:00
Eric Fiselier
1af01214b5 [LIT] Remove string decoding in gtest discovery code. lit.util.capture now does decoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225693 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12 20:43:34 +00:00
Eric Fiselier
2d88dc293b [LIT] Decode string result in lit.util.capture
Summary: I think this is probably a bug, but I'm putting this up for review just to be sure. I think that `lit.util.capture` should decode the resulting string in the same way `lit.util.executeCommand` does.

Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12 20:09:34 +00:00
Tom Stellard
b461e8304c Target: Allow target specific operand types
This adds two new fields to the RegisterOperand TableGen class:

string OperandNamespace = "MCOI";
string OperandType = "OPERAND_REGISTER";

These fields can be used to specify a target specific operand type,
which will be stored in the OperandType member of the MCOperandInfo
object.

This can be useful for targets that need to store some extra information
about operands that cannot be expressed using the target independent
types.  For example, in the R600 backend, there are operands which
can take either registers or immediates and it is convenient to be able
to specify this in the TableGen definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225661 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12 19:33:09 +00:00
Chandler Carruth
ecf84c1124 Add a new utility script that helps update very simple regression tests.
This script is currently specific to x86 and limited to use with very
small regression or feature tests using 'llc' and 'FileCheck' in
a reasonably canonical way. It is in no way general purpose or robust at
this point. However, it works quite well for simple examples. Here is
the intended workflow:

- Make a change that requires updating N test files and M functions'
  assertions within those files.
- Stash the change.
- Update those N test files' RUN-lines to look "canonical"[1].
- Refresh the FileCheck lines for either the entire file or select
  functions by running this script.
  - The script will parse the RUN lines and run the 'llc' binary you
    give it according to each line, collecting the asm.
  - It will then annotate each function with the appropriate FileCheck
    comments to check every instruction from the start of the first
    basic block to the last return.
  - There will be numerous cases where the script either fails to remove
    the old lines, or inserts checks which need to be manually editted,
    but the manual edits tend to be deletions or replacements of
    registers with FileCheck variables which are fast manual edits.
  - A common pattern is to have the script insert complete checking of
    every instruction, and then edit it down to only check the relevant
    ones.
  - Be careful to do all of these cleanups though! The script is
    designed to make transferring and formatting the asm output of llc
    into a test case fast, it is *not* designed to be authoratitive
    about what constitutes a good test!
- Commit the nice fresh baseline of checks.
- Unstash your change and rebuild llc.
- Re-run script to regenerate the FileCheck annotations
  - Remember to re-cleanup these annotations!!!
- Check the diff to make sure this is sane, checking the things you
  expected it to, and check that the newly updated tests actually pass.
- Profit!

Also, I'm *terrible* at writing Python, and frankly I didn't spend a lot
of time making this script beautiful or well engineered. But it's useful
to me and may be useful to others so I thought I'd send it out.

http://reviews.llvm.org/D5546

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12 04:43:18 +00:00
Duncan P. N. Exon Smith
f416d72973 IR: Add 'distinct' MDNodes to bitcode and assembly
Propagate whether `MDNode`s are 'distinct' through the other types of IR
(assembly and bitcode).  This adds the `distinct` keyword to assembly.

Currently, no one actually calls `MDNode::getDistinct()`, so these nodes
only get created for:

  - self-references, which are never uniqued, and
  - nodes whose operands are replaced that hit a uniquing collision.

The concept of distinct nodes is still not quite first-class, since
distinct-ness doesn't yet survive across `MapMetadata()`.

Part of PR22111.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-08 22:38:29 +00:00
Craig Topper
367b67df3e [X86] Don't print 'dword ptr' or 'qword ptr' on the operand to some of the LEA variants in Intel syntax. The memory operand is inherently unsized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225432 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-08 07:41:30 +00:00
Rafael Espindola
1763c0ad7f Improvements to emacs packages for llvm and tablegen mode.
* Both files have valid package headers and footers (you can verify
with M-x checkdoc).
* Fixed style warnings generated by checkdoc.
* Fixed a byte-compiler warning in llvm-mode.el.
* Ensure that the modes are autoloaded, so users do not need to
(require 'llvm-mode) to use them.

Patch by Wilfred Hughes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 15:52:51 +00:00
Craig Topper
decea4d6a6 [X86] Remove some unused TYPE enums from the disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 07:47:52 +00:00
Craig Topper
f6145affbf [X86] Add OpSize32 to XBEGIN_4. Add XBEGIN_2 with OpSize16.
Requires new AsmParserOperand types that detect 16-bit and 32/64-bit mode so that we choose the right instruction based on default sizing without predicates. This is necessary since predicates mess up the disassembler table building.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 08:59:30 +00:00
Craig Topper
3249372d83 [X86] Remove unused operand type from disassembler handling. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-05 08:18:52 +00:00
Craig Topper
2717b066cc Fix some formatting in tablegen output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-03 08:16:29 +00:00
Craig Topper
577a76839b Replace some 'unreachable' comments with llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-03 08:16:14 +00:00
Craig Topper
01c99892ca [X86] Disassembler support for move to/from %rax with a 32-bit memory offset is REX.W and AdSize prefix are both present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225099 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-03 00:00:20 +00:00
Craig Topper
71fc42dbf6 [X86] Make the instructions that use AdSize16/32/64 co-exist together without using mode predicates.
This is necessary to allow the disassembler to be able to handle AdSize32 instructions in 64-bit mode when address size prefix is used.

Eventually we should probably also support 'addr32' and 'addr16' in the assembler to override the address size on some of these instructions. But for now we'll just use special operand types that will lookup the current mode size to select the right instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-02 07:02:25 +00:00
Craig Topper
51f423ff30 [X86] Fix disassembly of absolute moves to work correctly in 16 and 32-bit modes with all 4 combinations of OpSize and AdSize prefixes being present or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225036 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-31 07:07:31 +00:00
Elena Demikhovsky
b31322328a Masked Load/Store - Changed the order of parameters in intrinsics.
No functional changes.
The documentation is coming.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-25 07:49:20 +00:00
Craig Topper
3bc4397f1f [X86] Remove the single AdSize indicator and replace it with separate AdSize16/32/64 flags.
This removes a hardcoded list of instructions in the CodeEmitter. Eventually I intend to remove the predicates on the affected instructions since in any given mode two of them are valid if we supported addr32/addr16 prefixes in the assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224809 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-24 06:05:22 +00:00
Rafael Espindola
50c8c5686e Pass LSAN_OPTIONS down so that it is possible to add suppressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224777 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-23 18:39:02 +00:00
David Blaikie
1b15304599 Use iterators rather than indices to make this forwards-compatible with a change to the underlying container (to std::list)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224734 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22 21:26:38 +00:00
David Blaikie
d39a5d49b4 unique_ptrify MatchableInfo(const CodeGenInstAlias *Alias)'s parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224733 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22 21:26:26 +00:00
Eric Fiselier
2bea59bd02 Split executeShTest into two parts so that it can be better leveraged by libc++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224672 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-20 03:23:53 +00:00
Eric Fiselier
74430387cd [LIT] Add JSONMetricValue type to wrap types supported by the json encoder.
Summary:
The following types can be encoded and decoded by the json library:
`dict`, `list`, `tuple`, `str`, `unicode`, `int`, `long`, `float`, `bool`, `NoneType`. 

`JSONMetricValue` can be constructed with any of these types, and used as part of Test.Result.
This patch also adds a toMetricValue function that converts a value into a MetricValue.




Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224628 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-19 22:29:12 +00:00
Evgeny Astigeevich
a4020f211b On behalf of Matthew Wahab:
An instruction alias defined with InstAlias and an optional operand in the
middle of the AsmString field, "..${a} <operands>", would get the final
"}" printed in the instruction disassembly. This wouldn't happen if the optional
operand appeared as the last item in the AsmString which is how the current
backends avoided the problem.

There don't appear to be any tests for this part of Tablegen but it passes the
pre-commit tests. Manually tested the change by enabling the generic alias
printer in the ARM backend and checking the output.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224348 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 18:16:17 +00:00
Ahmed Bougacha
3ddc32292d [MC] Reset the MCInst in the matcher function before adding opcode/operands.
On X86, the Intel asm parser tries to match all memory operand sizes when
none is explicitly specified.  For LEA, which doesn't really have a memory
operand (just a pointer one), this results in multiple successful matches,
one for each memory size.  There's no error because it's same opcode, so
really, it's just one match.  However, the tablegen'd matcher function
adds opcode/operands to the passed MCInst, and this results in multiple
duplicated operands.

This commit clears the MCInst in the tablegen'd matcher function.
We sometimes clear it when the match failed, so there's no expectation of
keeping the previous content anyway.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224347 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 18:05:28 +00:00
Craig Topper
55c9dbf599 Use unique_ptr to remove explicit delete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 00:40:07 +00:00
Craig Topper
1b40b342eb Use range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224187 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-13 05:12:19 +00:00
Saleem Abdulrasool
3e07e74e72 utils: update vim syntax highlighting for LLVM IR
Add missing externally_initialized keyword from SVN r174340.  Also reflow the
text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224155 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 21:52:44 +00:00
Michael Ilseman
3f0e8837be Clean up static analyzer warnings.
Clang's static analyzer found several potential cases of undefined
behavior, use of un-initialized values, and potentially null pointer
dereferences in tablegen, Support, MC, and ADT. This cleans them up
with specific assertions on the assumptions of the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 21:48:03 +00:00
Rafael Espindola
fe6c7ee0f0 Now that we require a newer python, use the new exception syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224130 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 15:32:23 +00:00
Rafael Espindola
708bc15ff0 Require python 2.7.
We were already requiring 2.5, which meant that people on old linux distros
had to upgrade anyway.

Requiring python 2.6 will make supporting 3.X easier as we can use the 3.X
exception syntax.

According to the discussion on llvmdev, there is not much value is requiring
just 2.6, we may as well just require 2.7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224129 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 15:29:31 +00:00
Matt Arsenault
9dd31e8016 Try to include operand counts for mismatches in tablegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224068 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 22:27:14 +00:00
Craig Topper
3490558860 Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224005 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 07:04:54 +00:00
Craig Topper
f492c9e612 Use unique_ptr instead of DeleteContainerSeconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223918 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10 06:18:57 +00:00
Eric Fiselier
bd11260981 [LIT] Add support for UNSUPPORTED tag to TestRunner.parseIntegratedTestScript
Summary:
This patch gives me just enough to leverage the existing functionality in `TestRunner` for use in `libc++` and `libc++abi` .

It does the following:
* Adds the `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`.
* Allows `parseIntegratedTestScript` to return an empty script if a script is not required by the caller.



Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223915 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10 03:42:09 +00:00
Matthias Braun
84cc6ec889 Tablegen'erate lanemasks for register units.
Now we can relate lanemasks in a virtual register to register units.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223889 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10 01:12:56 +00:00
Matthias Braun
6fed9cabfd Add function that translates subregister lane masks to other subregs.
This works like the composeSubRegisterIndices() function but transforms
a subregister lane mask instead of a subregister index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223874 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10 01:12:00 +00:00
Matthias Braun
2d1536af06 Let tablegen compute maximum lanemask for regs/regclasses.
Let tablegen compute the combination of subregister lanemasks for all
subregisters in a register/register class. This is preparation for further
work subregister allocation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223873 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10 01:11:56 +00:00
Will Newton
f1f6524e05 Improve emacs coding style
Remove setting of default style, this way is not recommended and
means that all the settings have to be duplicated to demonstrate the
c-add-style method which is a much better way of doing it.

Remove the modified date as it is better stored in SVN.

Tweak a few style parameters to make them conform to the actual LLVM
style.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223765 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 08:58:31 +00:00
Craig Topper
d5578c8ba3 Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223762 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 08:05:51 +00:00
David Majnemer
726bd41602 lit: Don't use python 2.6 features
LLVM supports python 2.5, this fixes a (somewhat) recent regression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223626 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:33:30 +00:00
Chris Matthews
ab1837aef3 Fix for xunit output to work around issue in Jenkins when tests are at the root level
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223562 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 01:13:49 +00:00
Chris Matthews
689f10d1b5 Fix corner cases in lit xunit for paths with dots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223549 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 00:21:08 +00:00
Daniel Sanders
86bf88145b test-release.sh: Add a way to specify --build to configure
Summary:
I currently have to specify --build=mips-linux-gnu or --build=mipsel-linux-gnu
to configure in order to successfully recurse a 32-bit build of the compiler on
my mips64-linux-gnu and mips64el-linux-gnu targets. This is a bug and will be
fixed but in the meantime it will be useful to have a way to work around this.

Reviewers: tstellarAMD

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223369 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04 17:15:35 +00:00
Daniel Sanders
d27b0b9489 test-release.sh: Correct the logged configure command to match the one actually issued.
--disable-timestamps was added to the configure command way back in r142647 but
the command that echos this command to the log was not updated at the time.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223351 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04 11:00:09 +00:00
Elena Demikhovsky
73ae1df82c Masked Load / Store Intrinsics - the CodeGen part.
I'm recommiting the codegen part of the patch.
The vectorizer part will be send to review again.

Masked Vector Load and Store Intrinsics.
Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional memory accesses by generating these intrinsics for existing targets AVX2 and AVX-512. The vectorizer asks the target about availability of masked vector loads and stores.
Added SDNodes for masked operations and lowering patterns for X86 code generator.
Examples:
<16 x i32> @llvm.masked.load.v16i32(i8* %addr, <16 x i32> %passthru, i32 4 /* align */, <16 x i1> %mask)
declare void @llvm.masked.store.v8f64(i8* %addr, <8 x double> %value, i32 4, <8 x i1> %mask)

Scalarizer for other targets (not AVX2/AVX-512) will be done in a separate patch.

http://reviews.llvm.org/D6191



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223348 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04 09:40:44 +00:00
Chris Matthews
0baca9564c Add a test-case for lit xunit output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 23:01:35 +00:00
Chris Matthews
06a1a5f256 Don't allow test-suite names with . in them in xml output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 22:59:15 +00:00
David Blaikie
687f237b53 range-for some things
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223263 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 19:58:49 +00:00
David Blaikie
4496906657 Simplify CodeGenRegBank::inferMatchingSuperRegClass & its caller by passing an iterator rather than index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223262 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 19:58:48 +00:00
David Blaikie
7a16f34aa6 Simplify ownership of RegClasses by using list<CodeGenRegisterClass> instead of vector<CodeGenRegisterClass*>
This complicates a few algorithms due to not having random access, but
not by a huge degree I don't think (open to debate/design
discussion/etc).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 19:58:45 +00:00
David Blaikie
89036eb44c Range-for some stuff related to RegClasses, and comment cases where range-for isn't suitable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223260 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 19:58:41 +00:00