oota-llvm.git
9 years ago[SKX] Enabling mask logic instructions: encoding, lowering
Robert Khasanov [Mon, 28 Jul 2014 13:46:45 +0000 (13:46 +0000)]
[SKX] Enabling mask logic instructions: encoding, lowering
Instructions: KAND{BWDQ}, KANDN{BWDQ}, KOR{BWDQ}, KXOR{BWDQ}, KXNOR{BWDQ}

Reviewed by Elena Demikhovsky <elena.demikhovsky@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214081 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEmit a warning if llvm_map_components_to_libraries() is used noting that its
Dan Liew [Mon, 28 Jul 2014 13:36:50 +0000 (13:36 +0000)]
Emit a warning if llvm_map_components_to_libraries() is used noting that its
use is deprecated in favour of llvm_map_components_to_libnames()

Although message(DEPRECATION "msg") would probably be a better fit this
does nothing if CMAKE_ERROR_DEPRECATED and CMAKE_WARNING_DEPRECATED are
both off, which is the default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214078 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDocument the new LLVM CMake interface for building against LLVM
Dan Liew [Mon, 28 Jul 2014 13:36:37 +0000 (13:36 +0000)]
Document the new LLVM CMake interface for building against LLVM
libraries. With many contributions from Brad King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214077 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixed sphinx warning.
Dan Liew [Mon, 28 Jul 2014 13:33:51 +0000 (13:33 +0000)]
Fixed sphinx warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214076 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Add testcase forgotten in the 214072 commit.
Ulrich Weigand [Mon, 28 Jul 2014 13:10:25 +0000 (13:10 +0000)]
[PowerPC] Add testcase forgotten in the 214072 commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214073 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Support ELFv1/ELFv2 ABI selection via features
Ulrich Weigand [Mon, 28 Jul 2014 13:09:28 +0000 (13:09 +0000)]
[PowerPC] Support ELFv1/ELFv2 ABI selection via features

While LLVM now supports both ELFv1 and ELFv2 ABIs, their use is currently
hard-coded via the target triple: powerpc64-linux is always ELFv1, while
powerpc64le-linux is always ELFv2.

These are of course the most common scenarios, but in principle it is
possible to support the ELFv2 ABI on big-endian or the ELFv1 ABI on
little-endian systems (and GCC does support that), and there are some
special use cases for that (e.g. certain Linux kernel versions could
only be built using ELFv1 on LE).

This patch implements the LLVM side of supporting this.  As precedent
on other platforms suggests, ABI options are passed to the back-end as
features.  Thus, this patch implements two features "elfv1" and "elfv2"
that select the desired ABI if present.  (If not, the LLVM uses the
same default rules as now.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214072 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoStart adding some tests for the gold plugin.
Rafael Espindola [Sun, 27 Jul 2014 23:11:06 +0000 (23:11 +0000)]
Start adding some tests for the gold plugin.

These are only used when the 'ld' in the path is gold and the plugin has
been built, but it is already a start to make sure we don't regress features
that cannot be tested with llvm-lto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214058 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoARM: correct handling of features in arch_extension
Saleem Abdulrasool [Sun, 27 Jul 2014 19:07:09 +0000 (19:07 +0000)]
ARM: correct handling of features in arch_extension

The subtarget information is the ultimate source of truth for the feature set
that is enabled at this point.  We would previously not propagate the feature
information to the subtarget.  While this worked for the most part (features
would be enabled/disabled as requested), if another operation that changed the
feature bits was encountered (such as a mode switch via a .arm or .thumb
directive), we would end up resetting the behaviour of the architectural
extensions.

Handling this properly requires a slightly more complicated handling.  We need
to check if the feature is now being toggled.  If so, only then do we toggle the
features.  In return, we no longer have to calculate the feature bits ourselves.

The test changes are mostly to the diagnosis, which is now more uniform (a nice
side effect!).  Add an additional test to ensure that we handle this case
properly.

Thanks to Nico Weber for alerting me to this issue!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214057 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoARM: convert loop to range based
Saleem Abdulrasool [Sun, 27 Jul 2014 19:07:05 +0000 (19:07 +0000)]
ARM: convert loop to range based

Convert a loop to use range based iteration.  Rename structure members to help
naming, and make structure definition anonymous.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214056 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd alignment value to allowsUnalignedMemoryAccess
Matt Arsenault [Sun, 27 Jul 2014 17:46:40 +0000 (17:46 +0000)]
Add alignment value to allowsUnalignedMemoryAccess

Rename to allowsMisalignedMemoryAccess.

On R600, 8 and 16 byte accesses are mostly OK with 4-byte alignment,
and don't need to be split into multiple accesses. Vector loads with
an alignment of the element type are not uncommon in OpenCL code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214055 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAArch64: fix conversion of 'J' inline asm constraints.
Tim Northover [Sun, 27 Jul 2014 07:10:29 +0000 (07:10 +0000)]
AArch64: fix conversion of 'J' inline asm constraints.

'J' represents a negative number suitable for an add/sub alias
instruction, but while preparing it to become an int64_t we were
mangling the sign extension. So "i32 -1" became 0xffffffffLL, for
example.

Should fix one half of PR20456.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214052 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Sink a variable only used by asserts into the asserts. Should fix
Chandler Carruth [Sun, 27 Jul 2014 01:45:49 +0000 (01:45 +0000)]
[x86] Sink a variable only used by asserts into the asserts. Should fix
some -Werror bots, sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214043 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Add a much more powerful framework for combining x86 shuffle
Chandler Carruth [Sun, 27 Jul 2014 01:15:58 +0000 (01:15 +0000)]
[x86] Add a much more powerful framework for combining x86 shuffle
instructions in the legalized DAG, and leverage it to combine long
sequences of instructions to PSHUFB.

Eventually, the other x86-instruction-specific shuffle combines will
probably all be driven out of this routine. But the real motivation is
to detect after we have fully legalized and optimized a shuffle to the
minimal number of x86 instructions whether it is profitable to replace
the chain with a fully generic PSHUFB instruction even though doing so
requires either a load from a constant pool or tying up a register with
the mask.

While the Intel manuals claim it should be used when it replaces 5 or
more instructions (!!!!) my experience is that it is actually very fast
on modern chips, and so I've gon with a much more aggressive model of
replacing any sequence of 3 or more instructions.

I've also taught it to do some basic canonicalization to special-purpose
instructions which have smaller encodings than their generic
counterparts.

There are still quite a few FIXMEs here, and I've not yet implemented
support for lowering blends with PSHUFB (where its power really shines
due to being able to zero out lanes), but this starts implementing real
PSHUFB support even when using the new, fancy shuffle lowering. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214042 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ADT] Add a remarkbly useful little helper routine to ArrayRef for
Chandler Carruth [Sun, 27 Jul 2014 01:11:19 +0000 (01:11 +0000)]
[ADT] Add a remarkbly useful little helper routine to ArrayRef for
checking whether the ArrayRef is equal to an explicit list of arguments.

