oota-llvm.git
9 years agoSpelling correction
Sid Manning [Mon, 8 Sep 2014 13:05:23 +0000 (13:05 +0000)]
Spelling correction

Another trivial spelling change.

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

9 years agoAdd a comment to getNewAlignmentDiff.
Andrew Trick [Sun, 7 Sep 2014 23:16:24 +0000 (23:16 +0000)]
Add a comment to getNewAlignmentDiff.

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

9 years agoMake use @llvm.assume for loop guards in ScalarEvolution
Hal Finkel [Sun, 7 Sep 2014 21:37:59 +0000 (21:37 +0000)]
Make use @llvm.assume for loop guards in ScalarEvolution

This adds a basic (but important) use of @llvm.assume calls in ScalarEvolution.
When SE is attempting to validate a condition guarding a loop (such as whether
or not the loop count can be zero), this check should also include dominating
assumptions.

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

9 years agoCheck for all known bits on ret in InstCombine
Hal Finkel [Sun, 7 Sep 2014 21:28:34 +0000 (21:28 +0000)]
Check for all known bits on ret in InstCombine

From a combination of @llvm.assume calls (and perhaps through other means, such
as range metadata), it is possible that all bits of a return value might be
known. Previously, InstCombine did not check for this (which is understandable
given assumptions of constant propagation), but means that we'd miss simple
cases where assumptions are involved.

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

9 years agoMake use of @llvm.assume from LazyValueInfo
Hal Finkel [Sun, 7 Sep 2014 20:29:59 +0000 (20:29 +0000)]
Make use of @llvm.assume from LazyValueInfo

This change teaches LazyValueInfo to use the @llvm.assume intrinsic. Like with
the known-bits change (r217342), this requires feeding a "context" instruction
pointer through many functions. Aside from a little refactoring to reuse the
logic that turns predicates into constant ranges in LVI, the only new code is
that which can 'merge' the range from an assumption into that otherwise
computed. There is also a small addition to JumpThreading so that it can have
LVI use assumptions in the same block as the comparison feeding a conditional
branch.

With this patch, we can now simplify this as expected:
int foo(int a) {
  __builtin_assume(a > 5);
  if (a > 3) {
    bar();
    return 1;
  }
  return 0;
}

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

9 years agoAdd an AlignmentFromAssumptions Pass
Hal Finkel [Sun, 7 Sep 2014 20:05:11 +0000 (20:05 +0000)]
Add an AlignmentFromAssumptions Pass

This adds a ScalarEvolution-powered transformation that updates load, store and
memory intrinsic pointer alignments based on invariant((a+q) & b == 0)
expressions. Many of the simple cases we can get with ValueTracking, but we
still need something like this for the more complicated cases (such as those
with an offset) that require some algebra. Note that gcc's
__builtin_assume_aligned's optional third argument provides exactly for this
kind of 'misalignment' offset for which this kind of logic is necessary.

The primary motivation is to fixup alignments for vector loads/stores after
vectorization (and unrolling). This pass is added to the optimization pipeline
just after the SLP vectorizer runs (which, admittedly, does not preserve SE,
although I imagine it could).  Regardless, I actually don't think that the
preservation matters too much in this case: SE computes lazily, and this pass
won't issue any SE queries unless there are any assume intrinsics, so there
should be no real additional cost in the common case (SLP does preserve DT and
LoopInfo).

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

9 years agoAdd additional patterns for @llvm.assume in ValueTracking
Hal Finkel [Sun, 7 Sep 2014 19:21:07 +0000 (19:21 +0000)]
Add additional patterns for @llvm.assume in ValueTracking

This builds on r217342, which added the infrastructure to compute known bits
using assumptions (@llvm.assume calls). That original commit added only a few
patterns (to catch common cases related to determining pointer alignment); this
change adds several other patterns for simple cases.

r217342 contained that, for assume(v & b = a), bits in the mask
that are known to be one, we can propagate known bits from the a to v. It also
had a known-bits transfer for assume(a = b). This patch adds:

assume(~(v & b) = a) : For those bits in the mask that are known to be one, we
                       can propagate inverted known bits from the a to v.

assume(v | b = a) :    For those bits in b that are known to be zero, we can
                       propagate known bits from the a to v.

assume(~(v | b) = a):  For those bits in b that are known to be zero, we can
                       propagate inverted known bits from the a to v.

assume(v ^ b = a) :    For those bits in b that are known to be zero, we can
       propagate known bits from the a to v. For those bits in
       b that are known to be one, we can propagate inverted
                       known bits from the a to v.

assume(~(v ^ b) = a) : For those bits in b that are known to be zero, we can
       propagate inverted known bits from the a to v. For those
       bits in b that are known to be one, we can propagate
                       known bits from the a to v.

assume(v << c = a) :   For those bits in a that are known, we can propagate them
                       to known bits in v shifted to the right by c.

assume(~(v << c) = a) : For those bits in a that are known, we can propagate
                        them inverted to known bits in v shifted to the right by c.

assume(v >> c = a) :   For those bits in a that are known, we can propagate them
                       to known bits in v shifted to the right by c.

assume(~(v >> c) = a) : For those bits in a that are known, we can propagate
                        them inverted to known bits in v shifted to the right by c.

assume(v >=_s c) where c is non-negative: The sign bit of v is zero

assume(v >_s c) where c is at least -1: The sign bit of v is zero

assume(v <=_s c) where c is negative: The sign bit of v is one

assume(v <_s c) where c is non-positive: The sign bit of v is one

assume(v <=_u c): Transfer the known high zero bits

assume(v <_u c): Transfer the known high zero bits (if c is know to be a power
                 of 2, transfer one more)

