oota-llvm.git
9 years agoRemove dead code. NFC.
Rafael Espindola [Thu, 11 Dec 2014 17:17:26 +0000 (17:17 +0000)]
Remove dead code. NFC.

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

9 years ago[AVX512] Add support for 512b variable bit shift intrinsics.
Cameron McInally [Thu, 11 Dec 2014 17:13:05 +0000 (17:13 +0000)]
[AVX512] Add support for 512b variable bit shift intrinsics.

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

9 years ago[Hexagon] Ading i64 <- i32, i32 sextw pattern.
Colin LeMahieu [Thu, 11 Dec 2014 17:08:21 +0000 (17:08 +0000)]
[Hexagon] Ading i64 <- i32, i32 sextw pattern.

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

9 years ago[Hexagon] Adding encoding information for sign extend word instruction.
Colin LeMahieu [Thu, 11 Dec 2014 16:43:06 +0000 (16:43 +0000)]
[Hexagon] Adding encoding information for sign extend word instruction.

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

9 years agoOnly seek once before writing the member offsets.
Rafael Espindola [Thu, 11 Dec 2014 16:34:00 +0000 (16:34 +0000)]
Only seek once before writing the member offsets.

This cuts down the number on system calls done by a static llvm-ar producing
lib/libclangSema.a from 9164 to 442.

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

9 years agollvm-ar: close input files early.
Rafael Espindola [Thu, 11 Dec 2014 15:16:14 +0000 (15:16 +0000)]
llvm-ar: close input files early.

We already have them mapped into memory, so we can just close the file.

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

9 years agoAVX-512: Added all forms of COMPRESS instruction
Elena Demikhovsky [Thu, 11 Dec 2014 15:02:24 +0000 (15:02 +0000)]
AVX-512: Added all forms of COMPRESS instruction
+ intrinsics + tests

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

9 years ago[mips][microMIPS] Implement CodeGen support for LI16 instruction.
Jozef Kolek [Thu, 11 Dec 2014 13:56:23 +0000 (13:56 +0000)]
[mips][microMIPS] Implement CodeGen support for LI16 instruction.

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

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

9 years agoInstSimplify: Remove usesless %a parameter from tests
David Majnemer [Thu, 11 Dec 2014 12:56:17 +0000 (12:56 +0000)]
InstSimplify: Remove usesless %a parameter from tests

No functional change intended.

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

9 years agoThe inliner needs to fix up debug information for llvm.dbg.declare, not only for...
Michael Kuperstein [Thu, 11 Dec 2014 12:41:10 +0000 (12:41 +0000)]
The inliner needs to fix up debug information for llvm.dbg.declare, not only for llvm.dbg.value.

Patch by Amjad Aboud

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

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

9 years agoAdd newline missing in r224010.
Michael Kuperstein [Thu, 11 Dec 2014 11:30:20 +0000 (11:30 +0000)]
Add newline missing in r224010.

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

9 years ago[X86] When converting movs to pushes, don't assume MOVmi operand is an actual immediate
Michael Kuperstein [Thu, 11 Dec 2014 11:26:16 +0000 (11:26 +0000)]
[X86] When converting movs to pushes, don't assume MOVmi operand is an actual immediate

This should fix PR21878.

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

9 years agoBugfix in InlineSpiller::traceSiblingValue().
Patrik Hagglund [Thu, 11 Dec 2014 10:40:17 +0000 (10:40 +0000)]
Bugfix in InlineSpiller::traceSiblingValue().

Properly determine whether or not a phi was added by splitting.
Check against the current VNInfo of OrigLI instead of against the
OrigVNI argument.

Patch provided by Jonas Paulsson. Reviewed by Quentin Colombet.

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

9 years agoAVX-512: Fixed a bug in lowering setcc for MVT::i1 type
Elena Demikhovsky [Thu, 11 Dec 2014 10:21:12 +0000 (10:21 +0000)]
AVX-512: Fixed a bug in lowering setcc for MVT::i1 type

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

9 years agotest commit (spelling correction)
Kumar Sukhani [Thu, 11 Dec 2014 08:33:36 +0000 (08:33 +0000)]
test commit (spelling correction)

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