This is particularly easy to implement even without variadic templates
because ArrayRef happens to be homogeneously typed. As a consequence we
can use a "clever" wrapper type and default arguments to capture in
a single method many arguments as well as *how many* arguments the user
specified.

Thanks to Dave Blaikie for helping me pull together this little helper.
Suggestions for how to improve or generalize it are of course welcome.
I'll be using it immediately in my follow-up patch. =D

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214041 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Fix broken test.
Matt Arsenault [Sat, 26 Jul 2014 21:21:42 +0000 (21:21 +0000)]
R600/SI: Fix broken test.

There was no check prefix for the instruction lines.
Match what is emitted though, although I'm pretty sure it is
incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214035 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix the failing test 'vector-idiv.ll'.
Joey Gouly [Sat, 26 Jul 2014 10:58:14 +0000 (10:58 +0000)]
Fix the failing test 'vector-idiv.ll'.
On Darwin the comment character is ##.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214028 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Move intrinsic lowering to separate functions
Matt Arsenault [Sat, 26 Jul 2014 06:23:37 +0000 (06:23 +0000)]
R600: Move intrinsic lowering to separate functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214023 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] Add an assert that we don't mess up the number of values when
Chandler Carruth [Sat, 26 Jul 2014 05:53:16 +0000 (05:53 +0000)]
[SDAG] Add an assert that we don't mess up the number of values when
replacing nodes in the legalizer.

This caught a number of bugs for me during development.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214022 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] Simplify the code for handling single-value nodes and add
Chandler Carruth [Sat, 26 Jul 2014 05:52:51 +0000 (05:52 +0000)]
[SDAG] Simplify the code for handling single-value nodes and add
a missing transfer of debug information (without which tests fail).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214021 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] When performing post-legalize DAG combining, run the legalizer
Chandler Carruth [Sat, 26 Jul 2014 05:49:40 +0000 (05:49 +0000)]
[SDAG] When performing post-legalize DAG combining, run the legalizer
over each node in the worklist prior to combining.

This allows the combiner to produce new nodes which need to go back
through legalization. This is particularly useful when generating
operands to target specific nodes in a post-legalize DAG combine where
the operands are significantly easier to express as pre-legalized
operations. My immediate use case will be PSHUFB formation where we need
to build a constant shuffle mask with a build_vector node.

This also refactors the relevant functionality in the legalizer to
support this, and updates relevant tests. I've spoken to the R600 folks
and these changes look like improvements to them. The avx512 change
needs to be investigated, I suspect there is a disagreement between the
legalizer and the DAG combiner there, but it seems a minor issue so
leaving it to be re-evaluated after this patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214020 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix broken assert.
Nick Lewycky [Sat, 26 Jul 2014 05:44:15 +0000 (05:44 +0000)]
Fix broken assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214019 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoX86ShuffleDecode.cpp: Silence a warning. [-Wunused-variable]
NAKAMURA Takumi [Sat, 26 Jul 2014 04:53:05 +0000 (04:53 +0000)]
X86ShuffleDecode.cpp: Silence a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214016 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm/test/CodeGen/X86/vector-idiv.ll: Fix for -Asserts.
NAKAMURA Takumi [Sat, 26 Jul 2014 04:47:01 +0000 (04:47 +0000)]
llvm/test/CodeGen/X86/vector-idiv.ll: Fix for -Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214015 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Fix PR20355 (for real). There are many layers to this bug.
Chandler Carruth [Sat, 26 Jul 2014 03:46:57 +0000 (03:46 +0000)]
[x86] Fix PR20355 (for real). There are many layers to this bug.

The tale starts with r212808 which attempted to fix inversion of the low
and high bits when lowering MUL_LOHI. Sadly, that commit did not include
any positive test cases, and just removed some operations from a test
case where the actual logic being changed isn't fully visible from the
test.

What this commit did was two things. First, it reversed the low and high
results in the formation of the MERGE_VALUES node for the multiple
results. This is entirely correct.

Second it changed the shuffles for extracting the low and high
components from the i64 results of the multiplies to extract them
assuming a big-endian-style encoding of the multiply results. This
second change is wrong. There is no big-endian encoding in x86, the
results of the multiplies are normal v2i64s: when cast to v4i32, the low
i32s are at offsets 0 and 2, and the high i32s are at offsets 1 and 3.