A small addition to InstCombine was necessary for some of the test cases. The
problem is that when InstCombine was simplifying and, or, etc. it would fail to
check the 'do I know all of the bits' condition before checking less specific
conditions and would not fully constant-fold the result. I'm not sure how to
trigger this aside from using assumptions, so I've just included the change
here.

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

9 years agoMake use of @llvm.assume in ValueTracking (computeKnownBits, etc.)
Hal Finkel [Sun, 7 Sep 2014 18:57:58 +0000 (18:57 +0000)]
Make use of @llvm.assume in ValueTracking (computeKnownBits, etc.)

This change, which allows @llvm.assume to be used from within computeKnownBits
(and other associated functions in ValueTracking), adds some (optional)
parameters to computeKnownBits and friends. These functions now (optionally)
take a "context" instruction pointer, an AssumptionTracker pointer, and also a
DomTree pointer, and most of the changes are just to pass this new information
when it is easily available from InstSimplify, InstCombine, etc.

As explained below, the significant conceptual change is that known properties
of a value might depend on the control-flow location of the use (because we
care that the @llvm.assume dominates the use because assumptions have
control-flow dependencies). This means that, when we ask if bits are known in a
value, we might get different answers for different uses.

The significant changes are all in ValueTracking. Two main changes: First, as
with the rest of the code, new parameters need to be passed around. To make
this easier, I grouped them into a structure, and I made internal static
versions of the relevant functions that take this structure as a parameter. The
new code does as you might expect, it looks for @llvm.assume calls that make
use of the value we're trying to learn something about (often indirectly),
attempts to pattern match that expression, and uses the result if successful.
By making use of the AssumptionTracker, the process of finding @llvm.assume
calls is not expensive.

Part of the structure being passed around inside ValueTracking is a set of
already-considered @llvm.assume calls. This is to prevent a query using, for
example, the assume(a == b), to recurse on itself. The context and DT params
are used to find applicable assumptions. An assumption needs to dominate the
context instruction, or come after it deterministically. In this latter case we
only handle the specific case where both the assumption and the context
instruction are in the same block, and we need to exclude assumptions from
being used to simplify their own ephemeral values (those which contribute only
to the assumption) because otherwise the assumption would prove its feeding
comparison trivial and would be removed.

This commit adds the plumbing and the logic for a simple masked-bit propagation
(just enough to write a regression test). Future commits add more patterns
(and, correspondingly, more regression tests).

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

9 years agoDebugInfo: Do not use DW_FORM_GNU_addr_index in skeleton CUs, GDB 7.8 errors on this.
David Blaikie [Sun, 7 Sep 2014 17:31:42 +0000 (17:31 +0000)]
DebugInfo: Do not use DW_FORM_GNU_addr_index in skeleton CUs, GDB 7.8 errors on this.

It's probably not a huge deal to not do this - if we could, maybe the
address could be reused by a subprogram low_pc and avoid an extra
relocation, but it's just one per CU at best.

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

9 years agoAdd functions for finding ephemeral values
Hal Finkel [Sun, 7 Sep 2014 13:49:57 +0000 (13:49 +0000)]
Add functions for finding ephemeral values

This adds a set of utility functions for collecting 'ephemeral' values. These
are LLVM IR values that are used only by @llvm.assume intrinsics (directly or
indirectly), and thus will be removed prior to code generation, implying that
they should be considered free for certain purposes (like inlining). The
inliner's cost analysis, and a few other passes, have been updated to account
for ephemeral values using the provided functionality.

This functionality is important for the usability of @llvm.assume, because it
limits the "non-local" side-effects of adding llvm.assume on inlining, loop
unrolling, etc. (these are hints, and do not generate code, so they should not
directly contribute to estimates of execution cost).

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

9 years agoAdd an Assumption-Tracking Pass
Hal Finkel [Sun, 7 Sep 2014 12:44:26 +0000 (12:44 +0000)]
Add an Assumption-Tracking Pass

This adds an immutable pass, AssumptionTracker, which keeps a cache of
@llvm.assume call instructions within a module. It uses callback value handles
to keep stale functions and intrinsics out of the map, and it relies on any
code that creates new @llvm.assume calls to notify it of the new instructions.
The benefit is that code needing to find @llvm.assume intrinsics can do so
directly, without scanning the function, thus allowing the cost of @llvm.assume
handling to be negligible when none are present.

The current design is intended to be lightweight. We don't keep track of
anything until we need a list of assumptions in some function. The first time
this happens, we scan the function. After that, we add/remove @llvm.assume
calls from the cache in response to registration calls and ValueHandle
callbacks.

There are no new direct test cases for this pass, but because it calls it
validation function upon module finalization, we'll pick up detectable
inconsistencies from the other tests that touch @llvm.assume calls.

This pass will be used by follow-up commits that make use of @llvm.assume.

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

9 years ago[x86] Revert my over-eager commit in r217332.
Chandler Carruth [Sun, 7 Sep 2014 12:37:11 +0000 (12:37 +0000)]
[x86] Revert my over-eager commit in r217332.

I hadn't actually run all the tests yet and these combines have somewhat
surprisingly far reaching effects.

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

9 years ago[x86] Tweak the rules surrounding 0,0 and 1,1 v2f64 shuffles and add
Chandler Carruth [Sun, 7 Sep 2014 12:02:14 +0000 (12:02 +0000)]
[x86] Tweak the rules surrounding 0,0 and 1,1 v2f64 shuffles and add
support for MOVDDUP which is really important for matrix multiply style
operations that do lots of non-vector-aligned load and splats.

The original motivation was to add support for MOVDDUP as the lack of it
regresses matmul_f64_4x4 by 5% or so. However, all of the rules here
were somewhat suspicious.

First, we should always be using the floating point domain shuffles,
regardless of how many copies we have to make as a movapd is *crazy*
faster than the domain switching cost on some chips. (Mostly because
movapd is crazy cheap.) Because SHUFPD can't do the copy-for-free trick
of the PSHUF instructions, there is no need to avoid canonicalizing on
UNPCK variants, so do that canonicalizing. This also ensures we have the
chance to form MOVDDUP. =]

