oota-llvm.git
11 years agoAdd and remove the attribute from the correct slot.
Bill Wendling [Wed, 20 Feb 2013 23:04:11 +0000 (23:04 +0000)]
Add and remove the attribute from the correct slot.

The slot that we're adding/removing the attribute from may not be the same as
the attribute coming in. Make sure that they match up before we try to
add/remove them.
PR15313

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

11 years agoStabilize vec_constants.ll
Bill Schmidt [Wed, 20 Feb 2013 22:43:03 +0000 (22:43 +0000)]
Stabilize vec_constants.ll

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

11 years agoFix accidental concatenation for "outputuntil" in the -debug-buffer-size option descr...
Erik Verbruggen [Wed, 20 Feb 2013 22:33:46 +0000 (22:33 +0000)]
Fix accidental concatenation for "outputuntil" in the -debug-buffer-size option description.

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

11 years agoMCParser: Update method names per coding guidelines.
Jim Grosbach [Wed, 20 Feb 2013 22:21:35 +0000 (22:21 +0000)]
MCParser: Update method names per coding guidelines.

s/AddDirectiveHandler/addDirectiveHandler/
s/ParseMSInlineAsm/parseMSInlineAsm/
s/ParseIdentifier/parseIdentifier/
s/ParseStringToEndOfStatement/parseStringToEndOfStatement/
s/ParseEscapedString/parseEscapedString/
s/EatToEndOfStatement/eatToEndOfStatement/
s/ParseExpression/parseExpression/
s/ParseParenExpression/parseParenExpression/
s/ParseAbsoluteExpression/parseAbsoluteExpression/
s/CheckForValidSection/checkForValidSection/

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

No functional change intended.

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

11 years agoOnly use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
Cameron Zwarich [Wed, 20 Feb 2013 22:10:02 +0000 (22:10 +0000)]
Only use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
and SlotIndexes.

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

11 years agoFind anchoring end points for repairIntervalsInRange and repairIndexesInRange
Cameron Zwarich [Wed, 20 Feb 2013 22:10:00 +0000 (22:10 +0000)]
Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically.

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

11 years agoMake repairIntervalsInRange() more robust. There are now no longer any liveness-
Cameron Zwarich [Wed, 20 Feb 2013 22:09:57 +0000 (22:09 +0000)]
Make repairIntervalsInRange() more robust. There are now no longer any liveness-
related failures when running 'make check' without LiveVariables with the
verifier enabled. Some of the remaining failures elsewhere may still be fallout
from incorrect updating of LiveIntervals or the few missing cases left in the
two-address pass.

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

11 years agoDAGCombiner: Fold pointless truncate, bitcast, buildvector series
Arnold Schwaighofer [Wed, 20 Feb 2013 21:33:32 +0000 (21:33 +0000)]
DAGCombiner: Fold pointless truncate, bitcast, buildvector series

(2xi32) (truncate ((2xi64) bitcast (buildvector i32 a, i32 x, i32 b, i32 y)))
can be folded into a (2xi32) (buildvector i32 a, i32 b).

Such a DAG would cause uneccessary vdup instructions followed by vmovn
instructions.

We generate this code on ARM NEON for a setcc olt, 2xf64, 2xf64. For example, in
the vectorized version of the code below.

double A[N];
double B[N];

void test_double_compare_to_double() {
  int i;
  for(i=0;i<N;i++)
    A[i] = (double)(A[i] < B[i]);
}

radar://13191881

Fixes bug 15283.

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

11 years agoR600: Update for name changes from r175667.
Jim Grosbach [Wed, 20 Feb 2013 21:31:28 +0000 (21:31 +0000)]
R600: Update for name changes from r175667.

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

11 years agoUpdate TargetLowering ivars for name policy.
Jim Grosbach [Wed, 20 Feb 2013 21:13:59 +0000 (21:13 +0000)]
Update TargetLowering ivars for name policy.

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

ivars should be camel-case and start with an upper-case letter. A few in
TargetLowering were starting with a lower-case letter.

No functional change intended.

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

11 years agoAdditional fixes for bug 15155.
Bill Schmidt [Wed, 20 Feb 2013 20:41:42 +0000 (20:41 +0000)]
Additional fixes for bug 15155.