However, the first change wasn't enough to actually fix the bug, which
is (I assume) why the second change was also made. There was another bug
in the MERGE_VALUES formation: we weren't using a VTList, and so were
getting a single result node! When grabbing the *second* result from the
node, we got... well.. colud be anything. I think this *appeared* to
invert things, but had to be causing other problems as well.

Fortunately, I fixed the MERGE_VALUES issue in r213931, so we should
have been fine, right? NOOOPE! Because the core bug was never addressed,
the test in vector-idiv failed when I fixed the MERGE_VALUES node.
Because there are essentially no docs for this node, I had to guess at
how to fix it and tried swapping the operands, restoring the order of
the original code before r212808. While this "fixed" the test case (in
that we produced the write instructions) we were still extracting the
wrong elements of the i64s, and thus PR20355 was still broken.

This commit essentially reverts the big-endian-style extraction part of
r212808 and goes back to the original masks which were correct. Now that
the MERGE_VALUES node formation is also correct, everything works. I've
also included a more detailed test from PR20355 to make sure this stays
fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214011 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Finish switching from CHECK to ALL. This was mistakenly included
Chandler Carruth [Sat, 26 Jul 2014 03:46:54 +0000 (03:46 +0000)]
[x86] Finish switching from CHECK to ALL. This was mistakenly included
in r214007 and then reverted when I backed that (very misguided) patch
out. This recovers the test case cleanup which was good.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214010 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Revert r214007: Fix PR20355 ...
Chandler Carruth [Sat, 26 Jul 2014 02:14:54 +0000 (02:14 +0000)]
[x86] Revert r214007: Fix PR20355 ...

The clever way to implement signed multiplication with unsigned *is
already implemented* and tested and working correctly. The bug is
somewhere else. Re-investigating.

This will teach me to not scroll far enough to read the code that did
what I thought needed to be done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214009 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Fix PR20355 (and dups) by not using unsigned multiplication when
Chandler Carruth [Sat, 26 Jul 2014 01:52:13 +0000 (01:52 +0000)]
[x86] Fix PR20355 (and dups) by not using unsigned multiplication when
signed multiplication is requested. While there is not a difference in
the *low* half of the result, the *high* half (used specifically to
implement the signed division by these constants) certainly is used. The
test case I've nuked was actively asserting wrong code.

There is a delightful solution to doing signed multiplication even when
we don't have it that Richard Smith has crafted, but I'll add the
machinery back and implement that in a follow-up patch. This at least
restores correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214007 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Add coverage for PMUL* instruction testing on SSE2 as well as
Chandler Carruth [Sat, 26 Jul 2014 01:11:10 +0000 (01:11 +0000)]
[x86] Add coverage for PMUL* instruction testing on SSE2 as well as
SSE4.1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214001 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Work around mislayering of MC / Object.
Richard Smith [Sat, 26 Jul 2014 01:10:32 +0000 (01:10 +0000)]
[modules] Work around mislayering of MC / Object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214000 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate X86/Utils/LLVMBuild.txt corresponding to r213986. "Core" has been introduced.
NAKAMURA Takumi [Sat, 26 Jul 2014 00:45:43 +0000 (00:45 +0000)]
Update X86/Utils/LLVMBuild.txt corresponding to r213986. "Core" has been introduced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213995 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR/UseTest.cpp: Avoid std::to_string() to appease mingw32 bot.
NAKAMURA Takumi [Sat, 26 Jul 2014 00:45:30 +0000 (00:45 +0000)]
IR/UseTest.cpp: Avoid std::to_string() to appease mingw32 bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213994 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] More cleanup for this test -- simplify the command line.
Chandler Carruth [Sat, 26 Jul 2014 00:21:52 +0000 (00:21 +0000)]
[x86] More cleanup for this test -- simplify the command line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213991 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Fix unused variable warning in no-asserts build.
Chandler Carruth [Sat, 26 Jul 2014 00:04:41 +0000 (00:04 +0000)]
[x86] Fix unused variable warning in no-asserts build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213989 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] FileCheck-ize this test.
Chandler Carruth [Fri, 25 Jul 2014 23:59:20 +0000 (23:59 +0000)]
[x86] FileCheck-ize this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213988 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Teach the X86 backend to print shuffle comments for PSHUFB
Chandler Carruth [Fri, 25 Jul 2014 23:47:11 +0000 (23:47 +0000)]
[x86] Teach the X86 backend to print shuffle comments for PSHUFB
instructions which happen to have a constant mask.

Currently, this only handles a very narrow set of cases, but those
happen to be the cases that I care about for testing shuffles sanely.
This is a bit trickier than other shuffle instructions because we're
decoding constants out of the constant pool. The current MC layer makes
it completely impossible to inspect a constant pool entry, so we have to
do it at the MI level and attach the comment to the streamer on its way
out. So no joy for disassembling, but it does make test cases and asm
dumps *much* nicer.

Sorry for no test cases, but it didn't really seem that valuable to go
trolling through existing old test cases and updating them. I'll have
lots of testing of this in the upcoming patch for SSSE3 emission in the
new vector shuffle lowering code paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213986 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Allow partial unrolling and increase thresholds.
Matt Arsenault [Fri, 25 Jul 2014 23:02:42 +0000 (23:02 +0000)]
R600/SI: Allow partial unrolling and increase thresholds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213985 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove R600 subtarget dependent variables onto the subtarget.
Eric Christopher [Fri, 25 Jul 2014 22:22:39 +0000 (22:22 +0000)]
Move R600 subtarget dependent variables onto the subtarget.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213982 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agocoverage: remove empty mapping regions
Alex Lorenz [Fri, 25 Jul 2014 22:22:24 +0000 (22:22 +0000)]
coverage: remove empty mapping regions