Second, we assume SSE2 support when doing any vector lowering, and given
that we should just use UNPCKLPD and UNPCKHPD as they can operate on
registers or memory. If vectors get spilled or come from memory at all
this is going to allow the load to be folded into the operation. If we
want to optimize for encoding size (the only difference, and only
a 2 byte difference) it should be done *much* later, likely after RA.

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

9 years agoTry to unflake AllocatorTest.TestAlignmentPastSlab
Hans Wennborg [Sun, 7 Sep 2014 05:14:29 +0000 (05:14 +0000)]
Try to unflake AllocatorTest.TestAlignmentPastSlab

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

9 years agoBumpPtrAllocator: do the size check without moving any pointers
Hans Wennborg [Sun, 7 Sep 2014 04:24:31 +0000 (04:24 +0000)]
BumpPtrAllocator: do the size check without moving any pointers

Instead of aligning and moving the CurPtr forward, and then comparing
with End, simply calculate how much space is needed, and compare that
to how much is available.

Hopefully this avoids any doubts about comparing addresses possibly
derived from past the end of the slab array, overflowing, etc.

Also add a test where aligning CurPtr would move it past End.

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

9 years ago[MCJIT] Revert partial RuntimeDyldELF cleanup that was prematurely committed in
Lang Hames [Sun, 7 Sep 2014 04:13:13 +0000 (04:13 +0000)]
[MCJIT] Revert partial RuntimeDyldELF cleanup that was prematurely committed in
r217328.

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

9 years ago[MCJIT] Rewrite RuntimeDyldMachO and its derived classes to use the 'Offset'
Lang Hames [Sun, 7 Sep 2014 04:03:32 +0000 (04:03 +0000)]
[MCJIT] Rewrite RuntimeDyldMachO and its derived classes to use the 'Offset'
field of RelocationValueRef, rather than the 'Addend' field.

This is consistent with RuntimeDyldELF's use of RelocationValueRef, and more
consistent with the semantics of the data being stored (the offset from the
start of a section or symbol).

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

9 years ago[MCJIT] Fix a bug RuntimeDyldImpl's read/writeBytesUnaligned methods.
Lang Hames [Sun, 7 Sep 2014 02:05:26 +0000 (02:05 +0000)]
[MCJIT] Fix a bug RuntimeDyldImpl's read/writeBytesUnaligned methods.

The previous implementation was writing to the high-bytes of integers on BE
targets (when run on LE hosts).

http://llvm.org/PR20640

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

9 years agoR600/SI: Fix register class for some 64-bit atomics
Matt Arsenault [Sun, 7 Sep 2014 00:46:20 +0000 (00:46 +0000)]
R600/SI: Fix register class for some 64-bit atomics

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

9 years agoR600/SI: Relax a few tests to help enable scheduler
Matt Arsenault [Sat, 6 Sep 2014 20:44:41 +0000 (20:44 +0000)]
R600/SI: Relax a few tests to help enable scheduler

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

9 years agoR600/SI: Fix broken check lines.
Matt Arsenault [Sat, 6 Sep 2014 20:37:56 +0000 (20:37 +0000)]
R600/SI: Fix broken check lines.

Fix missing check, and hardcoded register numbers.

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

9 years agoMC: correct DWARF line info for PE/COFF
Saleem Abdulrasool [Sat, 6 Sep 2014 19:57:48 +0000 (19:57 +0000)]
MC: correct DWARF line info for PE/COFF

DWARF address ranges contain a reference to the debug_info section.  This offset
is an absolute relocation except on non-PE/COFF targets where it is section
relative.  We would emit this incorrectly, and trying to map the debug info from
the address would fail.

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

9 years ago[x86] Fix a pretty horrible bug and inconsistency in the x86 asm
Chandler Carruth [Sat, 6 Sep 2014 10:00:01 +0000 (10:00 +0000)]
[x86] Fix a pretty horrible bug and inconsistency in the x86 asm
parsing (and latent bug in the instruction definitions).

This is effectively a revert of r136287 which tried to address
a specific and narrow case of immediate operands failing to be accepted
by x86 instructions with a pretty heavy hammer: it introduced a new kind
of operand that behaved differently. All of that is removed with this
commit, but the test cases are both preserved and enhanced.

The core problem that r136287 and this commit are trying to handle is
that gas accepts both of the following instructions:

  insertps $192, %xmm0, %xmm1
  insertps $-64, %xmm0, %xmm1