This handles the cases where the 6-bit splat element is odd, converting
to a three-instruction sequence to add or subtract two splats.  With this
fix, the XFAIL in test/CodeGen/PowerPC/vec_constants.ll is removed.

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

11 years ago[objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.
Michael J. Spencer [Wed, 20 Feb 2013 20:18:10 +0000 (20:18 +0000)]
[objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.

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

11 years agoUpdate a comment that looks to have been accidentally deleted many moons ago.
Chad Rosier [Wed, 20 Feb 2013 20:15:55 +0000 (20:15 +0000)]
Update a comment that looks to have been accidentally deleted many moons ago.

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

11 years agoRewrite comments.
Dan Gohman [Wed, 20 Feb 2013 19:28:46 +0000 (19:28 +0000)]
Rewrite comments.

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

11 years agoAdd comment in Memory.inc explaining r175646.
Krzysztof Parzyszek [Wed, 20 Feb 2013 19:25:09 +0000 (19:25 +0000)]
Add comment in Memory.inc explaining r175646.

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

11 years agoSIGQUIT is a "kill" signal, rather than an "int" signal, in this context.
Dan Gohman [Wed, 20 Feb 2013 19:15:01 +0000 (19:15 +0000)]
SIGQUIT is a "kill" signal, rather than an "int" signal, in this context.

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

11 years agoFormatting, grammar
Andrew Kaylor [Wed, 20 Feb 2013 18:24:34 +0000 (18:24 +0000)]
Formatting, grammar

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

11 years agoOn PowerPC, the cache-flush instructions dcbf and icbi are treated as
Krzysztof Parzyszek [Wed, 20 Feb 2013 18:24:30 +0000 (18:24 +0000)]
On PowerPC, the cache-flush instructions dcbf and icbi are treated as
loads. On FreeBSD, add PROT_READ page protection flag before flushing
cache.

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

11 years agoUse LiveRangeUpdater instead of mergeIntervalRanges.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 18:18:15 +0000 (18:18 +0000)]
Use LiveRangeUpdater instead of mergeIntervalRanges.

Performance is the same, but LiveRangeUpdater has a more flexible
interface.

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

11 years agoAdd a LiveRangeUpdater class.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 18:18:12 +0000 (18:18 +0000)]
Add a LiveRangeUpdater class.

Adding new segments to large LiveIntervals can be expensive because the
LiveRange objects after the insertion point may need to be moved left or
right. This can cause quadratic behavior when adding a large number of
segments to a live range.

The LiveRangeUpdater class allows the LIveInterval to be in a temporary
invalid state while segments are being added. It maintains an internal
gap in the LiveInterval when it is shrinking, and it has a spill area
for new segments when the LiveInterval is growing.

The behavior is similar to the existing mergeIntervalRanges() function,
except it allocates less memory for the spill area, and the algorithm is
turned inside out so the loop is driven by the clients.

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

11 years agoAdding support for absolute relocations. This occurs in ELF files when a relocation...
Andrew Kaylor [Wed, 20 Feb 2013 18:09:21 +0000 (18:09 +0000)]
Adding support for absolute relocations.  This occurs in ELF files when a relocation is given with no name and an undefined section.  The relocation is applied with an address of zero.

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

11 years agoFix PR15267
Michael Liao [Wed, 20 Feb 2013 18:04:21 +0000 (18:04 +0000)]
Fix PR15267

- When extloading from a vector with non-byte-addressable element, e.g.
  <4 x i1>, the current logic breaks. Extend the current logic to
  fix the case where the element type is not byte-addressable by loading
  all bytes, bit-extracting/packing each element.

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

11 years ago[ms-inline asm] Make the comment a bit more verbose.
Chad Rosier [Wed, 20 Feb 2013 18:03:44 +0000 (18:03 +0000)]
[ms-inline asm] Make the comment a bit more verbose.

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

11 years agoAdd a default constructor for LiveRange.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 17:46:51 +0000 (17:46 +0000)]
Add a default constructor for LiveRange.

It is useful to be able to create temporary LiveRange object whose
members are filled in later.

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