This patch removes the empty coverage mapping regions.
Those regions were produced by clang's old mapping region generation
algorithm, but the new algorithm doesn't generate them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213981 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCanonicalization for @llvm.assume
Hal Finkel [Fri, 25 Jul 2014 21:45:17 +0000 (21:45 +0000)]
Canonicalization for @llvm.assume

Adds simple logical canonicalization of assumption intrinsics to instcombine,
currently:
 - invariant(a && b) -> invariant(a); invariant(b)
 - invariant(!(a || b)) -> invariant(!a); invariant(!b)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213977 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns, no behavior change.
Nico Weber [Fri, 25 Jul 2014 21:37:41 +0000 (21:37 +0000)]
Wrap to 80 columns, no behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213975 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-uselistorder: Fix up LINK_COMPONENTS.
NAKAMURA Takumi [Fri, 25 Jul 2014 21:33:18 +0000 (21:33 +0000)]
llvm-uselistorder: Fix up LINK_COMPONENTS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213974 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd @llvm.assume, lowering, and some basic properties
Hal Finkel [Fri, 25 Jul 2014 21:13:35 +0000 (21:13 +0000)]
Add @llvm.assume, lowering, and some basic properties

This is the first commit in a series that add an @llvm.assume intrinsic which
can be used to provide the optimizer with a condition it may assume to be true
(when the control flow would hit the intrinsic call). Some basic properties are added here:

 - llvm.invariant(true) is dead.
 - llvm.invariant(false) is unreachable (this directly corresponds to the
   documented behavior of MSVC's __assume(0)), so is llvm.invariant(undef).

The intrinsic is tagged as writing arbitrarily, in order to maintain control
dependencies. BasicAA has been updated, however, to return NoModRef for any
particular location-based query so that we don't unnecessarily block code
motion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213973 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[stack protector] Add test cases for thumb and thumb2.
Akira Hatanaka [Fri, 25 Jul 2014 19:47:46 +0000 (19:47 +0000)]
[stack protector] Add test cases for thumb and thumb2.

<rdar://problem/12475629>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213970 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[stack protector] Fix a potential security bug in stack protector where the
Akira Hatanaka [Fri, 25 Jul 2014 19:31:34 +0000 (19:31 +0000)]
[stack protector] Fix a potential security bug in stack protector where the
address of the stack guard was being spilled to the stack.

Previously the address of the stack guard would get spilled to the stack if it
was impossible to keep it in a register. This patch introduces a new target
independent node and pseudo instruction which gets expanded post-RA to a
sequence of instructions that load the stack guard value. Register allocator
can now just remat the value when it can't keep it in a register.

<rdar://problem/12475629>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213967 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix arc4random detection.
Brad Smith [Fri, 25 Jul 2014 19:28:44 +0000 (19:28 +0000)]
Fix arc4random detection.

Patch by Pascal Stumpf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213966 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove dead code.
Rafael Espindola [Fri, 25 Jul 2014 19:06:39 +0000 (19:06 +0000)]
Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213963 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Support TLS on PPC32/ELF
Hal Finkel [Fri, 25 Jul 2014 17:47:22 +0000 (17:47 +0000)]
[PowerPC] Support TLS on PPC32/ELF

Patch by Justin Hibbits!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213960 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[FastISel][AArch64] Add support for frameaddress intrinsic.
Juergen Ributzka [Fri, 25 Jul 2014 17:47:14 +0000 (17:47 +0000)]
[FastISel][AArch64] Add support for frameaddress intrinsic.

This commit implements the frameaddress intrinsic for the AArch64 architecture
in FastISel.

There were two test cases that pretty much tested the same, so I combined them
to a single test case.

Fixes <rdar://problem/17811834>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213959 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove -verify-use-list-order into llvm-uselistorder
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 17:13:03 +0000 (17:13 +0000)]
Move -verify-use-list-order into llvm-uselistorder

Ugh.  Turns out not even transformation passes link in how to read IR.
I sincerely believe the buildbots will finally agree with my system
after this though.  (I don't really understand why all of this has been
working on my system, but not on all the buildbots.)

Create a new tool called llvm-uselistorder to use for verifying use-list
order.  For now, just dump everything from the (now defunct)
-verify-use-list-order pass into the tool.

This might be a better way to test use-list order anyway.

Part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213957 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReapply "DebugInfo: Don't put fission type units in comdat sections."
David Blaikie [Fri, 25 Jul 2014 17:11:58 +0000 (17:11 +0000)]
Reapply "DebugInfo: Don't put fission type units in comdat sections."

This recommits r208930, r208933, and r208975 (by reverting r209338) and
reverts r209529 (the FIXME to readd this functionality once the tools
were fixed) now that DWP has been fixed to cope with a single section
for all fission type units.

Original commit message:

"Since type units in the dwo file are handled by a debug aware tool,
they don't need to leverage the ELF comdat grouping to implement
deduplication. Avoid creating all the .group sections for these as a
space optimization."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213956 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoClaim AA generally as code owner
Hal Finkel [Fri, 25 Jul 2014 16:45:10 +0000 (16:45 +0000)]
Claim AA generally as code owner

As per nominations from Chandler and Arnold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213955 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix MSVC2012 build error in UseListOrder.cpp
Hans Wennborg [Fri, 25 Jul 2014 16:22:13 +0000 (16:22 +0000)]
Fix MSVC2012 build error in UseListOrder.cpp

I think the compiler got confused by the nested DEBUG macros.
It was failing with:

  UseListOrder.cpp(80) : error C2059: syntax error : '}'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213954 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBitcode: Don't optimize constants when preserving use-list order
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 16:13:16 +0000 (16:13 +0000)]
Bitcode: Don't optimize constants when preserving use-list order

