oota-llvm.git
9 years agoStyle fix: don't indent inside a namemespace.
Rafael Espindola [Tue, 25 Nov 2014 06:11:24 +0000 (06:11 +0000)]
Style fix: don't indent inside a namemespace.

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

9 years agoRemove a nested anonymous namespace.
Rafael Espindola [Tue, 25 Nov 2014 06:07:51 +0000 (06:07 +0000)]
Remove a nested anonymous namespace.

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

9 years agoFix overly aggressive type merging.
Rafael Espindola [Tue, 25 Nov 2014 05:59:24 +0000 (05:59 +0000)]
Fix overly aggressive type merging.

If we find out that two types are *not* isomorphic, we learn nothing about
opaque sub types in both the source and destination.

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

9 years ago[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit
Simon Atanasyan [Tue, 25 Nov 2014 05:57:55 +0000 (05:57 +0000)]
[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit

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

9 years agoLink the type of aliases.
Rafael Espindola [Tue, 25 Nov 2014 04:43:59 +0000 (04:43 +0000)]
Link the type of aliases.

They are not more or less "well typed" than GlobalVariables.

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

9 years agoDon't repeat name in comment or duplicate comment. NFC.
Rafael Espindola [Tue, 25 Nov 2014 04:28:31 +0000 (04:28 +0000)]
Don't repeat name in comment or duplicate comment. NFC.

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

9 years agoUse range loops. NFC.
Rafael Espindola [Tue, 25 Nov 2014 04:26:19 +0000 (04:26 +0000)]
Use range loops. NFC.

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

9 years ago[FastISel][AArch64] Fix and extend the tbz/tbnz pattern matching.
Juergen Ributzka [Tue, 25 Nov 2014 04:16:15 +0000 (04:16 +0000)]
[FastISel][AArch64] Fix and extend the tbz/tbnz pattern matching.

The pattern matching failed to recognize all instances of "-1", because when
comparing against "-1" we didn't use an APInt of the same bitwidth.

This commit fixes this and also adds inverse versions of the conditon to catch
more cases.

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

9 years agoAdd an interesting test that we already get right. NFC.
Rafael Espindola [Tue, 25 Nov 2014 03:47:57 +0000 (03:47 +0000)]
Add an interesting test that we already get right. NFC.

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

9 years agoInstSimplify: Handle some simple tautological comparisons
David Majnemer [Tue, 25 Nov 2014 02:55:48 +0000 (02:55 +0000)]
InstSimplify: Handle some simple tautological comparisons

This handles cases where we are comparing a masked value against itself.
The analysis could be further improved by making it recursive but such
expense is not currently justified.

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

9 years agoRevert "unique_ptrify LLVMContextImpl::CAZConstants"
David Blaikie [Tue, 25 Nov 2014 02:26:22 +0000 (02:26 +0000)]
Revert "unique_ptrify LLVMContextImpl::CAZConstants"

Missed the complexities of how these elements are destroyed.

This reverts commit r222714.

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

9 years agounique_ptrify LLVMContextImpl::CAZConstants
David Blaikie [Tue, 25 Nov 2014 02:13:54 +0000 (02:13 +0000)]
unique_ptrify LLVMContextImpl::CAZConstants

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

9 years ago[PowerPC] Add the 'attn' instruction
Hal Finkel [Tue, 25 Nov 2014 00:30:11 +0000 (00:30 +0000)]
[PowerPC] Add the 'attn' instruction

The attn instruction is not part of the Power ISA, but is documented in the A2
user manual, and is accepted by the GNU assembler for the A2 and the POWER4+.
Reported as part of PR21650.

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

9 years ago[PowerPC] Implement combineRepeatedFPDivisors
Hal Finkel [Mon, 24 Nov 2014 23:45:21 +0000 (23:45 +0000)]
[PowerPC] Implement combineRepeatedFPDivisors

This does not matter on newer cores (where we can use reciprocal estimates in
fast-math mode anyway), but for older cores this allows us to generate better
fast-math code where we have multiple FDIVs with a common divisor.

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

9 years agoFactor check for the assume intrinsic out of checks in computeKnownBitsFromAssume
Philip Reames [Mon, 24 Nov 2014 23:44:28 +0000 (23:44 +0000)]
Factor check for the assume intrinsic out of checks in computeKnownBitsFromAssume

We were matching against the assume intrinsic in every check.  Since we know that it must be an assume, this is just wasted work.  Somewhat surprisingly, matching an intrinsic id is actually relatively expensive.  It devolves to a string construction and comparison in Function::isIntrinsic.

I originally spotted this because it showed up in a performance profile of my compiler.  I've since discovered a separate issue which seems to be the actual root cause, but this is minor perf goodness regardless.

I'm likely to follow up with another change to factor out the comparison matching.  There's no need to match the compare instruction in every single one of the tests.

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

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

9 years agoIncorporate review comments from r221742
Philip Reames [Mon, 24 Nov 2014 23:24:24 +0000 (23:24 +0000)]
Incorporate review comments from r221742

This change implements the comment and style changes Sean requested during post commit review with r221742.  Sorry for the delay.

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

9 years agoBug 21610: Canonicalize min/max fcmp selects to use ordered comparisons
Matt Arsenault [Mon, 24 Nov 2014 23:15:18 +0000 (23:15 +0000)]
Bug 21610: Canonicalize min/max fcmp selects to use ordered comparisons

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

9 years agoConvert test to FileCheck and use CHECK-LABEL
Matt Arsenault [Mon, 24 Nov 2014 23:03:17 +0000 (23:03 +0000)]
Convert test to FileCheck and use CHECK-LABEL

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

9 years agoClarify wording in the LangRef around !invariant.load
Philip Reames [Mon, 24 Nov 2014 22:32:43 +0000 (22:32 +0000)]
Clarify wording in the LangRef around !invariant.load

Clarify the wording around !invariant.load to properly reflect the semantics of such loads with respect to control dependence and location lifetime.  To the best of my knowledge, the revised wording respects the actual implementation and understanding of issues involved highlighted in the recent 'Optimization hints for "constant" loads' thread on LLVMDev.

In particular, I'm aiming for the following results:
- To clarify that an invariant.load can fault and must respect control dependence.  In particular, it is not sound to unconditionally pull an invariant load out of a loop if that loop would potentially never execute.
- To clarify that the invariant nature of a given pointer does not preclude the modification of that location through a pointer which is unrelated to the load operand.  In particular, initializing a location and then passing a pointer through an opaque intrinsic which produces a new unrelated pointer, should behave as expected provided that the intrinsic is memory dependent on the initializing store.
- To clarify that storing a value to an invariant location is defined.  It can not, for example, be considered unreachable.  The value stored can be assumed to be equal to the value of any previous (or following!) invariant load, but the store itself is defined.

I recommend that anyone interested in using !invariant.load, or optimizing for them, read over the discussion in the review thread.  A number of motivating examples are discussed.

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

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

9 years agoAdd a disable-output option to the gold plugin.
Rafael Espindola [Mon, 24 Nov 2014 21:18:14 +0000 (21:18 +0000)]
Add a disable-output option to the gold plugin.

This corresponds to the opt option and is handy for profiling.

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

9 years agoRemove the unused FindUsedTypes pass.
Rafael Espindola [Mon, 24 Nov 2014 20:53:26 +0000 (20:53 +0000)]
Remove the unused FindUsedTypes pass.

It was dead since r134829.

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

9 years agoAdd and use Type::subtypes. NFC.
Rafael Espindola [Mon, 24 Nov 2014 20:44:36 +0000 (20:44 +0000)]
Add and use Type::subtypes. NFC.

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

9 years agoPass the .ll files to llvm-link directly. NFC.
Rafael Espindola [Mon, 24 Nov 2014 20:35:59 +0000 (20:35 +0000)]
Pass the .ll files to llvm-link directly. NFC.

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

9 years agoCorrect path to regression tests in ExtendingLLVM
Sergey Dmitrouk [Mon, 24 Nov 2014 19:40:07 +0000 (19:40 +0000)]
Correct path to regression tests in ExtendingLLVM

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

9 years ago[AArch64] Fix clobber computation in A57LoadBalancing pass.
Chad Rosier [Mon, 24 Nov 2014 18:57:58 +0000 (18:57 +0000)]
[AArch64] Fix clobber computation in A57LoadBalancing pass.

Extremely difficult to reproduce, so no test case included.
PR21637

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

9 years agoRemoving unused variable.
Colin LeMahieu [Mon, 24 Nov 2014 18:55:32 +0000 (18:55 +0000)]
Removing unused variable.

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

9 years ago[asan/coverage] change the way asan coverage instrumentation is done: instead of...
Kostya Serebryany [Mon, 24 Nov 2014 18:49:53 +0000 (18:49 +0000)]
[asan/coverage] change the way asan coverage instrumentation is done: instead of setting the guard to 1 in the generated code, pass the pointer to guard to __sanitizer_cov and set it there. No user-visible functionality change expected

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

9 years ago[PowerPC] Fix PR 21652 - copy st_other bits on symbol assignment
Ulrich Weigand [Mon, 24 Nov 2014 18:09:47 +0000 (18:09 +0000)]
[PowerPC] Fix PR 21652 - copy st_other bits on symbol assignment

When processing an assignment in the integrated assembler that sets
a symbol to the value of another symbol, we need to copy the st_other
bits that encode the local entry point offset.

Modeled after MipsTargetELFStreamer::emitAssignment handling of the
ELF::STO_MIPS_MICROMIPS flag.

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

9 years agoMore long path name support on Windows, this time in program execution.
Paul Robinson [Mon, 24 Nov 2014 18:05:29 +0000 (18:05 +0000)]
More long path name support on Windows, this time in program execution.
Allows long paths for the executable and redirected stdin/stdout/stderr.
Addresses PR21563.

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

9 years ago[Hexagon] Adding asrh instruction, removing unused multiclasses.
Colin LeMahieu [Mon, 24 Nov 2014 18:04:42 +0000 (18:04 +0000)]
[Hexagon] Adding asrh instruction, removing unused multiclasses.

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

9 years ago[Hexagon] Adding aslh instruction.
Colin LeMahieu [Mon, 24 Nov 2014 17:44:19 +0000 (17:44 +0000)]
[Hexagon] Adding aslh instruction.

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

9 years ago[Hexagon] Adding zxth instruction.
Colin LeMahieu [Mon, 24 Nov 2014 17:11:34 +0000 (17:11 +0000)]
[Hexagon] Adding zxth instruction.

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

9 years agoAdding const iterator to MCInst. http://reviews.llvm.org/D6359
Colin LeMahieu [Mon, 24 Nov 2014 16:50:40 +0000 (16:50 +0000)]
Adding const iterator to MCInst. reviews.llvm.org/D6359

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

9 years ago[Hexagon] Adding zxtb instruction.
Colin LeMahieu [Mon, 24 Nov 2014 16:48:43 +0000 (16:48 +0000)]
[Hexagon] Adding zxtb instruction.

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

9 years agoInstCombine: Don't create an unused instruction
David Majnemer [Mon, 24 Nov 2014 16:41:13 +0000 (16:41 +0000)]
InstCombine: Don't create an unused instruction

We would create an instruction but not inserting it.
Not inserting the unused instruction would lead us to verification
failure.

This fixes PR21653.

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

9 years ago[mips][microMIPS] Fix JRADDIUSP instruction
Jozef Kolek [Mon, 24 Nov 2014 16:14:10 +0000 (16:14 +0000)]
[mips][microMIPS] Fix JRADDIUSP instruction

Fix JRADDIUSP instruction, remove delay slot flag because this instruction
doesn't have delay slot.

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

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

9 years agoAdded comment about llvm_execute_on_thread waiting for thread to complete.
Yaron Keren [Mon, 24 Nov 2014 14:51:41 +0000 (14:51 +0000)]
Added comment about llvm_execute_on_thread waiting for thread to complete.

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

9 years ago[mips][microMIPS] Implement LBU16, LHU16, LW16, SB16, SH16 and SW16 instructions
Jozef Kolek [Mon, 24 Nov 2014 14:39:13 +0000 (14:39 +0000)]
[mips][microMIPS] Implement LBU16, LHU16, LW16, SB16, SH16 and SW16 instructions

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

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

9 years ago[mips][microMIPS] Implement 16-bit instructions registers including ZERO instead...
Jozef Kolek [Mon, 24 Nov 2014 14:25:53 +0000 (14:25 +0000)]
[mips][microMIPS] Implement 16-bit instructions registers including ZERO instead of S0

Implement microMIPS 16-bit instructions register set: $0, $2-$7 and $17.

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

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

9 years ago[Mips] Update MIPS relocations list
Simon Atanasyan [Mon, 24 Nov 2014 14:17:33 +0000 (14:17 +0000)]
[Mips] Update MIPS relocations list

No functional changes.

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

9 years agoReplace a comment that says 'unreachable' with llvm_unreachable in TableGen AsmWriter...
Craig Topper [Mon, 24 Nov 2014 14:09:52 +0000 (14:09 +0000)]
Replace a comment that says 'unreachable' with llvm_unreachable in TableGen AsmWriter output.

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

9 years agoRemoving a variable that is initialized but never read. The original author has been...
Aaron Ballman [Mon, 24 Nov 2014 14:03:16 +0000 (14:03 +0000)]
Removing a variable that is initialized but never read. The original author has been alerted to the warning, in case this variable is meant to be used. Fixes -Werror builds in the meantime.

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

9 years ago[mips][microMIPS] Implement disassembler support for 16-bit instructions
Jozef Kolek [Mon, 24 Nov 2014 13:29:59 +0000 (13:29 +0000)]
[mips][microMIPS] Implement disassembler support for 16-bit instructions

With the help of new method readInstruction16() two bytes are read and
decodeInstruction() is called with DecoderTableMicroMips16, if this fails
four bytes are read and decodeInstruction() is called with
DecoderTableMicroMips32.

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

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

9 years ago[X86] Improved target specific combine on VSELECT dag nodes.
Andrea Di Biagio [Mon, 24 Nov 2014 12:23:15 +0000 (12:23 +0000)]
[X86] Improved target specific combine on VSELECT dag nodes.

This patch teaches function 'transformVSELECTtoBlendVECTOR_SHUFFLE' how to
convert VSELECT dag nodes to shuffles on targets that do not have SSE4.1.
On pre-SSE4.1 targets, we can still perform blend operations using movss/movsd.

Also, removed a target specific combine that performed a premature lowering of
VSELECT nodes to target specific MOVSS/MOVSD nodes.

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

9 years agoInstCombine: Don't assume DataLayout is always available
David Majnemer [Mon, 24 Nov 2014 07:26:20 +0000 (07:26 +0000)]
InstCombine: Don't assume DataLayout is always available

We tried to get the result of DataLayout::getLargestLegalIntTypeSize but
we didn't have a DataLayout.  This resulted in opt crashing.

This fixes PR21651.

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

9 years agoSupport: Add *cast_or_null<> for pointer wrappers
Duncan P. N. Exon Smith [Mon, 24 Nov 2014 03:13:02 +0000 (03:13 +0000)]
Support: Add *cast_or_null<> for pointer wrappers

Fill in omission of `cast_or_null<>` and `dyn_cast_or_null<>` for types
that wrap pointers (e.g., smart pointers).

Type traits need to be slightly stricter than for `cast<>` and
`dyn_cast<>` to resolve ambiguities with simple types.

There didn't seem to be any unit tests for pointer wrappers, so I tested
`isa<>`, `cast<>`, and `dyn_cast<>` while I was in there.

This only supports pointer wrappers with a conversion to `bool` to check
for null.  If in the future it's useful to support wrappers without such
a conversion, it should be a straightforward incremental step to use the
`simplify_type` machinery for the null check.  In that case, the unit
tests should be updated to remove the `operator bool()` from the
`pointer_wrappers::PTy`.

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

9 years agoDetect best type for some static index tables instead of just using uint32_t to reduc...
Craig Topper [Mon, 24 Nov 2014 02:08:35 +0000 (02:08 +0000)]
Detect best type for some static index tables instead of just using uint32_t to reduce total data size.

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

9 years agoConverted back to Unix format (after my last commit 222632)
Elena Demikhovsky [Sun, 23 Nov 2014 15:21:53 +0000 (15:21 +0000)]
Converted back to Unix format (after my last commit 222632)

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

9 years ago[X86] Fixes bug in build_vector v4x32 lowering
Michael Kuperstein [Sun, 23 Nov 2014 13:09:06 +0000 (13:09 +0000)]
[X86] Fixes bug in build_vector v4x32 lowering

r222375 made some improvements to build_vector lowering of v4x32 and v4xf32 into an insertps, but it missed a case where:

1. A single extracted element is used twice.
2. The lower of the two non-zero indexes should be preserved, and the higher should be used for the dest mask.

This caused a crash, since the source value for the insertps ends-up uninitialized.

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

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

9 years agoAdd missing override keywords.
Craig Topper [Sun, 23 Nov 2014 09:40:13 +0000 (09:40 +0000)]
Add missing override keywords.

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

9 years agoTablegen output formatting fixes.
Craig Topper [Sun, 23 Nov 2014 09:40:10 +0000 (09:40 +0000)]
Tablegen output formatting fixes.

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

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

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

http://reviews.llvm.org/D6191

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

9 years agoR600: Fix extloads of i1 on R600/Evergreen
Matt Arsenault [Sun, 23 Nov 2014 02:57:54 +0000 (02:57 +0000)]
R600: Fix extloads of i1 on R600/Evergreen

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

9 years agoR600: Fix assert on copy of an i1 on pre-SI
Matt Arsenault [Sun, 23 Nov 2014 02:57:52 +0000 (02:57 +0000)]
R600: Fix assert on copy of an i1 on pre-SI

i1 is not a legal type on Evergreen, so this combine proceeded
and tried to produce a bitcast between i1 and i8.

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

9 years agoR600/SI: Add additional tests for i1 loads
Matt Arsenault [Sun, 23 Nov 2014 02:57:50 +0000 (02:57 +0000)]
R600/SI: Add additional tests for i1 loads

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

9 years agoR600/SI: Fix broken check lines and modernize prefixes
Matt Arsenault [Sun, 23 Nov 2014 02:57:49 +0000 (02:57 +0000)]
R600/SI: Fix broken check lines and modernize prefixes

Use -LABEL and remove -CHECK

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

9 years agoR600/SI: Fix missing -verify-machineinstrs on a test
Matt Arsenault [Sun, 23 Nov 2014 02:57:47 +0000 (02:57 +0000)]
R600/SI: Fix missing -verify-machineinstrs on a test

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

9 years agoInstCombine: Propagate exact for (sdiv X, Pow2) -> (udiv X, Pow2)
David Majnemer [Sat, 22 Nov 2014 20:00:41 +0000 (20:00 +0000)]
InstCombine: Propagate exact for (sdiv X, Pow2) -> (udiv X, Pow2)

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

9 years agoInstCombine: Propagate exact for (sdiv X, Y) -> (udiv X, Y)
David Majnemer [Sat, 22 Nov 2014 20:00:38 +0000 (20:00 +0000)]
InstCombine: Propagate exact for (sdiv X, Y) -> (udiv X, Y)

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

9 years agoInstCombine: Propagate exact for (sdiv -X, C) -> (sdiv X, -C)
David Majnemer [Sat, 22 Nov 2014 20:00:34 +0000 (20:00 +0000)]
InstCombine: Propagate exact for (sdiv -X, C) -> (sdiv X, -C)

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

9 years agoTidied up target triple OS detection. NFC
Simon Pilgrim [Sat, 22 Nov 2014 19:12:10 +0000 (19:12 +0000)]
Tidied up target triple OS detection. NFC

Use Triple::isOS*() helper functions where possible.

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

9 years agoReduce size of some tables in tablegen register info output.
Craig Topper [Sat, 22 Nov 2014 18:30:18 +0000 (18:30 +0000)]
Reduce size of some tables in tablegen register info output.

Primarily done by using SequenceToOffsetTable to reduce the register pressure set tables and then sizing the indices into the tables appropriately. Size a few other table entries based on content as well. Reduces X86RegisterInfo.o by ~9k.

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

9 years agoInstCombine: Propagate exact in (udiv (lshr X,C1),C2) -> (udiv x,C1<<C2)
David Majnemer [Sat, 22 Nov 2014 18:16:54 +0000 (18:16 +0000)]
InstCombine: Propagate exact in (udiv (lshr X,C1),C2) -> (udiv x,C1<<C2)

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

9 years ago[x86] Teach the vector shuffle yet another step of canonicalization.
Chandler Carruth [Sat, 22 Nov 2014 09:18:53 +0000 (09:18 +0000)]
[x86] Teach the vector shuffle yet another step of canonicalization.

No functionality changed yet, but this will prevent subsequent patches
from having to handle permutations of various interleaved shuffle
patterns.

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

9 years agoInstCombine: Propagate NSW/NUW for X*(1<<Y) -> X<<Y
David Majnemer [Sat, 22 Nov 2014 08:57:02 +0000 (08:57 +0000)]
InstCombine: Propagate NSW/NUW for X*(1<<Y) -> X<<Y

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

9 years agoInstCombine: Propagate NSW for -X * -Y -> X * Y
David Majnemer [Sat, 22 Nov 2014 07:25:19 +0000 (07:25 +0000)]
InstCombine: Propagate NSW for -X * -Y -> X * Y

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

9 years agoInstSimplify: Simplify (sub 0, X) -> X if it's NUW
David Majnemer [Sat, 22 Nov 2014 07:15:16 +0000 (07:15 +0000)]
InstSimplify: Simplify (sub 0, X) -> X if it's NUW

This is a generalization of the X - (0 - Y) -> X transform.

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

9 years agoInstCombine: Silence a parenthesis warning
David Majnemer [Sat, 22 Nov 2014 06:09:28 +0000 (06:09 +0000)]
InstCombine: Silence a parenthesis warning

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

9 years ago[x86] Add some tests for a common unpack pattern of vector shuffle that
Chandler Carruth [Sat, 22 Nov 2014 05:44:43 +0000 (05:44 +0000)]
[x86] Add some tests for a common unpack pattern of vector shuffle that
has a remarkably unique and efficient lowering.

While we get this some of the time already, we miss a few cases and
there wasn't a principled reason we got it. We should at least test
this. v8 already has tests for this pattern.

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

9 years agoInstCombine: Preserve nsw when folding X*(2^C) -> X << C
David Majnemer [Sat, 22 Nov 2014 04:52:55 +0000 (04:52 +0000)]
InstCombine: Preserve nsw when folding X*(2^C) -> X << C

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

9 years agoInstCombine: Preserve nsw/nuw for ((X << C2)*C1) -> (X * (C1 << C2))
David Majnemer [Sat, 22 Nov 2014 04:52:52 +0000 (04:52 +0000)]
InstCombine: Preserve nsw/nuw for ((X << C2)*C1) -> (X * (C1 << C2))

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

9 years agoInstCombine: Preserve nsw for (mul %V, -1) -> (sub 0, %V)
David Majnemer [Sat, 22 Nov 2014 04:52:38 +0000 (04:52 +0000)]
InstCombine: Preserve nsw for (mul %V, -1) -> (sub 0, %V)

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

9 years ago[InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence)
Gerolf Hoflehner [Fri, 21 Nov 2014 23:36:44 +0000 (23:36 +0000)]
[InstCombine] Re-commit of  r218721 (Optimize icmp-select-icmp sequence)

Fixes the self-host fail. Note that this commit activates dominator
analysis in the combiner by default (like the original commit did).

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

9 years agoFix transformation of add with pc argument to adr for non-immediate
Joerg Sonnenberger [Fri, 21 Nov 2014 22:39:34 +0000 (22:39 +0000)]
Fix transformation of add with pc argument to adr for non-immediate
arguments.

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

9 years ago[asan] remove old experimental code
Kostya Serebryany [Fri, 21 Nov 2014 22:34:29 +0000 (22:34 +0000)]
[asan] remove old experimental code

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

9 years agoR600/SI: Add a failing test case for offset order in ds_read2 instructions
Tom Stellard [Fri, 21 Nov 2014 22:31:47 +0000 (22:31 +0000)]
R600/SI: Add a failing test case for offset order in ds_read2 instructions

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

9 years agoR600/SI: Add an s_mov_b32 to patterns which use the M0RegClass
Tom Stellard [Fri, 21 Nov 2014 22:31:46 +0000 (22:31 +0000)]
R600/SI: Add an s_mov_b32 to patterns which use the M0RegClass

We need to use a s_mov_b32 rather than a copy, so that CSE will
eliminate redundant moves to the m0 register.

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

9 years agoR600/SI: Emit s_mov_b32 m0, -1 before every DS instruction
Tom Stellard [Fri, 21 Nov 2014 22:31:44 +0000 (22:31 +0000)]
R600/SI: Emit s_mov_b32 m0, -1 before every DS instruction

This s_mov_b32 will write to a virtual register from the M0Reg
class and all the ds instructions now take an extra M0Reg explicit
argument.

This change is necessary to prevent issues with the scheduler
mixing together instructions that expect different values in the m0
registers.

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

9 years agoR600/SI: Add SIFoldOperands pass
Tom Stellard [Fri, 21 Nov 2014 22:06:37 +0000 (22:06 +0000)]
R600/SI: Add SIFoldOperands pass

This pass attempts to fold the source operands of mov and copy
instructions into their uses.

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

9 years ago[mips][microMIPS] This patch implements functionality in MIPS delay slot
Jozef Kolek [Fri, 21 Nov 2014 22:04:35 +0000 (22:04 +0000)]
[mips][microMIPS] This patch implements functionality in MIPS delay slot
filler such as if delay slot filler have to put NOP instruction into the
delay slot of microMIPS BEQ or BNE instruction which uses the register $0,
then instead of emitting NOP this instruction is replaced by the corresponding
microMIPS compact branch instruction, i.e. BEQZC or BNEZC.

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

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

9 years agoR600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable
Tom Stellard [Fri, 21 Nov 2014 22:00:16 +0000 (22:00 +0000)]
R600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable

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

9 years agoR600/SI: Use hex notation for constant in test
Tom Stellard [Fri, 21 Nov 2014 22:00:13 +0000 (22:00 +0000)]
R600/SI: Use hex notation for constant in test

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

9 years ago[Hexagon] Adding sxth instruction.
Colin LeMahieu [Fri, 21 Nov 2014 21:54:59 +0000 (21:54 +0000)]
[Hexagon] Adding sxth instruction.

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

9 years ago[Hexagon] Adding sxtb instruction. Renaming some identically named classes that...
Colin LeMahieu [Fri, 21 Nov 2014 21:35:52 +0000 (21:35 +0000)]
[Hexagon] Adding sxtb instruction.  Renaming some identically named classes that will be removed after converting referencing defs.

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

9 years ago[asan] add statistic counter to dynamic alloca instrumentation
Kostya Serebryany [Fri, 21 Nov 2014 21:25:18 +0000 (21:25 +0000)]
[asan] add statistic counter to dynamic alloca instrumentation

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

9 years ago[Hexagon] Removing SUB_rr and replacing with A2_sub.
Colin LeMahieu [Fri, 21 Nov 2014 21:19:18 +0000 (21:19 +0000)]
[Hexagon] Removing SUB_rr and replacing with A2_sub.

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

9 years agoRemove duplication of relocation names in lib/Object/ELFYAML.cpp
Tim Northover [Fri, 21 Nov 2014 20:16:09 +0000 (20:16 +0000)]
Remove duplication of relocation names in lib/Object/ELFYAML.cpp

We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

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

9 years agoRemove duplication of relocation names in lib/Object/ELF.cpp
Tim Northover [Fri, 21 Nov 2014 20:16:07 +0000 (20:16 +0000)]
Remove duplication of relocation names in lib/Object/ELF.cpp

We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

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

9 years agoSplit ELF relocation defintions into per-architecture .def files
Tim Northover [Fri, 21 Nov 2014 20:16:02 +0000 (20:16 +0000)]
Split ELF relocation defintions into per-architecture .def files

This should allow the list of relocations for a particular
architecture to be kept in a single header rather than duplicated
whenever we need to enumerate all the relocations.

Patch by Will Newton.

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

9 years agoDebug Info: revert r222195, r222210 and r222239.
Manman Ren [Fri, 21 Nov 2014 19:55:23 +0000 (19:55 +0000)]
Debug Info: revert r222195, r222210 and r222239.

This is no longer needed after David's fix at r222377 + r222485.
rdar://18958417

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

9 years agoDisable header duplication at -Oz in loop-rotate pass.
Roman Divacky [Fri, 21 Nov 2014 19:53:24 +0000 (19:53 +0000)]
Disable header duplication at -Oz in loop-rotate pass.

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

9 years agoDebug Info: add an assertion that the context field of a global variable can not
Manman Ren [Fri, 21 Nov 2014 19:47:48 +0000 (19:47 +0000)]
Debug Info: add an assertion that the context field of a global variable can not
be a DIType with identifier.

This makes sure that there is no need to use DIScopeRef for global variable's
context.

rdar://18958417

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

9 years ago[Objective-C] Support a new special module flag that will be put into the
Manman Ren [Fri, 21 Nov 2014 19:24:55 +0000 (19:24 +0000)]
[Objective-C] Support a new special module flag that will be put into the
objc_imageinfo struct.

rdar://17954668

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

9 years agoLazyValueInfo: range'ify some for-loops. No functional change.
Hans Wennborg [Fri, 21 Nov 2014 19:07:46 +0000 (19:07 +0000)]
LazyValueInfo: range'ify some for-loops. No functional change.

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

9 years agoAdd params() to FunctionType. NFC.
Rafael Espindola [Fri, 21 Nov 2014 19:03:35 +0000 (19:03 +0000)]
Add params() to FunctionType. NFC.

While at it, also use makeArrayRef in elements().

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

9 years agoDon't repeat class/function/variable names in comments. NFC.
Sanjay Patel [Fri, 21 Nov 2014 18:58:38 +0000 (18:58 +0000)]
Don't repeat class/function/variable names in comments. NFC.

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

9 years agoLazyValueInfo: fix some typos and indentation, etc. NFC.
Hans Wennborg [Fri, 21 Nov 2014 18:58:23 +0000 (18:58 +0000)]
LazyValueInfo: fix some typos and indentation, etc. NFC.

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

9 years agoAdd and use a helper elements() to StructType. NFC.
Rafael Espindola [Fri, 21 Nov 2014 18:53:05 +0000 (18:53 +0000)]
Add and use a helper elements() to StructType. NFC.

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

9 years agoAllow multiple -debug-only args
Matthias Braun [Fri, 21 Nov 2014 18:06:09 +0000 (18:06 +0000)]
Allow multiple -debug-only args

Debug output is shown if any of the -debug-only arguments match.

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

9 years agoLess space; NFC
Sanjay Patel [Fri, 21 Nov 2014 18:05:59 +0000 (18:05 +0000)]
Less space; NFC

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