11 years agoFix bug 14779 for passing anonymous aggregates [patch by Kai Nacke].
Bill Schmidt [Wed, 20 Feb 2013 17:31:41 +0000 (17:31 +0000)]
Fix bug 14779 for passing anonymous aggregates [patch by Kai Nacke].

The PPC backend doesn't handle these correctly.  This patch uses logic
similar to that in the X86 and ARM backends to track these arguments
properly.

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

11 years agoHexagon: Move HexagonMCInst.h to MCTargetDesc/HexagonMCInst.h.
Jyotsna Verma [Wed, 20 Feb 2013 16:13:27 +0000 (16:13 +0000)]
Hexagon: Move HexagonMCInst.h to MCTargetDesc/HexagonMCInst.h.
Add HexagonMCInst class which adds various Hexagon VLIW annotations.
In addition, this class also includes some APIs related to the
constant extenders.

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

11 years agoRevert r175626, "ADT/Optional.h: Appease msvc."
NAKAMURA Takumi [Wed, 20 Feb 2013 15:52:44 +0000 (15:52 +0000)]
Revert r175626, "ADT/Optional.h: Appease msvc."

Sorry, I didn't cover +Asserts, by accident. :(

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

11 years agoFix PR15155: lost vadd/vsplat optimization.
Bill Schmidt [Wed, 20 Feb 2013 15:50:31 +0000 (15:50 +0000)]
Fix PR15155: lost vadd/vsplat optimization.

During lowering of a BUILD_VECTOR, we look for opportunities to use a
vector splat.  When the splatted value fits in 5 signed bits, a single
splat does the job.  When it doesn't fit in 5 bits but does fit in 6,
and is an even value, we can splat on half the value and add the result
to itself.

This last optimization hasn't been working recently because of improved
constant folding.  To circumvent this, create a pseudo VADD_SPLAT that
can be expanded during instruction selection.

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

11 years agoWhitespace.
NAKAMURA Takumi [Wed, 20 Feb 2013 15:12:32 +0000 (15:12 +0000)]
Whitespace.

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

11 years agoADT/Optional.h: Appease msvc.
NAKAMURA Takumi [Wed, 20 Feb 2013 15:12:24 +0000 (15:12 +0000)]
ADT/Optional.h: Appease msvc.

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

11 years agoMove the SplatByte helper to APInt and generalize it a bit.
Benjamin Kramer [Wed, 20 Feb 2013 13:00:06 +0000 (13:00 +0000)]
Move the SplatByte helper to APInt and generalize it a bit.

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

11 years agoI optimized the following patterns:
Elena Demikhovsky [Wed, 20 Feb 2013 12:42:54 +0000 (12:42 +0000)]
I optimized the following patterns:
 sext <4 x i1> to <4 x i64>
 sext <4 x i8> to <4 x i64>
 sext <4 x i16> to <4 x i64>

I'm running Combine on SIGN_EXTEND_IN_REG and revert SEXT patterns:
 (sext_in_reg (v4i64 anyext (v4i32 x )), ExtraVT) -> (v4i64 sext (v4i32 sext_in_reg (v4i32 x , ExtraVT)))

 The sext_in_reg (v4i32 x) may be lowered to shl+sar operations.
 The "sar" does not exist on 64-bit operation, so lowering sext_in_reg (v4i64 x) has no vector solution.

I also added a cost of this operations to the AVX costs table.

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

11 years ago[asan] instrument invoke insns with noreturn attribute (as well as call insns)
Kostya Serebryany [Wed, 20 Feb 2013 12:35:15 +0000 (12:35 +0000)]
[asan] instrument invoke insns with noreturn attribute (as well as call insns)

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

11 years agoFix thumbv5e frame lowering assertion failure.
Logan Chien [Wed, 20 Feb 2013 12:21:33 +0000 (12:21 +0000)]
Fix thumbv5e frame lowering assertion failure.

It is possible that frame pointer is not found in the
callee saved info, thus FramePtrSpillFI may be incorrect
if we don't check the result of hasFP(MF).

Besides, if we enable the stack coloring algorithm, there
will be an assertion to ensure the slot is live.  But in
the test case, %var1 is not live in the prologue of the
function, and we will get the assertion failure.

Note: There is similar code in ARMFrameLowering.cpp.

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