`ValueEnumerator::OptimizeConstants()` creates forward references within
the constant pools, which makes predicting constants' use-list order
difficult.  For now, just disable the optimization.

This can be re-enabled in the future in one of two ways:

  - Enable a limited version of this optimization that doesn't create
    forward references.  One idea is to categorize constants by their
    "height" and make that the top-level sort.

  - Enable it entirely.  This requires predicting how may times each
    constant will be recreated as its operands' and operands' operands'
    (etc.) forward references get resolved.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213953 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions...
David Blaikie [Fri, 25 Jul 2014 16:10:16 +0000 (16:10 +0000)]
Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.

Reverted by Eric Christopher (Thanks!) in r212203 after Bob Wilson
reported LTO issues. Duncan Exon Smith and Aditya Nandakumar helped
provide a reduced reproduction, though the failure wasn't too hard to
guess, and even easier with the example to confirm.

The assertion that the subprogram metadata associated with an
llvm::Function matches the scope data referenced by the DbgLocs on the
instructions in that function is not valid under LTO. In LTO, a C++
inline function might exist in multiple CUs and the subprogram metadata
nodes will refer to the same llvm::Function. In this case, depending on
the order of the CUs, the first intance of the subprogram metadata may
not be the one referenced by the instructions in that function and the
assertion will fail.

A test case (test/DebugInfo/cross-cu-linkonce-distinct.ll) is added, the
assertion removed and a comment added to explain this situation.

This was then reverted again in r213581 as it caused PR20367. The root
cause of this was the early exit in LiveDebugVariables meant that
spurious DBG_VALUE intrinsics that referenced dead variables were not
removed, causing an assertion/crash later on. The fix is to have
LiveDebugVariables strip all DBG_VALUE intrinsics in functions without
debug info as they're not needed anyway. Test case added to cover this
situation (that occurs when a debug-having function is inlined into a
nodebug function) in test/DebugInfo/X86/nodebug_with_debug_loc.ll

Original commit message:

If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.

While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.

Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.

Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213952 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Fix up some test cases to have more correct debug info metadata.
David Blaikie [Fri, 25 Jul 2014 16:05:18 +0000 (16:05 +0000)]
DebugInfo: Fix up some test cases to have more correct debug info metadata.

* Add CUs to the named CU node
* Add missing DW_TAG_subprogram nodes
* Add llvm::Functions to the DW_TAG_subprogram nodes

This cleans up the tests so that they don't break under a
soon-to-be-made change that is more strict about such things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213951 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd code owner of scoped-noalias metadata
Hal Finkel [Fri, 25 Jul 2014 15:54:55 +0000 (15:54 +0000)]
Add code owner of scoped-noalias metadata

Add myself as the code owner for the scoped-noalias metadata I've developed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213950 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoConvert noalias parameter attributes into noalias metadata during inlining
Hal Finkel [Fri, 25 Jul 2014 15:50:08 +0000 (15:50 +0000)]
Convert noalias parameter attributes into noalias metadata during inlining

This functionality is currently turned off by default.

Part of the motivation for introducing scoped-noalias metadata is to enable the
preservation of noalias parameter attribute information after inlining.
Sometimes this can be inferred from the code in the caller after inlining, but
often we simply lose valuable information.

The overall process if fairly simple:
 1. Create a new unqiue scope domain.
 2. For each (used) noalias parameter, create a new alias scope.
 3. For each pointer, collect the underlying objects. Add a noalias scope for
    each noalias parameter from which we're not derived (and has not been
    captured prior to that point).
 4. Add an alias.scope for each noalias parameter from which we might be
    derived (or has been captured before that point).

Note that the capture checks apply only if one of the underlying objects is not
an identified function-local object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213949 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify and improve scoped-noalias metadata semantics
Hal Finkel [Fri, 25 Jul 2014 15:50:02 +0000 (15:50 +0000)]
Simplify and improve scoped-noalias metadata semantics

In the process of fixing the noalias parameter -> metadata conversion process
that will take place during inlining (which will be committed soon, but not
turned on by default), I have come to realize that the semantics provided by
yesterday's commit are not really what we want. Here's why:

void foo(noalias a, noalias b, noalias c, bool x) {
  *q = x ? a : b;
  *c = *q;
}

Generically, we know that *c does not alias with *a and with *b (so there is an
'and' in what we know we're not), and we know that *q might be derived from *a
or from *b (so there is an 'or' in what we know that we are). So we do not want
the semantics currently, where any noalias scope matching any alias.scope
causes a NoAlias return. What we want to know is that the noalias scopes form a
superset of the alias.scope list (meaning that all the things we know we're not
is a superset of all of things the other instruction might be).

Making that change, however, introduces a composibility problem. If we inline
once, adding the noalias metadata, and then inline again adding more, and we
append new scopes onto the noalias and alias.scope lists each time. But, this
means that we could change what was a NoAlias result previously into a MayAlias
result because we appended an additional scope onto one of the alias.scope
lists. So, instead of giving scopes the ability to have parents (which I had
borrowed from the TBAA implementation, but seems increasingly unlikely to be
useful in practice), I've given them domains. The subset/superset condition now
applies within each domain independently, and we only need it to hold in one
domain. Each time we inline, we add the new scopes in a new scope domain, and
everything now composes nicely. In addition, this simplifies the
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213948 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to fix a layering violation introduced by r213945
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 15:41:49 +0000 (15:41 +0000)]
Try to fix a layering violation introduced by r213945