These will encode to the same byte sequence, with the immediate
occupying an 8-bit entry. The first form was fixed by r136287 but that
broke the prior handling of the second form! =[ Ironically, we would
still emit the second form in some cases and then be unable to
re-assemble the output.

The reason why the first instruction failed to be handled is because
prior to r136287 the operands ere marked 'i32i8imm' which forces them to
be sign-extenable. Clearly, that won't work for 192 in a single byte.
However, making thim zero-extended or "unsigned" doesn't really address
the core issue either because it breaks negative immediates. The correct
fix is to make these operands 'i8imm' reflecting that they can be either
signed or unsigned but must be 8-bit immediates. This patch backs out
r136287 and then changes those places as well as some others to use
'i8imm' rather than one of the extended variants.

Naturally, this broke something else. The custom DAG nodes had to be
updated to have a much more accurate type constraint of an i8 node, and
a bunch of Pat immediates needed to be specified as i8 values.

The fallout didn't end there though. We also then ceased to be able to
match the instruction-specific intrinsics to the instructions so
modified. Digging, this is because they too used i32 rather than i8 in
their signature. So I've also switched those intrinsics to i8 arguments
in line with the instructions.

In order to make the intrinsic adjustments of course, I also had to add
auto upgrading for the intrinsics.

I suspect that the intrinsic argument types may have led everything down
this rabbit hole. Pretty happy with the result.

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

9 years agoCheck whether the iterator p == the end iterator before trying to dereference it...
Nick Lewycky [Sat, 6 Sep 2014 01:16:42 +0000 (01:16 +0000)]
Check whether the iterator p == the end iterator before trying to dereference it. This is a speculative fix for a failure found on the valgrind buildbot triggered by a clang test.

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

9 years agoFix right shift by 64 bits detected on CXX/lex/lex.literal/lex.ext/p4.cpp
Alexey Samsonov [Sat, 6 Sep 2014 00:41:19 +0000 (00:41 +0000)]
Fix right shift by 64 bits detected on CXX/lex/lex.literal/lex.ext/p4.cpp
test case on UBSan bootstrap bot.

This fixes the last failure of "check-clang" in UBSan bootstrap bot.

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

9 years ago[docs] Document what "NFC" means in a commit message.
Sean Silva [Sat, 6 Sep 2014 00:19:16 +0000 (00:19 +0000)]
[docs] Document what "NFC" means in a commit message.

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

9 years ago[MCJIT] Fix an iterator invalidation bug in MCJIT::finalizeObject.
Lang Hames [Fri, 5 Sep 2014 23:38:35 +0000 (23:38 +0000)]
[MCJIT] Fix an iterator invalidation bug in MCJIT::finalizeObject.

The finalizeObject method calls generateCodeForModule on each of the currently
'added' objects, but generateCodeForModule moves objects out of the 'added'
set as it's called. To avoid iterator invalidation issues, the added set is
copied out before any calls to generateCodeForModule.

This should fix http://llvm.org/PR20851 .

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

9 years ago[x86] Fix an embarressing bug in the INSERTPS formation code. The mask
Chandler Carruth [Fri, 5 Sep 2014 23:19:45 +0000 (23:19 +0000)]
[x86] Fix an embarressing bug in the INSERTPS formation code. The mask
computation was totally wrong, but somehow it didn't really show up with
llc.

I've added an assert that triggers on multiple existing test cases and
updated one of them to show the correct value.

There appear to still be more bugs lurking around insertps's mask. =/
However, note that this only really impacts the new vector shuffle
lowering.

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

9 years ago[inline asm] Add a check in InlineAsm::ConstraintInfo::Parse to make sure '{'
Akira Hatanaka [Fri, 5 Sep 2014 22:30:32 +0000 (22:30 +0000)]
[inline asm] Add a check in InlineAsm::ConstraintInfo::Parse to make sure '{'
follows '~' in a clobber constraint string.

Previously llc would hit an llvm_unreachable when compiling an inline-asm
instruction with malformed constraint string "~x{21}". This commit enables
LLParser to catch the error earlier and print a more helpful diagnostic.

rdar://problem/14206559

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

9 years agoAllow vector fsub ops with constants to get the same optimizations as scalars.
Sanjay Patel [Fri, 5 Sep 2014 22:26:22 +0000 (22:26 +0000)]
Allow vector fsub ops with constants to get the same optimizations as scalars.

This problem is bigger than just fsub, but this is the minimum fix to solve
fneg for PR20556 ( http://llvm.org/bugs/show_bug.cgi?id=20556 ), and we solve
zero subtraction with the same change.

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

9 years agoFix pr20078.
Rafael Espindola [Fri, 5 Sep 2014 21:27:52 +0000 (21:27 +0000)]
Fix pr20078.

When linking llvm.global_ctors with the optional third element we have to handle
it specially and only copy the elements whose keys were also copied.

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

9 years agoRestore the ability to check if LLVMCreateObjectFile was successful
Bjorn Steinbrink [Fri, 5 Sep 2014 21:22:09 +0000 (21:22 +0000)]
Restore the ability to check if LLVMCreateObjectFile was successful

Summary:
Until r216870 LLVMCreateObjectFile returned nullptr in case of an error,
so callers could check if the call was successful. Now, it always
returns an OwningBinary wrapped as an LLVMObjectFileRef, so callers
can't check if the call was successul.

This results in a segfault running e.g.

 llvm-c-test --object-list-sections < /dev/null

So the old behaviour should be restored.

Subscribers: llvm-commits

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

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

9 years agoclean up; NFC
Sanjay Patel [Fri, 5 Sep 2014 20:55:46 +0000 (20:55 +0000)]
clean up; NFC

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

9 years ago[DWARF parser] Fix nasty memory corruption in .dwo files handling.
Alexey Samsonov [Fri, 5 Sep 2014 19:29:45 +0000 (19:29 +0000)]
[DWARF parser] Fix nasty memory corruption in .dwo files handling.

Forge a test case where llvm-symbolizer has to use external .dwo
file to produce the inlining information.

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

9 years agoThe gold tests also require ppc to be compiled in.
Rafael Espindola [Fri, 5 Sep 2014 19:01:12 +0000 (19:01 +0000)]
The gold tests also require ppc to be compiled in.

We could create a tools/gold/PowerPC and a tools/gold/X86, but it doesn't seem
worth it.

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

9 years agoRevert "Disable the fix for pr20793 because of a gnu ld bug."
Rafael Espindola [Fri, 5 Sep 2014 18:03:38 +0000 (18:03 +0000)]
Revert "Disable the fix for pr20793 because of a gnu ld bug."

This reverts commit r217211.

Both the bfd ld and gold outputs were valid. They were using a Rela relocation,
so the value present in the relocated location was not used, which caused me
to misread the output.

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

9 years ago[MCJIT] Const-ify the symbol lookup operations on RuntimeDyld.
Lang Hames [Fri, 5 Sep 2014 18:00:16 +0000 (18:00 +0000)]
[MCJIT] Const-ify the symbol lookup operations on RuntimeDyld.

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

9 years agoSet the parent pointer of cloned DBG_VALUE instructions correctly.
Adrian Prantl [Fri, 5 Sep 2014 17:10:10 +0000 (17:10 +0000)]
Set the parent pointer of cloned DBG_VALUE instructions correctly.
Fixes PR20523.

When spilling variables onto the stack, spillVirtReg() is setting the
parent pointer of the cloned DBG_VALUE intrinsic for the stack location
to the parent pointer of the original intrinsic. MachineInstr parent
pointers should however always point to the parent basic block.

MBB is shadowing the MBB member variable. The instruction still ends up
being inserted into the right basic block, because it's inserted after MI
which serves as the iterator.

I failed at constructing a reliable testcase for this, see
http://llvm.org/bugs/show_bug.cgi?id=20523 for a large testcases.

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

9 years ago[mips] Change Feature-related types from unsigned to uint64_t in MipsAsmParser. No...
Toma Tabacu [Fri, 5 Sep 2014 16:32:09 +0000 (16:32 +0000)]
[mips] Change Feature-related types from unsigned to uint64_t in MipsAsmParser. No functional changes.

Summary: Found a couple of cases where unsigned was still being used. These two should be the last ones in the (entire) Mips backend.

Reviewers: dsanders

Reviewed By: dsanders

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

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

9 years agoR600/SI: Use same complex patterns for DS atomics
Matt Arsenault [Fri, 5 Sep 2014 16:24:58 +0000 (16:24 +0000)]
R600/SI: Use same complex patterns for DS atomics

This fixes hitting the same negative base offset problem
that was already fixed for regular loads and stores.

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

9 years ago[mips] Marked the Trap-on-Condition instructions as Mips II
Daniel Sanders [Fri, 5 Sep 2014 15:50:13 +0000 (15:50 +0000)]
[mips] Marked the Trap-on-Condition instructions as Mips II

Patch by Vasileios Kalintiris.

Reviewers: dsanders

Reviewed By: dsanders

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

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

9 years ago[mips] Rename data members and member functions in MipsAssemblerOptions.
Toma Tabacu [Fri, 5 Sep 2014 15:43:21 +0000 (15:43 +0000)]
[mips] Rename data members and member functions in MipsAssemblerOptions.

Summary: Use the naming convention from the LLVM Coding Standards.

Reviewers: dsanders

Reviewed By: dsanders

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

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

9 years agoR600: Fix FROUND
Jan Vesely [Fri, 5 Sep 2014 14:26:54 +0000 (14:26 +0000)]
R600: Fix FROUND

round halfway cases away from zero

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217250 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Fix bug in SIInstrInfo::legalizeOpWithMove()
Tom Stellard [Fri, 5 Sep 2014 14:08:01 +0000 (14:08 +0000)]
R600/SI: Fix bug in SIInstrInfo::legalizeOpWithMove()

We must constrain the destination register class of legalized operands
to a VGPR class or else the illegal operand may be folded back into
the instruction by the register coalescer.

This fixes a bug in add.ll that will be uncovered by future commits.

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

9 years agoR600/SI: Use S_ADD_U32 and S_SUB_U32 for low half of 64-bit operations
Tom Stellard [Fri, 5 Sep 2014 14:07:59 +0000 (14:07 +0000)]
R600/SI: Use S_ADD_U32 and S_SUB_U32 for low half of 64-bit operations

https://bugs.freedesktop.org/show_bug.cgi?id=83416

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

9 years ago[x86] Factor out the zero vector insertion logic in the new vector
Chandler Carruth [Fri, 5 Sep 2014 10:36:31 +0000 (10:36 +0000)]
[x86] Factor out the zero vector insertion logic in the new vector
shuffle lowering for integer vectors and share it from v4i32, v8i16, and
v16i8 code paths.

Ironically, the SSE2 v16i8 code for this is now better than the SSSE3!
=] Will have to fix the SSSE3 code next to just using a single pshufb.

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

9 years agoARM: cover all sub-architecture enumerators to keep compiler happy.
Tim Northover [Fri, 5 Sep 2014 07:56:46 +0000 (07:56 +0000)]
ARM: cover all sub-architecture enumerators to keep compiler happy.

No change in behaviour (hopefully).

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

9 years ago[dwarfdump] Dump DW_AT_(decl|call)_line attribute values as decimal values.
Frederic Riss [Fri, 5 Sep 2014 07:21:50 +0000 (07:21 +0000)]
[dwarfdump] Dump DW_AT_(decl|call)_line attribute values as decimal values.

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

9 years agoReapply "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()"
Frederic Riss [Fri, 5 Sep 2014 07:21:40 +0000 (07:21 +0000)]
Reapply "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()"

This commit was reverted in r217183, but is OK to go in again now that its dependency is commited (as of r217186).

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

9 years agoRemoved white-space
Matthew Gardiner [Fri, 5 Sep 2014 07:17:15 +0000 (07:17 +0000)]
Removed white-space

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

9 years agoAdding kalimba variants as Triple sub-architectures.
Matthew Gardiner [Fri, 5 Sep 2014 06:46:43 +0000 (06:46 +0000)]
Adding kalimba variants as Triple sub-architectures.
Reviewed in:

http://reviews.llvm.org/D5115

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

9 years agoInstCombine: Remove a special case pattern
David Majnemer [Fri, 5 Sep 2014 06:09:24 +0000 (06:09 +0000)]
InstCombine: Remove a special case pattern

The special case did not work when run under -reassociate and can easily
be expressed by a further generalization of an existing pattern.

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

9 years agoMinor typo.
Andrew Trick [Fri, 5 Sep 2014 04:56:43 +0000 (04:56 +0000)]
Minor typo.

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

9 years agoMC: correct DWARF header for PE/COFF assembly input
Saleem Abdulrasool [Fri, 5 Sep 2014 04:15:00 +0000 (04:15 +0000)]
MC: correct DWARF header for PE/COFF assembly input

The header contains an offset to the DWARF line table for the CU.  The offset
must be section relative for COFF and absolute for others.  The non-assembly
code path for the DWARF header generation already has the correct emission for
the headers.  This corrects the assembly input path.

This was identified by BFD objecting to the LLVM generated DWARF information.

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

9 years ago[AArch64] Add pass to enable additional comparison optimizations by CSE.
Jiangning Liu [Fri, 5 Sep 2014 02:55:24 +0000 (02:55 +0000)]
[AArch64] Add pass to enable additional comparison optimizations by CSE.

Patched by Sergey Dmitrouk.

This pass tries to make consecutive compares of values use same operands to
allow CSE pass to remove duplicated instructions. For this it analyzes
branches and adjusts comparisons with immediate values by converting:

GE -> GT
GT -> GE
LT -> LE
LE -> LT

and adjusting immediate values appropriately. It basically corrects two
immediate values towards each other to make them equal.

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

9 years ago[CMake] Add -fno-sanitize=function to UBSan bootstrap
Alexey Samsonov [Fri, 5 Sep 2014 01:17:30 +0000 (01:17 +0000)]
[CMake] Add -fno-sanitize=function to UBSan bootstrap

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

9 years agoDisable the fix for pr20793 because of a gnu ld bug.
Rafael Espindola [Fri, 5 Sep 2014 00:14:12 +0000 (00:14 +0000)]
Disable the fix for pr20793 because of a gnu ld bug.

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

9 years agoRefactor to avoid code duplication. NFC.
Rafael Espindola [Fri, 5 Sep 2014 00:02:50 +0000 (00:02 +0000)]
Refactor to avoid code duplication. NFC.

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

9 years agoFix pr20793.
Rafael Espindola [Thu, 4 Sep 2014 23:03:58 +0000 (23:03 +0000)]
Fix pr20793.

With this patch the third field of llvm.global_ctors is also used on ELF.

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

9 years agoPost-JIT light cleanup of ExecutionEngine.h: edited comments about the JIT,
Yaron Keren [Thu, 4 Sep 2014 20:37:02 +0000 (20:37 +0000)]
Post-JIT light cleanup of ExecutionEngine.h: edited comments about the JIT,
removed runJITOnFunction and isLazyCompilationDisabled.

Deleted CodeGen\MachineCodeInfo.h which was used by runJITOnFunction() only.

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

9 years ago[ dwarfdump ] Add symbolic dump of known DWARF attribute values.
Frederic Riss [Thu, 4 Sep 2014 19:39:20 +0000 (19:39 +0000)]
[ dwarfdump ] Add symbolic dump of known DWARF attribute values.

Reviewed By: dblaikie

Subscribers: llvm-commits

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

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

9 years agoRevert "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()"
Frederic Riss [Thu, 4 Sep 2014 18:55:46 +0000 (18:55 +0000)]
Revert "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()"

This reverts commit 93c7e6161e1adbd2c7ac81fa081823183035cb64.

This commit got approved first, but was dependant on another one going in (The one pretty printing attribute values). I'll reapply when the other one is in.

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

9 years ago[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()
Frederic Riss [Thu, 4 Sep 2014 18:40:23 +0000 (18:40 +0000)]
[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()

Reviewed By: dblaikie

Subscribers: llvm-commits

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

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

9 years agoFix use-after-move introduced in r217065 and caught in post-commit review by Alexey.
David Blaikie [Thu, 4 Sep 2014 18:37:31 +0000 (18:37 +0000)]
Fix use-after-move introduced in r217065 and caught in post-commit review by Alexey.

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

9 years agounique_ptrify RuntimeDyld::Dyld
David Blaikie [Thu, 4 Sep 2014 18:37:29 +0000 (18:37 +0000)]
unique_ptrify RuntimeDyld::Dyld

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

9 years agoMC Win64: Put unwind info for COMDAT code into the same COMDAT group
Reid Kleckner [Thu, 4 Sep 2014 17:42:03 +0000 (17:42 +0000)]
MC Win64: Put unwind info for COMDAT code into the same COMDAT group

Summary:
This fixes a long standing issue where we would emit many little .text
sections and only one .pdata and .xdata section. Now we generate one
.pdata / .xdata pair per .text section and associate them correctly.

Fixes PR19667.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

9 years agoRemoved the ctime printed “time stamp” from macho-private-headers.test to fix the...
Kevin Enderby [Thu, 4 Sep 2014 17:13:44 +0000 (17:13 +0000)]
Removed the ctime printed “time stamp” from macho-private-headers.test to fix the builds.

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

9 years agoX86: cpuid and xgetbv write to 32-bit registers, not 64-bit
Reid Kleckner [Thu, 4 Sep 2014 16:58:25 +0000 (16:58 +0000)]
X86: cpuid and xgetbv write to 32-bit registers, not 64-bit

This fixes an issue where MS inline assembly containing xgetbv wouldn't
be marked as clobbering EAX:EDX. Test for that forthcoming on the Clang
side.

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

9 years agoAdds the next bit of support for llvm-objdump’s -private-headers for executable Mach...
Kevin Enderby [Thu, 4 Sep 2014 16:54:47 +0000 (16:54 +0000)]
Adds the next bit of support for llvm-objdump’s -private-headers for executable Mach-O files.

This adds the printing of more load commands, so that the normal load commands
in a typical X86 Mach-O executable can all be printed.

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

9 years agoFix link to 3.5 release notes.
Nico Weber [Thu, 4 Sep 2014 15:26:10 +0000 (15:26 +0000)]
Fix link to 3.5 release notes.

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

9 years agoAArch64: fix vector-immediate BIC/ORR on big-endian devices.
Tim Northover [Thu, 4 Sep 2014 15:05:24 +0000 (15:05 +0000)]
AArch64: fix vector-immediate BIC/ORR on big-endian devices.

Follow up to r217138, extending the logic to other NEON-immediate instructions.
As before, the instruction already performs the correct operation and we're
just using a different type for convenience, so we want a true nop-cast.

Patch by Asiri Rathnayake.

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

9 years agobuild/cmake: Fix CMP0023 warning with libffi
Jan Vesely [Thu, 4 Sep 2014 14:21:10 +0000 (14:21 +0000)]
build/cmake: Fix CMP0023 warning with libffi

Fixes:
CMake Warning (dev) at lib/ExecutionEngine/Interpreter/CMakeLists.txt:16 (target_link_libraries):
  Policy CMP0023 is not set: Plain and keyword target_link_libraries
  signatures cannot be mixed.  Run "cmake --help-policy CMP0023" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The keyword signature for target_link_libraries has already been used with
  the target "LLVMInterpreter".  All uses of target_link_libraries with a
  target should be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * cmake/modules/AddLLVM.cmake:345 (target_link_libraries)

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217154 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Rename MipsAsmParser functions to conform to the LLVM Coding Standards. No...
Toma Tabacu [Thu, 4 Sep 2014 13:23:44 +0000 (13:23 +0000)]
[mips] Rename MipsAsmParser functions to conform to the LLVM Coding Standards. No functional changes.

Summary: There are still some functions which should be renamed, but they are inherited from the generic MC classes.

Reviewers: dsanders

Reviewed By: dsanders

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

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

9 years agoEnable noalias metadata by default and swap the order of the SLP and Loop vectorizers...
James Molloy [Thu, 4 Sep 2014 13:23:08 +0000 (13:23 +0000)]
Enable noalias metadata by default and swap the order of the SLP and Loop vectorizers by default.

After some time maturing, hopefully the flags themselves will be removed.

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

9 years agoSilencing a usually-helpful-but-braindead-silly-in-this-case sign mismatch warning...
Aaron Ballman [Thu, 4 Sep 2014 11:52:24 +0000 (11:52 +0000)]
Silencing a usually-helpful-but-braindead-silly-in-this-case sign mismatch warning with MSVC. NFC.

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

9 years agoAArch64: fix big-endian immediate materialisation
Tim Northover [Thu, 4 Sep 2014 09:46:14 +0000 (09:46 +0000)]
AArch64: fix big-endian immediate materialisation

We were materialising big-endian constants using DAG nodes with types different
from what was requested, followed by a bitcast. This is fine on little-endian
machines where bitcasting is a nop, but we need a slightly different
representation for big-endian. This adds a new set of NVCAST (natural-vector
cast) operations which are always nops.

Patch by Asiri Rathnayake.

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

9 years ago[x86] Teach the new v4i32 shuffle lowering some more tricks to recognize
Chandler Carruth [Thu, 4 Sep 2014 09:26:30 +0000 (09:26 +0000)]
[x86] Teach the new v4i32 shuffle lowering some more tricks to recognize
vzext patterns and insert-element patterns that for SSE4 have dedicated
instructions.

With this we can enable the experimental mode in a regression test that
happens to cover some of the past set of issues. You can see that the
new logic does significantly better here on the floating point cases.

A follow-up to this change and the previous ones will hoist the logic
into helpers so it can be shared across element type sizes as in this
particular case it generalizes cleanly.

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

9 years agoFixed compilation problem on Windows (initialization of non-aggregate type).
Elena Demikhovsky [Thu, 4 Sep 2014 07:20:39 +0000 (07:20 +0000)]
Fixed compilation problem on Windows (initialization of non-aggregate type).
After commit 217131.

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

9 years ago[GVN] Format variable name.
Tilmann Scheller [Thu, 4 Sep 2014 06:38:00 +0000 (06:38 +0000)]
[GVN] Format variable name.

Local variables need to start with an upper case letter.

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

9 years agoFix build faliure introduced by r217129.
Frederic Riss [Thu, 4 Sep 2014 06:35:09 +0000 (06:35 +0000)]
Fix build faliure introduced by r217129.

Looks like one can't put 'const uint8_t' as ArrayRef contained type. It fails to build with libstdc++.

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

9 years agoX86 Intrinsics table - changed to a static table sorted by intrinsic id.
Elena Demikhovsky [Thu, 4 Sep 2014 06:34:34 +0000 (06:34 +0000)]
X86 Intrinsics table - changed to a static table sorted by intrinsic id.
Used binary search over the tables.

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

9 years agoRename DWARFContext::getLineTableForCompileUnit to getLineTableForUnit.
Frederic Riss [Thu, 4 Sep 2014 06:14:40 +0000 (06:14 +0000)]
Rename DWARFContext::getLineTableForCompileUnit to getLineTableForUnit.

All DWARFUnits can have line information. Rename and change arguments' type
accordingly.

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

9 years agoAdd DWARFFormValue::getAsBlock() and add FC_Flag as an acceptable class for an unsign...
Frederic Riss [Thu, 4 Sep 2014 06:14:35 +0000 (06:14 +0000)]
Add DWARFFormValue::getAsBlock() and add FC_Flag as an acceptable class for an unsigned constant.

To be used in further patches that improve the dumpers.

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

9 years agoAdd a DWARFContext& member in DWARFUnit.
Frederic Riss [Thu, 4 Sep 2014 06:14:28 +0000 (06:14 +0000)]
Add a DWARFContext& member in DWARFUnit.

The DWARFContext will be used to pass global 'context' down, like
pointers to related debug info sections or command line options.
The first use will be for the debug_info dumper to be able to access
other debug info section to dump eg. Location Expression inline
in the debug_info dump.

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

9 years ago[MCJIT] Make sure eh-frame fixups use the target's pointer type, not the host's.
Lang Hames [Thu, 4 Sep 2014 04:53:03 +0000 (04:53 +0000)]
[MCJIT] Make sure eh-frame fixups use the target's pointer type, not the host's.

If the wrong pointer type is used it can cause corruption of the frame
description entries.

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

9 years agoUse vector constructor instead of a for loop to initialize entries.
Craig Topper [Thu, 4 Sep 2014 04:49:03 +0000 (04:49 +0000)]
Use vector constructor instead of a for loop to initialize entries.

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

9 years ago[MCJIT] Add command-line argument to llvm-rtdyld to specify target addresses for
Lang Hames [Thu, 4 Sep 2014 04:19:54 +0000 (04:19 +0000)]
[MCJIT] Add command-line argument to llvm-rtdyld to specify target addresses for
sections.

This allows fine-grained control of the memory layout of hypothetical target
processes for testing purposes.

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

9 years agoRevert r216803 "[MachineSinking] Clear kill flag of all operands at all their uses."
Juergen Ributzka [Thu, 4 Sep 2014 02:07:36 +0000 (02:07 +0000)]
Revert r216803 "[MachineSinking] Clear kill flag of all operands at all their uses."

This reverts commit r216803, because it might have broken the buildbot.
The issue is tracked in PR20842.

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

9 years ago[FastISel][AArch64] Cleanup and simplify 'fastSelectInstruction'. NFC.
Juergen Ributzka [Thu, 4 Sep 2014 01:29:21 +0000 (01:29 +0000)]
[FastISel][AArch64] Cleanup and simplify 'fastSelectInstruction'. NFC.

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

9 years ago[FastISel][AArch64] Add target-specific lowering for logical operations.
Juergen Ributzka [Thu, 4 Sep 2014 01:29:18 +0000 (01:29 +0000)]
[FastISel][AArch64] Add target-specific lowering for logical operations.

This change adds support for immediate and shift-left folding into logical
operations.

This fixes rdar://problem/18223183.

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

9 years ago[x86] Teach the new vector shuffle lowering about the zero masking
Chandler Carruth [Thu, 4 Sep 2014 01:13:48 +0000 (01:13 +0000)]
[x86] Teach the new vector shuffle lowering about the zero masking
abilities of INSERTPS which are really powerful and come up in very
important contexts such as forming diagonal matrices, etc.

With this I ended up being able to remove the somewhat weird helper
I added for INSERTPS because we can collapse the entire state to a no-op
mask. Added a bunch of tests for inserting into a zero-ish vector.

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

9 years agoIndVarSimplify: Address review comments for r217102
David Majnemer [Thu, 4 Sep 2014 00:23:13 +0000 (00:23 +0000)]
IndVarSimplify: Address review comments for r217102

No functional change intended, just some cleanups and comments added.

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

9 years agollvm-cov: Don't pointlessly create a unique_ptr (NFC)
Justin Bogner [Thu, 4 Sep 2014 00:04:54 +0000 (00:04 +0000)]
llvm-cov: Don't pointlessly create a unique_ptr (NFC)

There's no ownership going on here, and no reason to heap allocate
this object.

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

9 years agoRevert accidentally committed r217107
Matt Arsenault [Wed, 3 Sep 2014 23:38:05 +0000 (23:38 +0000)]
Revert accidentally committed r217107

"Don't treat 0 as a special value for int attributes."

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

9 years agoR600/SI: Un-move pattern I forgot to remove in last commit
Matt Arsenault [Wed, 3 Sep 2014 23:28:57 +0000 (23:28 +0000)]
R600/SI: Un-move pattern I forgot to remove in last commit

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

9 years agoR600/SI: Try to keep i32 mul on SALU
Matt Arsenault [Wed, 3 Sep 2014 23:24:35 +0000 (23:24 +0000)]
R600/SI: Try to keep i32 mul on SALU

Also fix bug this exposed where when legalizing an immediate
operand, a v_mov_b32 would be created with a VSrc dest register.

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

9 years agoDon't treat 0 as a special value for int attributes.
Matt Arsenault [Wed, 3 Sep 2014 23:24:31 +0000 (23:24 +0000)]
Don't treat 0 as a special value for int attributes.

Split the get() to not use a default value. This way
attributes can be added that have 0 as a legitimate value.

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

9 years ago[asan] fix debug info produced for asan-coverage=2
Kostya Serebryany [Wed, 3 Sep 2014 23:24:18 +0000 (23:24 +0000)]
[asan] fix debug info produced for asan-coverage=2

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

9 years agoEnabling LLVM & Clang to be cross-compiled using CMake from a single configuration...
Chris Bieneman [Wed, 3 Sep 2014 23:21:18 +0000 (23:21 +0000)]
Enabling LLVM & Clang to be cross-compiled using CMake from a single configuration command line

The basic idea is similar to the existing cross compilation support. A directory must be configured to build host versions of tablegen tools and llvm-config. This directory can be user provided (and configured), or it can be created during the build. During a build the native build directory will be configured and built to supply the tablegen tools used during the build. A user could also explicitly provide the tablegen executables to run on the CMake command line.

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

9 years agoIndVarSimplify: Don't let LFTR compare against a poison value
David Majnemer [Wed, 3 Sep 2014 23:03:18 +0000 (23:03 +0000)]
IndVarSimplify: Don't let LFTR compare against a poison value

LinearFunctionTestReplace tries to use the *next* indvar to compare
against when possible.  However, it may be the case that the calculation
for the next indvar has NUW/NSW flags and that it may only be safely
used inside the loop.  Using it in a comparison to calculate the exit
condition could result in observing poison.

This fixes PR20680.

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

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