11 years agoUse the attribute group reference instead of the attribute directly.
Bill Wendling [Wed, 20 Feb 2013 07:48:23 +0000 (07:48 +0000)]
Use the attribute group reference instead of the attribute directly.

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

11 years agoFully qualify llvm::next to avoid ambiguity when building as C++11.
David Blaikie [Wed, 20 Feb 2013 07:39:20 +0000 (07:39 +0000)]
Fully qualify llvm::next to avoid ambiguity when building as C++11.

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

11 years agoFix the (clang -Werror) build by removing an unused member variable.
David Blaikie [Wed, 20 Feb 2013 07:39:18 +0000 (07:39 +0000)]
Fix the (clang -Werror) build by removing an unused member variable.

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

11 years agoModify the LLVM assembly output so that it uses references to represent function...
Bill Wendling [Wed, 20 Feb 2013 07:21:42 +0000 (07:21 +0000)]
Modify the LLVM assembly output so that it uses references to represent function attributes.

This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }

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

11 years agoAdd support to the two-address pass for updating LiveIntervals in many of the
Cameron Zwarich [Wed, 20 Feb 2013 06:46:48 +0000 (06:46 +0000)]
Add support to the two-address pass for updating LiveIntervals in many of the
common transformations. This includes updating repairIntervalsInRange() to
handle more cases.

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

11 years agoMove the computation of the IsEarlyClobber flag into its own loop, since the
Cameron Zwarich [Wed, 20 Feb 2013 06:46:46 +0000 (06:46 +0000)]
Move the computation of the IsEarlyClobber flag into its own loop, since the
correct value is needed in every iteration of the loop for updating
LiveIntervals.

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

11 years agoModify LiveInterval::addRange() to match the comment about what it returns.
Cameron Zwarich [Wed, 20 Feb 2013 06:46:44 +0000 (06:46 +0000)]
Modify LiveInterval::addRange() to match the comment about what it returns.

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

11 years agoAdd SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
Cameron Zwarich [Wed, 20 Feb 2013 06:46:41 +0000 (06:46 +0000)]
Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
and removing instructions. The implementation seems more complicated than it
needs to be, but I couldn't find something simpler that dealt with all of the
corner cases.

Also add a call to repairIndexesInRange() from repairIntervalsInRange().

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

11 years agoMake SlotIndex::getEntry() return unsigned to match IndexListEntry.
Cameron Zwarich [Wed, 20 Feb 2013 06:46:39 +0000 (06:46 +0000)]
Make SlotIndex::getEntry() return unsigned to match IndexListEntry.

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

11 years agoFix a misunderstanding about how RegMaskBlocks works. This was caught by
Cameron Zwarich [Wed, 20 Feb 2013 06:46:36 +0000 (06:46 +0000)]
Fix a misunderstanding about how RegMaskBlocks works. This was caught by
assertions in the register allocator when running 'make check' without
LiveVariables.

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

11 years agoRemove verification after PHIElimination when using LiveIntervals, and move it
Cameron Zwarich [Wed, 20 Feb 2013 06:46:34 +0000 (06:46 +0000)]
Remove verification after PHIElimination when using LiveIntervals, and move it
after the two-address pass. The remaining problems in 'make check' are occurring
later.

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

11 years agoAvoid recomputing an inserted instruction's SlotIndex.
Cameron Zwarich [Wed, 20 Feb 2013 06:46:32 +0000 (06:46 +0000)]
Avoid recomputing an inserted instruction's SlotIndex.

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

11 years agoAdd preservation of SlotIndexes to PHIElimination.
Cameron Zwarich [Wed, 20 Feb 2013 06:46:28 +0000 (06:46 +0000)]
Add preservation of SlotIndexes to PHIElimination.

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

11 years agoRename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
David Blaikie [Wed, 20 Feb 2013 06:25:36 +0000 (06:25 +0000)]
Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.

Code review feedback on r175580 from Jordan Rose.

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

11 years agoExpand pseudos/macros:
Reed Kotler [Wed, 20 Feb 2013 05:45:15 +0000 (05:45 +0000)]
Expand pseudos/macros:
  SltCCRxRy16, SltiCCRxImmX16, SltiuCCRxImmX16, SltuCCRxRy16