The dragonegg buildbot (and others?) started failing after
r213945/r213946 because `llvm-as` wasn't linking in the bitcode reader.
I think moving the verify functions to the same file as the verify pass
should fix the build.  Adding a command-line option for maintaining
use-list order in assembly as a drive-by to prevent warnings about
unused static functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213947 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix -Werror build after r213945
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 15:00:02 +0000 (15:00 +0000)]
Fix -Werror build after r213945

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213946 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIPO: Add use-list-order verifier
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 14:49:26 +0000 (14:49 +0000)]
IPO: Add use-list-order verifier

Add a -verify-use-list-order pass, which shuffles use-list order, writes
to bitcode, reads back, and verifies that the (shuffled) order matches.

  - The utility functions live in lib/IR/UseListOrder.cpp.

  - Moved (and renamed) the command-line option to enable writing
    use-lists, so that this pass can return early if the use-list orders
    aren't being serialized.

It's not clear that this pass is the right direction long-term (perhaps
a separate tool instead?), but short-term it's a great way to test the
use-list order prototype.  I've added an XFAIL-ed testcase that I'm
hoping to get working pretty quickly.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213945 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Emit ABI_PCS_R9_use build attribute.
Amara Emerson [Fri, 25 Jul 2014 14:03:14 +0000 (14:03 +0000)]
[ARM] Emit ABI_PCS_R9_use build attribute.

Patch by Ben Foster!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213944 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRun sort_includes.py on the AArch64 backend.
Benjamin Kramer [Fri, 25 Jul 2014 11:42:14 +0000 (11:42 +0000)]
Run sort_includes.py on the AArch64 backend.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213938 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[cmake] Use the external project machinery for libcxxabi so that it can
Chandler Carruth [Fri, 25 Jul 2014 10:27:40 +0000 (10:27 +0000)]
[cmake] Use the external project machinery for libcxxabi so that it can
be disabled in CMake or relocated if desired.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213936 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm/test/CodeGen/ARM/inlineasm-global.ll: Add explicit triple to appease targeting...
NAKAMURA Takumi [Fri, 25 Jul 2014 09:55:01 +0000 (09:55 +0000)]
llvm/test/CodeGen/ARM/inlineasm-global.ll: Add explicit triple to appease targeting *-win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213933 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm/test/CodeGen/ARM/inlineasm-global.ll: Avoid specifing source file on llc.
NAKAMURA Takumi [Fri, 25 Jul 2014 09:54:49 +0000 (09:54 +0000)]
llvm/test/CodeGen/ARM/inlineasm-global.ll: Avoid specifing source file on llc.

It sometimes confuses FileCheck. Consider the case that path contains 'stmib'. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213932 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] Enable the new assert for out-of-range result numbers in
Chandler Carruth [Fri, 25 Jul 2014 09:19:23 +0000 (09:19 +0000)]
[SDAG] Enable the new assert for out-of-range result numbers in
SDValues, fixing the two bugs left in the regression suite.

The key for both of these was the use a single value type rather than
a VTList which caused an unintentionally single-result merge-value node.
Fix this by getting the appropriate VTList in place.

Doing this exposed that the comments in x86's code abouth how MUL_LOHI
operands are handle is wrong. The bug with the use of out-of-range
result numbers was hiding the bug about the order of operands here (as
best i can tell). There are more places where the code appears to get
this backwards still...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213931 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] Don't insert the VRBase into a mapping from SDValues when the def
Chandler Carruth [Fri, 25 Jul 2014 09:19:18 +0000 (09:19 +0000)]
[SDAG] Don't insert the VRBase into a mapping from SDValues when the def
doesn't actually correspond to an SDValue at all. Fixes most of the
remaining asserts on out-of-range SDValue result numbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213930 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoStore nodes only have 1 result.
Matt Arsenault [Fri, 25 Jul 2014 07:56:42 +0000 (07:56 +0000)]
Store nodes only have 1 result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213928 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] Start plumbing an assert into SDValues that we don't form one
Chandler Carruth [Fri, 25 Jul 2014 07:23:23 +0000 (07:23 +0000)]
[SDAG] Start plumbing an assert into SDValues that we don't form one
with a result number outside the range of results for the node.

I don't know how we managed to not really check this very basic
invariant for so long, but the code is *very* broken at this point.
I have over 270 test failures with the assert enabled. I'm committing it
disabled so that others can join in the cleanup effort and reproduce the
issues. I've also included one of the obvious fixes that I already
found. More fixes to come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213926 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] In thumb mode, emit directive ".code 16" before file level inline
Akira Hatanaka [Fri, 25 Jul 2014 05:12:49 +0000 (05:12 +0000)]
[ARM] In thumb mode, emit directive ".code 16" before file level inline
assembly instructions.

This is necessary to ensure ARM assembler switches to Thumb mode before it
starts assembling the file level inline assembly instructions at the beginning
of a .s file.

<rdar://problem/17757232>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213924 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add comments to clarify some non-obvious lines in the stackmap-nops.ll
Lang Hames [Fri, 25 Jul 2014 04:50:08 +0000 (04:50 +0000)]
[X86] Add comments to clarify some non-obvious lines in the stackmap-nops.ll
testcases.

Based on code review from Philip Reames. Thanks Philip!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213923 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-vtabledump: use a std::map instead of a StringMap for VBTables
David Majnemer [Fri, 25 Jul 2014 04:30:11 +0000 (04:30 +0000)]
llvm-vtabledump: use a std::map instead of a StringMap for VBTables