9 years agoRefactor creation of overflow result tuples in InstCombineCalls.
Erik Eckstein [Thu, 11 Dec 2014 08:02:30 +0000 (08:02 +0000)]
Refactor creation of overflow result tuples in InstCombineCalls.

Extract the creation of overflow result tuples in a separate function. NFC.

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

9 years agoUse range-based for loops. NFC
Craig Topper [Thu, 11 Dec 2014 07:04:54 +0000 (07:04 +0000)]
Use range-based for loops. NFC

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

9 years agoJust use the Module unique_ptr object directly in many places instead of separate...
Craig Topper [Thu, 11 Dec 2014 07:04:52 +0000 (07:04 +0000)]
Just use the Module unique_ptr object directly in many places instead of separate pointer that's kept in sync with it.

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

9 years agoUse unique_ptr to remove an explicit delete. Change return type to pass the unique_pt...
Craig Topper [Thu, 11 Dec 2014 07:04:46 +0000 (07:04 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.

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

9 years agoIR: Canonicalize metadata formatting, NFC
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 06:32:29 +0000 (06:32 +0000)]
IR: Canonicalize metadata formatting, NFC

Canonicalize formatting of metadata to make it easier to upgrade via
scripts -- in particular, one line per metadata definition makes it more
`sed`-able.

This is preparation for changing the assembly syntax for metadata [1].

[1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141208/248449.html

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

9 years agoReverting commit 223981, because the test that I added (incorrect-variable-debugloc1...
Ekaterina Romanova [Thu, 11 Dec 2014 06:22:35 +0000 (06:22 +0000)]
Reverting commit 223981, because the test that I added (incorrect-variable-debugloc1.ll) failed for llvm-ppc64.

The test is failing for llvm-ppc64 because for this platform the location list is not being generated at all (most likely because of the bug in PPC code optimization or generation). I will file a bug agains PPC compiler, but meanwhile, until PPC bug is fixed, I will have to revert my change.

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

9 years agoMake MultiClass::DefPrototypes own their Records to fix memory leaks.
Craig Topper [Thu, 11 Dec 2014 05:25:33 +0000 (05:25 +0000)]
Make MultiClass::DefPrototypes own their Records to fix memory leaks.

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

9 years agoReplace std::map<K, V*> with std::map<K, std::unique_ptr<V>> to handle ownership...
Craig Topper [Thu, 11 Dec 2014 05:25:30 +0000 (05:25 +0000)]
Replace std::map<K, V*> with std::map<K, std::unique_ptr<V>> to handle ownership and deletion of the values.

Ideally we would store the MultiClasses by value directly in the maps, but I had some trouble with that before and this at least fixes the leak.

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

9 years ago[X86] Add back AVX2 VR256 PMOVX patterns.
Ahmed Bougacha [Thu, 11 Dec 2014 04:32:17 +0000 (04:32 +0000)]
[X86] Add back AVX2 VR256 PMOVX patterns.

We can't reach those from zext, but other parts of the backend (the shuffle
lowering) generate 256-bit VZEXT nodes.

Fixes PR21876.

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

9 years agoFix LLVMContext to match what MDKind names that the LL parser permits. Fixes PR21799!
Nick Lewycky [Thu, 11 Dec 2014 02:10:28 +0000 (02:10 +0000)]
Fix LLVMContext to match what MDKind names that the LL parser permits. Fixes PR21799!

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

9 years agoGCStrategy should not own GCFunctionInfo
Philip Reames [Thu, 11 Dec 2014 01:47:23 +0000 (01:47 +0000)]
GCStrategy should not own GCFunctionInfo

This change moves the ownership and access of GCFunctionInfo (the object which describes the safepoints associated with a safepoint under GCRoot) to GCModuleInfo. Previously, this was owned by GCStrategy which was in turned owned by GCModuleInfo. This made GCStrategy module specific which is 'surprising' given it's name and other purposes.

There's a few more changes needed, but we're getting towards the point we can reuse GCStrategy for gc.statepoint as well.

p.s. The style of this code ends up being a mess. I was trying to move code around without otherwise changing much. Once I get the ownership structure rearranged, I will go through and fixup spacing, naming, comments etc.

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

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

9 years agoIR: Add 'invalid-' to test names for invalid assembly
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 01:34:46 +0000 (01:34 +0000)]
IR: Add 'invalid-' to test names for invalid assembly

Take the opportunity to sort these by `metadata`.

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

9 years agoLiveInterval: Use range based for loops for subregister ranges.
Matthias Braun [Thu, 11 Dec 2014 00:59:06 +0000 (00:59 +0000)]
LiveInterval: Use range based for loops for subregister ranges.

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

9 years agoTry again at sorting entries in CODE_OWNERS
Justin Bogner [Thu, 11 Dec 2014 00:52:59 +0000 (00:52 +0000)]
Try again at sorting entries in CODE_OWNERS

I apparently fail at the alphabet, E is not after G, and G isn't even
close to C. Sorry for the noise.

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

9 years agoFix some incorrectly sorted entries in CODE_OWNERS
Justin Bogner [Thu, 11 Dec 2014 00:41:15 +0000 (00:41 +0000)]
Fix some incorrectly sorted entries in CODE_OWNERS

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

9 years agoAdd code owners for profiling and coverage
Justin Bogner [Thu, 11 Dec 2014 00:37:25 +0000 (00:37 +0000)]
Add code owners for profiling and coverage

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

9 years agoARM: correctly expand LDR-lit based globals.
Tim Northover [Wed, 10 Dec 2014 23:40:50 +0000 (23:40 +0000)]
ARM: correctly expand LDR-lit based globals.

Quite a major error here: the expansions for the Pseudos with and without
folded load were mixed up. Fortunately it only affects ARM-mode, when not using
movw/movt, on Darwin. I'm guessing no-one actually uses that combination.

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

9 years agoA fix for PR21176.
Ekaterina Romanova [Wed, 10 Dec 2014 23:19:56 +0000 (23:19 +0000)]
A fix for PR21176.

DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.
The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.

Added DW_OP_stack_value to the stack.

-This line, and those below, will be ignored--

M    lib/CodeGen/AsmPrinter/DwarfDebug.cpp
A    test/DebugInfo/incorrect-variable-debugloc1.ll

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

9 years agoLiveInterval: Use more range based for loops for value numbers and segments.
Matthias Braun [Wed, 10 Dec 2014 23:07:54 +0000 (23:07 +0000)]
LiveInterval: Use more range based for loops for value numbers and segments.

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

9 years agoFix PR21694. r219517 added a use of SCEV divide in HowFarToZero computation. This...
Mark Heffernan [Wed, 10 Dec 2014 22:53:52 +0000 (22:53 +0000)]
Fix PR21694. r219517 added a use of SCEV divide in HowFarToZero computation.  This divide can produce incorrect results as we are using an unsigned divide for what should be a modular divide.  This change reverts back to a more conservative computation using trailing zeros.

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

9 years ago[Hexagon] Adding combine ri/ir instructions.
Colin LeMahieu [Wed, 10 Dec 2014 22:23:07 +0000 (22:23 +0000)]
[Hexagon] Adding combine ri/ir instructions.

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

9 years agoConstantFold: Clean up X * undef code
David Majnemer [Wed, 10 Dec 2014 21:58:17 +0000 (21:58 +0000)]
ConstantFold: Clean up X * undef code

No functional change intended.

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

9 years agoConstantFold, InstSimplify: undef >>a x can be either -1 or 0, choose 0
David Majnemer [Wed, 10 Dec 2014 21:58:15 +0000 (21:58 +0000)]
ConstantFold, InstSimplify: undef >>a x can be either -1 or 0, choose 0

Zero is usually a nicer constant to have than -1.

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

9 years agoConstantFold: an undef shift amount results in undef
David Majnemer [Wed, 10 Dec 2014 21:38:05 +0000 (21:38 +0000)]
ConstantFold: an undef shift amount results in undef

X shifted by undef results in undef because the undef value can
represent values greater than the width of the operands.

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

9 years ago[Hexagon] Adding encodings for JR class instructions. Updating complier usages.
Colin LeMahieu [Wed, 10 Dec 2014 21:24:10 +0000 (21:24 +0000)]
[Hexagon] Adding encodings for JR class instructions.  Updating complier usages.

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

9 years agoMove three methods only used by MCJIT to MCJIT.
Rafael Espindola [Wed, 10 Dec 2014 20:46:55 +0000 (20:46 +0000)]
Move three methods only used by MCJIT to MCJIT.

These methods are only used by MCJIT and are very specific to it. In fact, they
are also fairly specific to the fact that we have a dynamic linker of
relocatable objects.

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

9 years ago[AArch64] MachO large code-model: Materialize FP constants in code.
Juergen Ributzka [Wed, 10 Dec 2014 19:43:32 +0000 (19:43 +0000)]
[AArch64] MachO large code-model: Materialize FP constants in code.

In the large code model we have to first get the address of the GOT entry, load
the address of the constant, and then load the constant itself.

To avoid these loads and the GOT entry alltogether this commit changes the way
how FP constants are materialized in the large code model. The constats are now
materialized in a GPR and then bitconverted/moved into the FPR.

Reviewed by Tim Northover

Fixes rdar://problem/16572564.

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

9 years agoR600/SI: Use getTargetConstant in AdjustRegClass
Marek Olsak [Wed, 10 Dec 2014 19:25:31 +0000 (19:25 +0000)]
R600/SI: Use getTargetConstant in AdjustRegClass

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

9 years ago[Hexagon] Adding JR class predicated call reg instructions.
Colin LeMahieu [Wed, 10 Dec 2014 18:24:16 +0000 (18:24 +0000)]
[Hexagon] Adding JR class predicated call reg instructions.

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

9 years agoAdded documentation for MergeFunctions pass:
Stepan Dyatkovskiy [Wed, 10 Dec 2014 17:42:01 +0000 (17:42 +0000)]
Added documentation for MergeFunctions pass:
Pass looks for equivalent functions that are mergable and folds them.

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

9 years agoMatch new shuffle codegen for MOVHPD patterns
Sanjay Patel [Wed, 10 Dec 2014 16:58:54 +0000 (16:58 +0000)]
Match new shuffle codegen for MOVHPD patterns

Add patterns to match SSE (shufpd) and AVX (vpermilpd) shuffle codegen
when storing the high element of a v2f64. The existing patterns were
only checking for an unpckh type of shuffle.

http://llvm.org/bugs/show_bug.cgi?id=21791

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

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

9 years agoSilencing a -Wsequence-point warning, and the resulting undefined behavior. NFC.
Aaron Ballman [Wed, 10 Dec 2014 14:14:54 +0000 (14:14 +0000)]
Silencing a -Wsequence-point warning, and the resulting undefined behavior. NFC.

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

9 years agoConstantFold: div undef, 0 should fold to undef, not zero
David Majnemer [Wed, 10 Dec 2014 09:14:55 +0000 (09:14 +0000)]
ConstantFold: div undef, 0 should fold to undef, not zero

Dividing by zero yields an undefined value.

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

9 years agoInstSimplify: [al]shr exact undef, %X -> undef
David Majnemer [Wed, 10 Dec 2014 09:14:52 +0000 (09:14 +0000)]
InstSimplify: [al]shr exact undef, %X -> undef

Exact shifts always keep the non-zero bits of their input.  This means
it keeps it's undef bits.

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

9 years ago[X86] Make a code path in EltsFromConsecutiveLoads work only on vectors it expects
Michael Kuperstein [Wed, 10 Dec 2014 08:46:12 +0000 (08:46 +0000)]
[X86] Make a code path in EltsFromConsecutiveLoads work only on vectors it expects

EltsFromConsecutiveLoads was apparently only ever called for 128-bit vectors, and assumed this implicitly. r223518 started calling it for AVX-sized vectors, causing the code path that had this assumption to crash.
This adds a check to make this path fire only for 128-bit vectors.

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

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

9 years agoInstSimplify: div %X, 0 -> undef
David Majnemer [Wed, 10 Dec 2014 07:52:18 +0000 (07:52 +0000)]
InstSimplify: div %X, 0 -> undef

We already optimized rem %X, 0 to undef, we should do the same for div.

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

9 years agoUse unique_ptr instead of DeleteContainerSeconds.
Craig Topper [Wed, 10 Dec 2014 06:18:57 +0000 (06:18 +0000)]
Use unique_ptr instead of DeleteContainerSeconds.

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

9 years ago[LIT] Add support for `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`
Eric Fiselier [Wed, 10 Dec 2014 03:42:09 +0000 (03:42 +0000)]
[LIT] Add support for `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`

Summary:
This patch gives me just enough to leverage the existing functionality in `TestRunner` for use in `libc++` and `libc++abi` .

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

Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

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

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

9 years agoDataLayout: Provide nicer diagnostics for malformed strings
David Majnemer [Wed, 10 Dec 2014 02:36:41 +0000 (02:36 +0000)]
DataLayout: Provide nicer diagnostics for malformed strings

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

9 years agoAsmParser: Don't allow null bytes in BB labels
David Majnemer [Wed, 10 Dec 2014 02:10:35 +0000 (02:10 +0000)]
AsmParser: Don't allow null bytes in BB labels

Since Value objects can't have null bytes in their name, we shouldn't
allow them in the labels of basic blocks.

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

9 years agoIR: Move call to dropAllReferences() to MDNode subclasses
Duncan P. N. Exon Smith [Wed, 10 Dec 2014 01:45:04 +0000 (01:45 +0000)]
IR: Move call to dropAllReferences() to MDNode subclasses

Don't call `dropAllReferences()` from `MDNode::~MDNode()`, call it
directly from `~MDNodeFwdDecl()` and `~GenericMDNode()`.

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

9 years agoDataLayout: Be more verbose when diagnosing problems in pointer specs
David Majnemer [Wed, 10 Dec 2014 01:38:28 +0000 (01:38 +0000)]
DataLayout: Be more verbose when diagnosing problems in pointer specs

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

9 years agoI didn't intend to commit this with r223898
David Majnemer [Wed, 10 Dec 2014 01:17:48 +0000 (01:17 +0000)]
I didn't intend to commit this with r223898

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

9 years agoDataLayout: Move asserts over to report_fatal_error
David Majnemer [Wed, 10 Dec 2014 01:17:08 +0000 (01:17 +0000)]
DataLayout: Move asserts over to report_fatal_error

As indicated by the tests, it is possible to feed the AsmParser an
invalid datalayout string.  We should verify the result of parsing this
string regardless of whether or not we have assertions enabled.

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

9 years agoMachineVerifier: Allow physreg use if just a subreg is defined.
Matthias Braun [Wed, 10 Dec 2014 01:13:13 +0000 (01:13 +0000)]
MachineVerifier: Allow physreg use if just a subreg is defined.

We can't mark partially undefined registers, so we have to allow reading
a register in the machine verifier if just parts of a register are
defined.

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

9 years agoMachineVerifier: Allow LiveInterval segments to end at a partial write.
Matthias Braun [Wed, 10 Dec 2014 01:13:11 +0000 (01:13 +0000)]
MachineVerifier: Allow LiveInterval segments to end at a partial write.

In the subregister liveness tracking case we do not create implicit
reads on partial register writes anymore, still we need to produce a new
SSA value for partial writes so the live segment has to end.

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

9 years agoVirtRegMap: Improve block live-in info if subregister liveness is available.
Matthias Braun [Wed, 10 Dec 2014 01:13:08 +0000 (01:13 +0000)]
VirtRegMap: Improve block live-in info if subregister liveness is available.

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

9 years agoMCRegisterInfo: Add MCSubRegIndexIterator.
Matthias Braun [Wed, 10 Dec 2014 01:13:06 +0000 (01:13 +0000)]
MCRegisterInfo: Add MCSubRegIndexIterator.

This iterator iterates over subregister and their associated subregister indices
at the same time.

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

9 years agoVirtRegMap: No implicit defs/uses for super registers with subreg liveness tracking.
Matthias Braun [Wed, 10 Dec 2014 01:13:04 +0000 (01:13 +0000)]
VirtRegMap: No implicit defs/uses for super registers with subreg liveness tracking.

Adding the implicit defs/uses to the superregisters is semantically questionable
but was not dangerous before as the register allocator never assigned the same
register to two overlapping LiveIntervals even when the actually live
subregisters do not overlap. With subregister liveness tracking enabled this
does actually happen and leads to subsequent bugs if we don't stop adding
the superregister defs/uses.

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

9 years agoLiveRegMatrix: Respect subregister liveness when allocating registers.
Matthias Braun [Wed, 10 Dec 2014 01:13:01 +0000 (01:13 +0000)]
LiveRegMatrix: Respect subregister liveness when allocating registers.

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

9 years agoLiveIntervalUnion: Allow specification of liverange when unifying/extracting.
Matthias Braun [Wed, 10 Dec 2014 01:12:59 +0000 (01:12 +0000)]
LiveIntervalUnion: Allow specification of liverange when unifying/extracting.

This allows it to add subregister ranges into the union.

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

9 years agoTablegen'erate lanemasks for register units.
Matthias Braun [Wed, 10 Dec 2014 01:12:56 +0000 (01:12 +0000)]
Tablegen'erate lanemasks for register units.

Now we can relate lanemasks in a virtual register to register units.

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

9 years agoRegisterCoalescer: Preserve subregister liveranges.
Matthias Braun [Wed, 10 Dec 2014 01:12:52 +0000 (01:12 +0000)]
RegisterCoalescer: Preserve subregister liveranges.

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

9 years agoLiveInterval: Add removeEmptySubRanges().
Matthias Braun [Wed, 10 Dec 2014 01:12:40 +0000 (01:12 +0000)]
LiveInterval: Add removeEmptySubRanges().

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

9 years agoLiveIntervalAnalysis: Add subregister aware variants pruneValue().
Matthias Braun [Wed, 10 Dec 2014 01:12:36 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Add subregister aware variants pruneValue().

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

9 years agoLiveInterval: Introduce LiveQuery accessor for dead or live out values.
Matthias Braun [Wed, 10 Dec 2014 01:12:33 +0000 (01:12 +0000)]
LiveInterval: Introduce LiveQuery accessor for dead or live out values.

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

9 years agoAdd a flag to enable/disable subregister liveness.
Matthias Braun [Wed, 10 Dec 2014 01:12:30 +0000 (01:12 +0000)]
Add a flag to enable/disable subregister liveness.

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

9 years agoLiveIntervalAnalysis: Adapt repairIntervalsInRange() to subregister liveness.
Matthias Braun [Wed, 10 Dec 2014 01:12:26 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Adapt repairIntervalsInRange() to subregister liveness.

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

9 years agoLiveRangeEdit: Adapt eliminateDeadDef() to subregister liveness.
Matthias Braun [Wed, 10 Dec 2014 01:12:23 +0000 (01:12 +0000)]
LiveRangeEdit: Adapt eliminateDeadDef() to subregister liveness.

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

9 years agoLiveIntervalAnalysis: Adapt handleMove() to subregister ranges.
Matthias Braun [Wed, 10 Dec 2014 01:12:20 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Adapt handleMove() to subregister ranges.

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

9 years agoLiveIntervalAnalysis: Update SubRanges in shrinkToUses().
Matthias Braun [Wed, 10 Dec 2014 01:12:18 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Update SubRanges in shrinkToUses().

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

9 years agoLiveIntervalAnalysis: Make computeDeadValues() private.
Matthias Braun [Wed, 10 Dec 2014 01:12:15 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Make computeDeadValues() private.

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

9 years agoLiveIntervalAnalysis: Compute subregister ranges.
Matthias Braun [Wed, 10 Dec 2014 01:12:12 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Compute subregister ranges.

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

9 years agoLiveInterval: Add support to track liveness of subregisters.
Matthias Braun [Wed, 10 Dec 2014 01:12:10 +0000 (01:12 +0000)]
LiveInterval: Add support to track liveness of subregisters.

This code adds the required data structures. Algorithms to compute it follow.

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

9 years agoLiveInterval: Add a 'covers' operation to LiveRange.
Matthias Braun [Wed, 10 Dec 2014 01:12:06 +0000 (01:12 +0000)]
LiveInterval: Add a 'covers' operation to LiveRange.

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

9 years agoLiveInterval: Add const version of LiveRange::advanceTo().
Matthias Braun [Wed, 10 Dec 2014 01:12:02 +0000 (01:12 +0000)]
LiveInterval: Add const version of LiveRange::advanceTo().

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

9 years agoAdd function that translates subregister lane masks to other subregs.
Matthias Braun [Wed, 10 Dec 2014 01:12:00 +0000 (01:12 +0000)]
Add function that translates subregister lane masks to other subregs.

This works like the composeSubRegisterIndices() function but transforms
a subregister lane mask instead of a subregister index.

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

9 years agoLet tablegen compute maximum lanemask for regs/regclasses.
Matthias Braun [Wed, 10 Dec 2014 01:11:56 +0000 (01:11 +0000)]
Let tablegen compute maximum lanemask for regs/regclasses.

Let tablegen compute the combination of subregister lanemasks for all
subregisters in a register/register class. This is preparation for further
work subregister allocation

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

9 years agoAsmParser: Don't crash if a null byte is inside a quoted string
David Majnemer [Wed, 10 Dec 2014 00:43:17 +0000 (00:43 +0000)]
AsmParser: Don't crash if a null byte is inside a quoted string

We don't allow Value* to have names which contain null bytes.  The
AsmParser should reject .ll files that try to do this.

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

9 years agoExtend some comments around GCModuleInfo, GCFunctionInfo, & GCStrategy
Philip Reames [Wed, 10 Dec 2014 00:30:11 +0000 (00:30 +0000)]
Extend some comments around GCModuleInfo, GCFunctionInfo, & GCStrategy

Nothing particularly interesting here, just documenting the way the code currently works before I start changing it...

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

9 years agocmake: Make SVNVersion.inc work on Windows if svn is called svn.bat.
Nico Weber [Wed, 10 Dec 2014 00:10:21 +0000 (00:10 +0000)]
cmake: Make SVNVersion.inc work on Windows if svn is called svn.bat.

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

9 years agoSimplify the handling of aliases in the gold plugin.
Rafael Espindola [Wed, 10 Dec 2014 00:09:35 +0000 (00:09 +0000)]
Simplify the handling of aliases in the gold plugin.

The complicated situation is when we have to keep an alias but drop a GV
that is part of the aliasee.

We used to clone the dropped GV and make the clone internal. This is wasteful
as we know the original will be dropped.

With this patch what is done instead is set the linkage of the original to
internal and replace all uses (but the one in the alias) with a new
declaration that takes the name of the old GV. This saves us from having
to copy the body.

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

9 years ago[ARM] Combine base-updating/post-incrementing vector load/stores.
Ahmed Bougacha [Wed, 10 Dec 2014 00:07:37 +0000 (00:07 +0000)]
[ARM] Combine base-updating/post-incrementing vector load/stores.

We used to only combine intrinsics, and turn them into VLD1_UPD/VST1_UPD
when the base pointer is incremented after the load/store.

We can do the same thing for generic load/stores.

Note that we can only combine the first load/store+adds pair in
a sequence (as might be generated for a v16f32 load for instance),
because other combines turn the base pointer addition chain (each
computing the address of the next load, from the address of the last
load) into independent additions (common base pointer + this load's
offset).

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

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

9 years agoRemove the Module pointer from GCStrategy and GCMetadataPrinter
Philip Reames [Tue, 9 Dec 2014 23:57:54 +0000 (23:57 +0000)]
Remove the Module pointer from GCStrategy and GCMetadataPrinter

In the current implementation, GCStrategy is a part of the ownership structure for the gc metadata which describes a Module. It also contains a reference to the module in question. As a result, GCStrategy instances are essentially Module specific.

I plan to transition away from this design. Instead, a GCStrategy will be owned by the LLVMContext. It will be a lightweight policy object which contains no information about the Modules or Functions involved, but can be easily reached given a Function.

The first step in this transition is to remove the direct Module reference from GCStrategy. This also requires removing the single user of this reference, the GCMetadataPrinter hierarchy. In theory, this will allow the lifetime of the printers to be scoped to the LLVMContext as well, but in practice, I'm not actually changing that. (Yet?)

An alternate design would have been to move the direct Module reference into the GCMetadataPrinter and change the keying of the owning maps to explicitly key off both GCStrategy and Module. I'm open to doing it that way instead, but didn't see much value in preserving the per Module association for GCMetadataPrinters.

The next change in this sequence will be to start unwinding the intertwined ownership between GCStrategy, GCModuleInfo, and GCFunctionInfo.

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

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

9 years agoIR: Fix memory corruption in MDNode new/delete
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 23:56:39 +0000 (23:56 +0000)]
IR: Fix memory corruption in MDNode new/delete

There were two major problems with `MDNode` memory management.

 1. `MDNode::operator new()` called a placement array constructor for
    `MDOperand`.  What?  Each operand needs to be placed individually.

 2. `MDNode::operator delete()` failed to destruct the `MDOperand`s at
    all.

Frankly it's hard to understand how this worked locally, how this
survived an LTO bootstrap, or how it worked on most of the bots.

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

9 years agoForgot to add test for r223856
David Majnemer [Tue, 9 Dec 2014 23:51:14 +0000 (23:51 +0000)]
Forgot to add test for r223856

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

9 years agoAsmParser: Verifier that the contents of a hex integer are hex
David Majnemer [Tue, 9 Dec 2014 23:50:38 +0000 (23:50 +0000)]
AsmParser: Verifier that the contents of a hex integer are hex

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

9 years agoRename static functiom "map" to be more descriptive and to avoid
Kaelyn Takata [Tue, 9 Dec 2014 23:32:46 +0000 (23:32 +0000)]
Rename static functiom "map" to be more descriptive and to avoid
potential confusion with the std::map type.

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

9 years agoIR: Metadata: Detect an RAUW recursion
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 23:04:59 +0000 (23:04 +0000)]
IR: Metadata: Detect an RAUW recursion

Speculatively handle a recursion in
`GenericMDNode::handleChangedOperand()`.  I'm hoping this fixes the
failing hexagon bot [1].

[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/13434

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

9 years agoRemove redundant variable.
Michael Zolotukhin [Tue, 9 Dec 2014 22:45:07 +0000 (22:45 +0000)]
Remove redundant variable.

Tested by adding assert(LoopVectorPreHeader == VecPreheader) on LLVM
test suite and SPECs.

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

9 years ago[Hexagon] [NFC] Cleaning up unused classes.
Colin LeMahieu [Tue, 9 Dec 2014 22:33:26 +0000 (22:33 +0000)]
[Hexagon] [NFC] Cleaning up unused classes.

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

9 years ago[ARM] Make testcase more explicit. NFC.
Ahmed Bougacha [Tue, 9 Dec 2014 22:08:57 +0000 (22:08 +0000)]
[ARM] Make testcase more explicit. NFC.

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

9 years ago[ARM] Factor out base-updating VLD/VST combiner function. NFC.
Ahmed Bougacha [Tue, 9 Dec 2014 21:30:00 +0000 (21:30 +0000)]
[ARM] Factor out base-updating VLD/VST combiner function. NFC.

Move the combiner-state check into another function, add a few
small comments, and use a more general type in a cast<>.

In preparation for a future patch.

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

9 years ago[ARM] Move the store combiner function down. NFC.
Ahmed Bougacha [Tue, 9 Dec 2014 21:26:53 +0000 (21:26 +0000)]
[ARM] Move the store combiner function down. NFC.

And flip its final condition.
In preparation for a future patch.

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

9 years ago[ARM] Also support v2f64 vld1/vst1.
Ahmed Bougacha [Tue, 9 Dec 2014 21:25:00 +0000 (21:25 +0000)]
[ARM] Also support v2f64 vld1/vst1.

It was missing from the VLD1/VST1 handling logic, even though the
corresponding instructions exist (same form as v2i64).

In preparation for a future patch.

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