$T8 shows up as register $24 when emitted from C++ code so we had
to change some tests that were already there for this functionality.

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

11 years ago[llvm-readobj] Add ELF .dynamic table dumping.
Michael J. Spencer [Wed, 20 Feb 2013 02:37:12 +0000 (02:37 +0000)]
[llvm-readobj] Add ELF .dynamic table dumping.

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

11 years agoRemove unneeded #include.
Jakub Staszak [Wed, 20 Feb 2013 00:32:19 +0000 (00:32 +0000)]
Remove unneeded #include.

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

11 years agoAdd missing #include.
Jakub Staszak [Wed, 20 Feb 2013 00:31:54 +0000 (00:31 +0000)]
Add missing #include.

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

11 years agoFix #includes, so we include only what we really need.
Jakub Staszak [Wed, 20 Feb 2013 00:26:25 +0000 (00:26 +0000)]
Fix #includes, so we include only what we really need.

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

11 years agoAllow llvm::Optional to work with types without default constructors.
David Blaikie [Wed, 20 Feb 2013 00:26:04 +0000 (00:26 +0000)]
Allow llvm::Optional to work with types without default constructors.

This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

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

11 years agoMove part of APInt implementation from header to cpp file. These methods
Jakub Staszak [Wed, 20 Feb 2013 00:17:42 +0000 (00:17 +0000)]
Move part of APInt implementation from header to cpp file. These methods
require call cpp file anyway, so we wouldn't gain anything by keeping them
inline.

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

11 years agoclear new map and initialize new variable
Pedro Artigas [Wed, 20 Feb 2013 00:10:29 +0000 (00:10 +0000)]
clear new map and initialize new variable

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

11 years agoAdd the function attributes from an inline asm call. These don't have declarations...
Bill Wendling [Wed, 20 Feb 2013 00:04:41 +0000 (00:04 +0000)]
Add the function attributes from an inline asm call. These don't have declarations that set the attribute groups, so we must do it on our own.

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

11 years ago[ms-inline asm] Force the use of a base pointer if the MachineFunction includes
Chad Rosier [Tue, 19 Feb 2013 23:50:45 +0000 (23:50 +0000)]
[ms-inline asm] Force the use of a base pointer if the MachineFunction includes
MS-style inline assembly.

This is a follow-on to r175334.  Forcing a FP to be emitted doesn't ensure it
will be used.  Therefore, force the base pointer as well.  We now treat MS
inline assembly in the same way we treat functions with dynamic stack
realignment and VLAs.  This guarantees the BP will be used to reference
parameters and locals.
rdar://13218191

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

11 years agoUpdate a portability kludge to keep it in sync with changes in the code
Dan Gohman [Tue, 19 Feb 2013 22:38:58 +0000 (22:38 +0000)]
Update a portability kludge to keep it in sync with changes in the code
which uses it. This is not ideal, but it ought to at least restore the
behavior to what it was before.

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

11 years agoELF symbol table field st_other support,
Jack Carter [Tue, 19 Feb 2013 22:29:00 +0000 (22:29 +0000)]
ELF symbol table field st_other support,
excluding visibility bits.

Mips (o32 abi) specific e_header setting.

EF_MIPS_ABI_O32 needs to be set in the
ELF header flags for o32 abi output.

Contributer: Reed Kotler

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

11 years agoRemove unused variable.
Jakub Staszak [Tue, 19 Feb 2013 22:17:58 +0000 (22:17 +0000)]
Remove unused variable.

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

11 years agoMinor cleanups. No functionality change.
Jakub Staszak [Tue, 19 Feb 2013 22:14:45 +0000 (22:14 +0000)]
Minor cleanups. No functionality change.

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

11 years agoELF symbol table field st_other support,
Jack Carter [Tue, 19 Feb 2013 22:14:34 +0000 (22:14 +0000)]
ELF symbol table field st_other support,
excluding visibility bits.

Mips (Mips16) specific e_header setting.

EF_MIPS_ARCH_ASE_M16 needs to be set in the
ELF header flags for Mips16.

Contributer: Reed Kotler

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