StringMap doesn't guarantee any particular iteration order,
this is suboptimal when comparing llvm-vtabledump's output for two
object files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213921 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a warning in CoverageMappingReader.cpp
Ehsan Akhgari [Fri, 25 Jul 2014 02:51:57 +0000 (02:51 +0000)]
Fix a warning in CoverageMappingReader.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213920 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Clarify some stackmap shadow optimization code as based on review
Lang Hames [Fri, 25 Jul 2014 02:29:19 +0000 (02:29 +0000)]
[X86] Clarify some stackmap shadow optimization code as based on review
feedback from Eric Christopher.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213917 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PATCH][PPC64LE] Correct little-endian usage of vmrgh* and vmrgl*.
Bill Schmidt [Fri, 25 Jul 2014 01:55:55 +0000 (01:55 +0000)]
[PATCH][PPC64LE] Correct little-endian usage of vmrgh* and vmrgl*.

Because the PowerPC vmrgh* and vmrgl* instructions have a built-in
big-endian bias, it is necessary to swap their inputs in little-endian
mode when using them to implement a vector shuffle.  This was
previously missed in the vector LE implementation.

There was already logic to distinguish between unary and "normal"
vmrg* vector shuffles, so this patch extends that logic to use a third
option:  "swapped" vmrg* vector shuffles that are used for little
endian in place of the "normal" ones.

I've updated the vec-shuffle-le.ll test to check for the expected
register ordering on the generated instructions.

This bug was discovered when testing the LE and ELFv2 patches for
safety if they were backported to 3.4.  A different vectorization
decision was made in 3.4 than on mainline trunk, and that exposed the
problem.  I've verified this fix takes care of that issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213915 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd code coverage mapping data, reader, and writer.
Alex Lorenz [Thu, 24 Jul 2014 23:57:54 +0000 (23:57 +0000)]
Add code coverage mapping data, reader, and writer.

This patch implements the data structures, the reader and
the writers for the new code coverage mapping system.
The new code coverage mapping system uses the instrumentation
based profiling to provide code coverage analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213910 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd code coverage mapping data, reader, and writer.
Alex Lorenz [Thu, 24 Jul 2014 23:55:56 +0000 (23:55 +0000)]
Add code coverage mapping data, reader, and writer.

This patch implements the data structures, the reader and
the writers for the new code coverage mapping system.
The new code coverage mapping system uses the instrumentation
based profiling to provide code coverage analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213909 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd an implementation for llvm-nm’s -print-file-name option (aka -o and -A).
Kevin Enderby [Thu, 24 Jul 2014 23:31:52 +0000 (23:31 +0000)]
Add an implementation for llvm-nm’s -print-file-name option (aka -o and -A).

The -print-file-name option in llvm-nm is to precede each symbol
with the object file it came from.  While code for the parsing of this
option and its aliases existed there was no code to implement it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213906 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOpportunistically fix the builders
David Majnemer [Thu, 24 Jul 2014 23:26:54 +0000 (23:26 +0000)]
Opportunistically fix the builders

A builder complained that it couldn't find llvm-vtabledump, this is
probably because it wasn't a dependency of the 'test' target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213905 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-vtabledump: A vtable dumper
David Majnemer [Thu, 24 Jul 2014 23:14:40 +0000 (23:14 +0000)]
llvm-vtabledump: A vtable dumper