11 years agoRemove unneeded #includes.
Jakub Staszak [Tue, 19 Feb 2013 22:06:38 +0000 (22:06 +0000)]
Remove unneeded #includes.

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

11 years agoELF symbol table field st_other support,
Jack Carter [Tue, 19 Feb 2013 22:04:37 +0000 (22:04 +0000)]
ELF symbol table field st_other support,
excluding visibility bits.

Mips (MicroMips) specific STO handling .

The st_other field settig for STO_MIPS_MICROMIPS

Contributer: Zoran Jovanovic

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

11 years agoFix typos.
Jakub Staszak [Tue, 19 Feb 2013 22:02:21 +0000 (22:02 +0000)]
Fix typos.

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

11 years agoELF symbol table field st_other support,
Jack Carter [Tue, 19 Feb 2013 21:57:35 +0000 (21:57 +0000)]
ELF symbol table field st_other support,
excluding visibility bits.

Generic STO handling at the Target level.

The st_other field of the ELF symbol table is one
byte in size. The first 2 bytes are used for generic
visibility and are currently handled by llvm.

The other six bits are processor specific and need
to be set at the target level.

A couple of notes:

The new static methods for accessing and setting the "other"
flags in include/llvm/MC/MCELF.h match the style guide
and not the other methods in the file. I don't like the
inconsistency, but feel I should follow the prescribed
lowerUpper() convention.

STO_ value definitions are not specified in gnu land as
consistently as the STT_ and STB_ fields. Probably because
the latter were defined in a standards doc and the former
defined partially in code. I have stuck with the full byte
definition of the flags.

Contributer: Zoran Jovanovic

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

11 years agoAdd obvious constantness.
Jakub Staszak [Tue, 19 Feb 2013 21:54:59 +0000 (21:54 +0000)]
Add obvious constantness.

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

11 years agoSimplify code. No functionality change.
Jakub Staszak [Tue, 19 Feb 2013 21:49:54 +0000 (21:49 +0000)]
Simplify code. No functionality change.

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

11 years agoARM NEON: Don't need COPY_TO_REGCLASS in pattern
Arnold Schwaighofer [Tue, 19 Feb 2013 20:16:45 +0000 (20:16 +0000)]
ARM NEON: Don't need COPY_TO_REGCLASS in pattern

In my previous commit:
"Merge a f32 bitcast of a v2i32 extractelt

A vectorized sitfp on doubles will get scalarized to a sequence of an
extract_element of <2 x i32>, a bitcast to f32 and a sitofp.
Due to the the extract_element, and the bitcast we will uneccessarily generate
moves between scalar and vector registers."

I added a pattern containing a copy_to_regclass. The copy_to_regclass is
actually not needed.

radar://13191881

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

11 years agoFix a bug in mayHaveSideEffects. Functions that do not return are now considered...
Nadav Rotem [Tue, 19 Feb 2013 20:02:09 +0000 (20:02 +0000)]
Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.

rdar://13227456

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

11 years agoFix a bug that was found by the clang static analyzer. The var "AT" is null so we...
Nadav Rotem [Tue, 19 Feb 2013 19:36:59 +0000 (19:36 +0000)]
Fix a bug that was found by the clang static analyzer. The var "AT" is null so we cant deref it.

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

11 years agoWhitelist files and block devices instead of blacklisting fifos and
Dan Gohman [Tue, 19 Feb 2013 19:36:55 +0000 (19:36 +0000)]
Whitelist files and block devices instead of blacklisting fifos and
character devices.

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

11 years agoDon't trust st_size of a character device. This fixes using
Dan Gohman [Tue, 19 Feb 2013 18:57:53 +0000 (18:57 +0000)]
Don't trust st_size of a character device. This fixes using
/dev/stdin as an input when stdin is connected to a tty, for example.

No test, because it's difficult to write a reasonably portable test
for this. /dev/stdin isn't a character device when stdin is redirected
from a file or connected to a pipe.

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

11 years agoARM: Allocation hints must make sure to be in the alloc order.
Jim Grosbach [Tue, 19 Feb 2013 18:55:36 +0000 (18:55 +0000)]
ARM: Allocation hints must make sure to be in the alloc order.

When creating an allocation hint for a register pair, make sure the hint
for the physical register reference is still in the allocation order.

rdar://13240556

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

11 years agoAssert that the target provided hints are in the allocation order.
Jakob Stoklund Olesen [Tue, 19 Feb 2013 18:41:01 +0000 (18:41 +0000)]
Assert that the target provided hints are in the allocation order.

Target implementations of getRegAllocationHints() should use the
provided allocation order, and they can never return hints outside the
order. This is already documented in TargetRegisterInfo.h.

<rdar://problem/13240556>

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

11 years agoRemove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
Douglas Gregor [Tue, 19 Feb 2013 18:26:07 +0000 (18:26 +0000)]
Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.

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

11 years agoHexagon: Sync TSFlags in MCTargetDesc/HexagonBaseInfo.h with
Jyotsna Verma [Tue, 19 Feb 2013 18:18:36 +0000 (18:18 +0000)]
Hexagon: Sync TSFlags in MCTargetDesc/HexagonBaseInfo.h with
HexagonInstrFormats.td.

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

11 years agoClean up HiPE prologue emission a bit and avoid signed arithmetic tricks.
Benjamin Kramer [Tue, 19 Feb 2013 17:32:57 +0000 (17:32 +0000)]
Clean up HiPE prologue emission a bit and avoid signed arithmetic tricks.

No intended functionality change.

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

11 years agoMove LLVM_LIBRARY_VISIBILITY for consistency with what was done to
Rafael Espindola [Tue, 19 Feb 2013 17:14:33 +0000 (17:14 +0000)]
Move LLVM_LIBRARY_VISIBILITY for consistency with what was done to
PPCJITInfo.cpp in r175394.

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

11 years agoFix typo
Eli Bendersky [Tue, 19 Feb 2013 17:11:48 +0000 (17:11 +0000)]
Fix typo

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

11 years agoFix GCMetadaPrinter::finishAssembly not executed, patch by Yiannis Tsiouris.
Benjamin Kramer [Tue, 19 Feb 2013 16:51:44 +0000 (16:51 +0000)]
Fix GCMetadaPrinter::finishAssembly not executed, patch by Yiannis Tsiouris.

Due to the execution order of doFinalization functions, the GC information were
deleted before AsmPrinter::doFinalization was executed. Thus, the
GCMetadataPrinter::finishAssembly was never called.

The patch fixes that by moving the code of the GCInfoDeleter::doFinalization to
Printer::doFinalization.

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

11 years agoMake ARMAsmPrinter pass name more precise and fix comment.
Eli Bendersky [Tue, 19 Feb 2013 16:47:59 +0000 (16:47 +0000)]
Make ARMAsmPrinter pass name more precise and fix comment.

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

11 years agoMake pass name more precise and fix comment.
Eli Bendersky [Tue, 19 Feb 2013 16:38:32 +0000 (16:38 +0000)]
Make pass name more precise and fix comment.

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

11 years agoARM NEON: Merge a f32 bitcast of a v2i32 extractelt
Arnold Schwaighofer [Tue, 19 Feb 2013 15:27:05 +0000 (15:27 +0000)]
ARM NEON: Merge a f32 bitcast of a v2i32 extractelt

A vectorized sitfp on doubles will get scalarized to a sequence of an
extract_element of <2 x i32>, a bitcast to f32 and a sitofp.
Due to the the extract_element, and the bitcast we will uneccessarily generate
moves between scalar and vector registers.

The patch fixes this by using a COPY_TO_REGCLASS and a EXTRACT_SUBREG to extract
the element from the vector instead.

radar://13191881

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

11 years agoR600: Add AR_X to the R600_TReg_X register class.
Tom Stellard [Tue, 19 Feb 2013 15:22:47 +0000 (15:22 +0000)]
R600: Add AR_X to the R600_TReg_X register class.

NOTE: This is a candidate for the Mesa stable branch.

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

11 years agoR600: Mark all members of the TRegMem register class as reserved
Tom Stellard [Tue, 19 Feb 2013 15:22:45 +0000 (15:22 +0000)]
R600: Mark all members of the TRegMem register class as reserved

This stops the Machine Verifier from complaining about uses of undefined
physical registers.

NOTE: This is a candidate for the Mesa stable branch.

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