This tool's job is to dump the vtables inside object files.  It is
currently limited to MS ABI vf- and vb-tables but it will eventually
support Itanium-style v-tables as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213903 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAfter unrolling a loop with llvm.loop.unroll.count metadata (unroll factor
Mark Heffernan [Thu, 24 Jul 2014 22:36:40 +0000 (22:36 +0000)]
After unrolling a loop with llvm.loop.unroll.count metadata (unroll factor
hint) the loop unroller replaces the llvm.loop.unroll.count metadata with
llvm.loop.unroll.disable metadata to prevent any subsequent unrolling
passes from unrolling more than the hint indicates.  This patch fixes
an issue where loop unrolling could be disabled for other loops as well which
share the same llvm.loop metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213900 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't use 128bit functions on PPC32.
Joerg Sonnenberger [Thu, 24 Jul 2014 22:20:10 +0000 (22:20 +0000)]
Don't use 128bit functions on PPC32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213899 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SDAG] Introduce a combined set to the DAG combiner which tracks nodes
Chandler Carruth [Thu, 24 Jul 2014 22:15:28 +0000 (22:15 +0000)]
[SDAG] Introduce a combined set to the DAG combiner which tracks nodes
which have successfully round-tripped through the combine phase, and use
this to ensure all operands to DAG nodes are visited by the combiner,
even if they are only added during the combine phase.

This is critical to have the combiner reach nodes that are *introduced*
during combining. Previously these would sometimes be visited and
sometimes not be visited based on whether they happened to end up on the
worklist or not. Now we always run them through the combiner.

This fixes quite a few bad codegen test cases lurking in the suite while
also being more principled. Among these, the TLS codegeneration is
particularly exciting for programs that have this in the critical path
like TSan-instrumented binaries (although I think they engineer to use
a different TLS that is faster anyways).

I've tried to check for compile-time regressions here by running llc
over a merged (but not LTO-ed) clang bitcode file and observed at most
a 3% slowdown in llc. Given that this is essentially a worst case (none
of opt or clang are running at this phase) I think this is tolerable.
The actual LTO case should be even less costly, and the cost in normal
compilation should be negligible.

With this combining logic, it is possible to re-legalize as we combine
which is necessary to implement PSHUFB formation on x86 as
a post-legalize DAG combine (my ultimate goal).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213898 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Make vector legalization of extloads work more like the "normal"
Chandler Carruth [Thu, 24 Jul 2014 22:09:56 +0000 (22:09 +0000)]
[x86] Make vector legalization of extloads work more like the "normal"
vector operation legalization with support for custom target lowering
and fallback to expand when it fails, and use this to implement sext and
anyext load lowering for x86 in a more principled way.

Previously, the x86 backend relied on a target DAG combine to "combine
away" sextload and extload nodes prior to legalization, or would expand
them during legalization with terrible code. This is particularly
problematic because the DAG combine relies on running over non-canonical
DAG nodes at just the right time to match several common and important
patterns. It used a combine rather than lowering because we didn't have
good lowering support, and to expose some tricks being employed to more
combine phases.

With this change it becomes a proper lowering operation, the backend
marks that it can lower these nodes, and I've added support for handling
the canonical forms that don't have direct legal representations such as
sextload of a v4i8 -> v4i64 on AVX1. With this change, our test cases
for this behavior continue to pass even after the DAG combiner beigns
running more systematically over every node.

There is some noise caused by this in the test suite where we actually
use vector extends instead of subregister extraction. This doesn't
really seem like the right thing to do, but is unlikely to be a critical
regression. We do regress in one case where by lowering to the
target-specific patterns early we were able to combine away extraneous
legal math nodes. However, this regression is completely addressed by
switching to a widening based legalization which is what I'm working
toward anyways, so I've just switched the test to that mode.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213897 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTarget: invert condition for Windows
Saleem Abdulrasool [Thu, 24 Jul 2014 22:09:06 +0000 (22:09 +0000)]
Target: invert condition for Windows

The Microsoft ABI and MSVCRT are considered the canonical C runtime and ABI.
The long double routines are not part of this environment.  However, cygwin and
MinGW both provide supplementary implementations.  Change the condition to
reflect this reality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213896 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFeedback from Hans on r213815. No functionaility change.
Manman Ren [Thu, 24 Jul 2014 21:13:20 +0000 (21:13 +0000)]
Feedback from Hans on r213815. No functionaility change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213895 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWindows: Don't wildcard expand /? or -?
Hans Wennborg [Thu, 24 Jul 2014 21:09:45 +0000 (21:09 +0000)]
Windows: Don't wildcard expand /? or -?

Even if there's a file called c:\a, we want /? to be preserved as
an option, not expanded to a filename.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213894 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Optimize stackmap shadows on X86.
Lang Hames [Thu, 24 Jul 2014 20:40:55 +0000 (20:40 +0000)]
[X86] Optimize stackmap shadows on X86.

This patch minimizes the number of nops that must be emitted on X86 to satisfy
stackmap shadow constraints.

To minimize the number of nops inserted, the X86AsmPrinter now records the
size of the most recent stackmap's shadow in the StackMapShadowTracker class,
and tracks the number of instruction bytes emitted since the that stackmap
instruction was encountered. Padding is emitted (if it is required at all)
immediately before the next stackmap/patchpoint instruction, or at the end of
the basic block.

This optimization should reduce code-size and improve performance for people
using the llvm stackmap intrinsic on X86.

<rdar://problem/14959522>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213892 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace an assertion with a fatal error
Reid Kleckner [Thu, 24 Jul 2014 19:53:33 +0000 (19:53 +0000)]
Replace an assertion with a fatal error

Frontends are responsible for putting inalloca on parameters that would
be passed in memory and not registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213891 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse the same .eh_frame encoding for 32bit PPC as on i386.
Joerg Sonnenberger [Thu, 24 Jul 2014 19:25:16 +0000 (19:25 +0000)]
Use the same .eh_frame encoding for 32bit PPC as on i386.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213890 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to fix the bots again by moving test to X86 directory.
Manman Ren [Thu, 24 Jul 2014 17:57:09 +0000 (17:57 +0000)]
Try to fix the bots again by moving test to X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213884 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoX86: correct library call setup for Windows itanium
Saleem Abdulrasool [Thu, 24 Jul 2014 17:46:36 +0000 (17:46 +0000)]
X86: correct library call setup for Windows itanium

This target is identical to the Windows MSVC (and follows Microsoft ABI for C).
Correct the library call setup for this target.  The same set of library calls
are missing on this environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213883 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Add FMA instructions for Evergreen
Matt Arsenault [Thu, 24 Jul 2014 17:41:01 +0000 (17:41 +0000)]
R600: Add FMA instructions for Evergreen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213882 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to fix the bots. If this does not work, I am going to move it to X86 directory.
Manman Ren [Thu, 24 Jul 2014 17:18:33 +0000 (17:18 +0000)]
Try to fix the bots. If this does not work, I am going to move it to X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213880 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoX86: silence sign comparison warning
Saleem Abdulrasool [Thu, 24 Jul 2014 17:12:06 +0000 (17:12 +0000)]
X86: silence sign comparison warning

GCC 4.8 detected a signed compare [-Wsign-compare].  Add a cast for the
destination index.  Add an assert to catch a potential overflow however unlikely
it may be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213878 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Add new functions for splitting vector loads and stores.
Matt Arsenault [Thu, 24 Jul 2014 17:10:35 +0000 (17:10 +0000)]
R600: Add new functions for splitting vector loads and stores.

These will be used in future patches and shouldn't change anything yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213877 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLet the integrated assembler understand .exitm, PR20426.
Nico Weber [Thu, 24 Jul 2014 17:08:39 +0000 (17:08 +0000)]
Let the integrated assembler understand .exitm, PR20426.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213876 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused field MacroInstantiation::TheMacro. No behavior change.
Nico Weber [Thu, 24 Jul 2014 16:29:04 +0000 (16:29 +0000)]
Remove unused field MacroInstantiation::TheMacro. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213874 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLet the integrated assembler understand .warning, PR20428.
Nico Weber [Thu, 24 Jul 2014 16:26:06 +0000 (16:26 +0000)]
Let the integrated assembler understand .warning, PR20428.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213873 91177308-0d34-0410-b5e6-96231b3b80d8