11 years agoR600: Fix scheduler crash caused by invalid MachinePointerInfo
Tom Stellard [Tue, 19 Feb 2013 15:22:44 +0000 (15:22 +0000)]
R600: Fix scheduler crash caused by invalid MachinePointerInfo

Kernel function arguments are lowered to loads from the PARAM_I address
space.  When creating these load instructions, we were initializing
their MachinePointerInfo with an Arguement object that was not attached
to any function.  This was causing the MachineScheduler to crash when
it tried to access the parent of the Arguement.

This has been fixed by initializing the MachinePointerInfo with a
UndefValue instead.

NOTE: This is a candidate for the Mesa stable branch.

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

11 years agoR600: Fix tracking of implicit defs in the IndirectAddressing pass
Tom Stellard [Tue, 19 Feb 2013 15:22:42 +0000 (15:22 +0000)]
R600: Fix tracking of implicit defs in the IndirectAddressing pass

In some cases, we were losing track of live implicit registers which
was creating dead defs and causing the scheduler to produce invalid
code.

NOTE: This is a candidate for the Mesa stable branch.

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

11 years agoFix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() is explici...
Alexey Samsonov [Tue, 19 Feb 2013 11:35:39 +0000 (11:35 +0000)]
Fix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() is explicitly called during module initialization of lib/Support/Process.cpp. It reads the field of global object PosixZeroTime, which is not guaranteed to be initialized at this point. Found by AddressSanitizer with -fsanitize=init-order option.

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

11 years ago[asan] instrument memory accesses with unusual sizes
Kostya Serebryany [Tue, 19 Feb 2013 11:29:21 +0000 (11:29 +0000)]
[asan] instrument memory accesses with unusual sizes

This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or
packed structures.
Instrumentation is done with two 1-byte checks
(first and last bytes) and if the error is found
__asan_report_load_n(addr, real_size) or
__asan_report_store_n(addr, real_size)
is called.

Also, call these two new functions in memset/memcpy
instrumentation.

asan-rt part will follow.

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

11 years agoSimplify code. No functionality change.
Jakub Staszak [Tue, 19 Feb 2013 09:48:30 +0000 (09:48 +0000)]
Simplify code. No functionality change.

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

11 years agoFix capitalization in comment to match function name.
Craig Topper [Tue, 19 Feb 2013 07:43:59 +0000 (07:43 +0000)]
Fix capitalization in comment to match function name.

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

11 years agoGrammar.
Eric Christopher [Tue, 19 Feb 2013 06:23:44 +0000 (06:23 +0000)]
Grammar.

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

11 years agoMore const correcting of stack coloring.
Craig Topper [Tue, 19 Feb 2013 06:02:40 +0000 (06:02 +0000)]
More const correcting of stack coloring.

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

11 years agoConst-correct the stack coloring code.
Craig Topper [Tue, 19 Feb 2013 05:32:02 +0000 (05:32 +0000)]
Const-correct the stack coloring code.

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

11 years agoAvoid extra DenseMap lookups in StackColoring::calculateLocalLiveness.
Craig Topper [Tue, 19 Feb 2013 04:47:31 +0000 (04:47 +0000)]
Avoid extra DenseMap lookups in StackColoring::calculateLocalLiveness.

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

11 years agoExpand pseudos/macros BteqzT8SltiX16, BteqzT8SltiuX16,
Reed Kotler [Tue, 19 Feb 2013 03:56:57 +0000 (03:56 +0000)]
Expand pseudos/macros BteqzT8SltiX16, BteqzT8SltiuX16,
BtnezT8SltiX16, BtnezT8SltiuX16 .

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

11 years agoMake the dump() function const and reduce the number of hash lookups it performs.
Craig Topper [Tue, 19 Feb 2013 03:14:22 +0000 (03:14 +0000)]
Make the dump() function const and reduce the number of hash lookups it performs.

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

11 years agoUse a reference into the BlockLiveness DenseMap to avoid repeated hash lookups in...
Craig Topper [Tue, 19 Feb 2013 03:06:17 +0000 (03:06 +0000)]
Use a reference into the BlockLiveness DenseMap to avoid repeated hash lookups in collectMarkers.

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