OSDN Git Service

android-x86/external-llvm.git
7 years ago[AArch64] Rename 'no-quad-ldst-pairs' to 'slow-paired-128'
Evandro Menezes [Tue, 24 Jan 2017 17:34:31 +0000 (17:34 +0000)]
[AArch64] Rename 'no-quad-ldst-pairs' to 'slow-paired-128'

In order to follow the pattern of the existing 'slow-misaligned-128store'
option, rename the option 'no-quad-ldst-pairs' to 'slow-paired-128'.

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

7 years ago[Lanai] Rename LanaiInstPrinter library to LanaiAsmPrinter
Chris Bieneman [Tue, 24 Jan 2017 17:27:01 +0000 (17:27 +0000)]
[Lanai] Rename LanaiInstPrinter library to LanaiAsmPrinter

Summary:
    This is in keeping with LLVM convention. The classes are InstPrinters, but the library is ${target}AsmPrinter.

This patch is in response to bryant pointing out to me that Lanai was the only backend deviating from convention here. Thanks!

Reviewers: jpienaar, bryant

Subscribers: mgorny, jgosnell, llvm-commits

Differential Revision: https://reviews.llvm.org/D29043

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

7 years ago[InstSimplify] try to eliminate icmp Pred (add nsw X, C1), C2
Sanjay Patel [Tue, 24 Jan 2017 17:03:24 +0000 (17:03 +0000)]
[InstSimplify] try to eliminate icmp Pred (add nsw X, C1), C2

I was surprised to see that we're missing icmp folds based on 'add nsw' in InstCombine,
but we should handle the InstSimplify cases first because that could make the InstCombine
code simpler.

Here are Alive-based proofs for the logic:

Name: add_neg_constant
Pre: C1 < 0 && (C2 > ((1<<(width(C1)-1)) + C1))
%a = add nsw i7 %x, C1
%b = icmp sgt %a, C2
  =>
%b = false

Name: add_pos_constant
Pre: C1 > 0 && (C2 < ((1<<(width(C1)-1)) + C1 - 1))
%a = add nsw i6 %x, C1
%b = icmp slt %a, C2
  =>
%b = false

Name: nuw
Pre: C1 u>= C2
%a = add nuw i11 %x, C1
%b = icmp ult %a, C2
  =>
%b = false

Differential Revision: https://reviews.llvm.org/D29053

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

7 years ago[X86][AVX2] Regenerate test.
Simon Pilgrim [Tue, 24 Jan 2017 16:58:22 +0000 (16:58 +0000)]
[X86][AVX2] Regenerate test.

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

7 years ago[CodeView] Fix off-by-one error in def range gap emission
Reid Kleckner [Tue, 24 Jan 2017 16:57:55 +0000 (16:57 +0000)]
[CodeView] Fix off-by-one error in def range gap emission

Also fixes a much worse bug where we emitted the wrong gap size for the
def range uncovered by the test for this issue.

Fixes PR31726.

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

7 years ago[X86][AVX2] Removed FIXME comment and regenerated test.
Simon Pilgrim [Tue, 24 Jan 2017 16:56:23 +0000 (16:56 +0000)]
[X86][AVX2] Removed FIXME comment and regenerated test.

The comment talked about replacing vpmovzxwd+vpslld+vpsrad with vpmovsxwd - which isn't valid as we're sign extending a <8 x i1> bool vector not an all/nobits <8 x i16>

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

7 years ago[X86][AVX2] Cleaned up test triple and regenerated tests.
Simon Pilgrim [Tue, 24 Jan 2017 16:53:09 +0000 (16:53 +0000)]
[X86][AVX2] Cleaned up test triple and regenerated tests.

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

7 years ago[SelectionDAG] Handle inverted conditions when splitting into multiple branches.
Geoff Berry [Tue, 24 Jan 2017 16:36:07 +0000 (16:36 +0000)]
[SelectionDAG] Handle inverted conditions when splitting into multiple branches.

Summary:
When conditional branches with complex conditions are split into
multiple branches in SelectionDAGBuilder::FindMergedConditions, also
handle inverted conditions.  These may sometimes appear without having
been optimized by InstCombine when CodeGenPrepare decides to sink and
duplicate cmp instructions, causing them to have only one use.  This
problem can be increased by e.g. GVNHoist hiding more cmps from
InstCombine by combining equivalent cmps from different blocks.

For example codegen X & !(Y | Z) as:
    jmp_if_X TmpBB
    jmp FBB
  TmpBB:
    jmp_if_notY Tmp2BB
    jmp FBB
  Tmp2BB:
    jmp_if_notZ TBB
    jmp FBB

Reviewers: bogner, MatzeB, qcolombet

Subscribers: llvm-commits, hiraditya, mcrosier, sebpop

Differential Revision: https://reviews.llvm.org/D28380

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

7 years agoRevert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
Alex Lorenz [Tue, 24 Jan 2017 16:17:04 +0000 (16:17 +0000)]
Revert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
and UNSUPPORTED"

After r292904 llvm-lit fails to emit the test results in the XML format for
Apple's internal buildbots.

rdar://30164800

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

7 years ago[X86][AVX512] Remove unused argument from PMOVX tablegen patterns. NFCI.
Simon Pilgrim [Tue, 24 Jan 2017 16:16:29 +0000 (16:16 +0000)]
[X86][AVX512] Remove unused argument from PMOVX tablegen patterns. NFCI.

Seems to be a copy+paste legacy from the AVX2 patterns.

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

7 years agoFix formating in foldSelectCttzCtlz. NFC
Amaury Sechet [Tue, 24 Jan 2017 14:22:27 +0000 (14:22 +0000)]
Fix formating in foldSelectCttzCtlz. NFC

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

7 years agoImprove comment for ISD::EXTRACT_VECTOR_ELT
Jonas Paulsson [Tue, 24 Jan 2017 14:21:29 +0000 (14:21 +0000)]
Improve comment for ISD::EXTRACT_VECTOR_ELT

The comment in ISDOpcodes.h for EXTRACT_VECTOR_ELT now explains that the high
bits are undefined if the result is extended.

Review: Hal Finkel

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

7 years ago[PH] Replace uses of AssertingVH from members of analysis results with
Chandler Carruth [Tue, 24 Jan 2017 12:55:57 +0000 (12:55 +0000)]
[PH] Replace uses of AssertingVH from members of analysis results with
a lazy-asserting PoisoningVH.

AssertVH is fundamentally incompatible with cache-invalidation of
analysis results. The invaliadtion happens after the AssertingVH has
already fired. Instead, use a PoisoningVH that will assert if the
dangling handle is ever used rather than merely be assigned or
destroyed.

This patch also removes all of the (numerous) doomed attempts to work
around this fundamental incompatibility. It is a pretty significant
simplification IMO.

The most interesting change is in the Inliner where we still do some
clearing because we don't want to rely on the coarse grained
invalidation strategy of the containing pass manager. However, I prefer
the approach that contains this logic to the cleanup phase of the
Inliner, and I think we could enhance the CGSCC analysis management
layer to make this even better in the future if desired.

The rest is straight cleanup.

I've also added a test for one of the harder cases to work around: when
a *module analysis* contains many AssertingVHes pointing at functions.

Differential Revision: https://reviews.llvm.org/D29006

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

7 years ago[PM] Introduce a PoisoningVH as a (more expensive) alternative to
Chandler Carruth [Tue, 24 Jan 2017 12:34:47 +0000 (12:34 +0000)]
[PM] Introduce a PoisoningVH as a (more expensive) alternative to
AssertingVH that delays any reported error until the handle is *used*.

This allows data structures to contain handles which become dangling
provided the data structure is cleaned up afterward rather than used for
anything interesting.

The implementation is moderately horrible in part because it works to
leave AssertingVH in place, undisturbed. If at some point there is
consensus that this is simply how AssertingVH should be used, it can be
substantially simplified.

This remains a boring pointer in a non-asserts build as you would
expect. The only place we pay cost is in asserts builds.

I plan to use this as a basis for replacing the asserting VHs that
currently dangle in the new PM until invalidation occurs in both LVI and
SCEV.

Differential Revision: https://reviews.llvm.org/D29061

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

7 years ago[X86][SSE] Add explicit braces to avoid -Wdangling-else warning.
Martin Bohme [Tue, 24 Jan 2017 12:31:30 +0000 (12:31 +0000)]
[X86][SSE] Add explicit braces to avoid -Wdangling-else warning.

Reviewers: RKSimon

Subscribers: llvm-commits, igorb

Differential Revision: https://reviews.llvm.org/D29076

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

7 years ago[AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.
Artem Tamazov [Tue, 24 Jan 2017 12:22:01 +0000 (12:22 +0000)]
[AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.

Each test contains 20-30K test cases but takes only several (from 4 to 10)
seconds to complete on average machine. The tests cover the majority of
AMDGPU Gfx7/Gfx8 instructions, including many dark corners, and intended
to quickly find out if something is broken.

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

7 years agoFix unused variable warning
Simon Pilgrim [Tue, 24 Jan 2017 11:54:27 +0000 (11:54 +0000)]
Fix unused variable warning

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

7 years ago[X86][SSE] Add support for constant folding vector arithmetic shift by immediates
Simon Pilgrim [Tue, 24 Jan 2017 11:46:13 +0000 (11:46 +0000)]
[X86][SSE] Add support for constant folding vector arithmetic shift by immediates

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

7 years agoFix fs::set_current_path unit test
Pavel Labath [Tue, 24 Jan 2017 11:35:26 +0000 (11:35 +0000)]
Fix fs::set_current_path unit test

The test fails when there is a symlink on the path because then the path
returned by current_path will not match the one we have set. Instead of
doing a string match check the unique id of the two files.

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

7 years ago[X86][SSE] Add support for constant folding vector logical shift by immediates
Simon Pilgrim [Tue, 24 Jan 2017 11:21:57 +0000 (11:21 +0000)]
[X86][SSE] Add support for constant folding vector logical shift by immediates

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

7 years ago[InstCombine][X86] MULDQ/MULUDQ undef -> zero
Simon Pilgrim [Tue, 24 Jan 2017 11:07:41 +0000 (11:07 +0000)]
[InstCombine][X86] MULDQ/MULUDQ undef -> zero

Added early out for single undef input - we were already supporting (and testing) this in the constant folding code, we just do it quicker now

Drop undef handling from demanded elts code now that we handle it fully in InstCombiner::visitCallInst

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

7 years ago[Support] Use O_CLOEXEC only when declared
Pavel Labath [Tue, 24 Jan 2017 10:57:01 +0000 (10:57 +0000)]
[Support] Use O_CLOEXEC only when declared

Summary:
Use the O_CLOEXEC flag only when it is available. Some old systems (e.g.
SLES10) do not support this flag. POSIX explicitly guarantees that this
flag can be checked for using #if, so there is no need for a CMake
check.

In case O_CLOEXEC is not supported, fall back to fcntl(FD_CLOEXEC)
instead.

Reviewers: rnk, rafael, mgorny

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D28894

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

7 years ago[SLP] Additional test for checking that instruction with extra args is
Alexey Bataev [Tue, 24 Jan 2017 10:44:00 +0000 (10:44 +0000)]
[SLP] Additional test for checking that instruction with extra args is
not reconstructed.

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

7 years ago[Support] Add sys::fs::set_current_path() (aka chdir)
Pavel Labath [Tue, 24 Jan 2017 10:32:03 +0000 (10:32 +0000)]
[Support] Add sys::fs::set_current_path() (aka chdir)

Summary:
This adds a cross-platform way of setting the current working directory
analogous to the existing current_path() function used for retrieving
it. The function will be used in lldb.

Reviewers: rafael, silvas, zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29035

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

7 years ago[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
Greg Parker [Tue, 24 Jan 2017 09:58:02 +0000 (09:58 +0000)]
[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED

A `lit` condition line is now a comma-separated list of boolean expressions.
Comma-separated expressions act as if each expression were on its own
condition line:
For REQUIRES, if every expression is true then the test will run.
For UNSUPPORTED, if every expression is false then the test will run.
For XFAIL, if every expression is false then the test is expected to succeed.
As a special case "XFAIL: *" expects the test to fail.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 && apple && !macosx
# Test is unsupported on Windows and on non-Ubuntu Linux
# and supported everywhere else
UNSUPPORTED: linux && !ubuntu, system-windows

Syntax:
* '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false.
* Each test feature is a true identifier.
* Substrings of the target triple are true identifiers for UNSUPPORTED
 and XFAIL, but not for REQUIRES. (This matches the current behavior.)
* All other identifiers are false.
* Identifiers are [-+=._a-zA-Z0-9]+

Differential Revision: https://reviews.llvm.org/D18185

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

7 years agoRevert "[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED"
Greg Parker [Tue, 24 Jan 2017 08:58:20 +0000 (08:58 +0000)]
Revert "[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED"

This change needs to be better-coordinated with libc++.

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

7 years ago[SLP] Refactoring of HorizontalReduction class, NFC.
Alexey Bataev [Tue, 24 Jan 2017 08:57:17 +0000 (08:57 +0000)]
[SLP] Refactoring of HorizontalReduction class, NFC.

Removed data members ReduxWidth and MinVecRegSize + some C++11 stylish
improvements.

Differential Revision: https://reviews.llvm.org/D29010

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

7 years ago[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
Greg Parker [Tue, 24 Jan 2017 08:45:50 +0000 (08:45 +0000)]
[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED

A `lit` condition line is now a comma-separated list of boolean expressions.
Comma-separated expressions act as if each expression were on its own
condition line:
For REQUIRES, if every expression is true then the test will run.
For UNSUPPORTED, if every expression is false then the test will run.
For XFAIL, if every expression is false then the test is expected to succeed.
As a special case "XFAIL: *" expects the test to fail.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 && apple && !macosx
# Test is unsupported on Windows and on non-Ubuntu Linux
# and supported everywhere else
UNSUPPORTED: linux && !ubuntu, system-windows

Syntax:
* '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false.
* Each test feature is a true identifier.
* Substrings of the target triple are true identifiers for UNSUPPORTED
  and XFAIL, but not for REQUIRES. (This matches the current behavior.)
* All other identifiers are false.
* Identifiers are [-+=._a-zA-Z0-9]+

Differential Revision: https://reviews.llvm.org/D18185

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

7 years agoUpdate domtree incrementally in loop peeling.
Serge Pavlov [Tue, 24 Jan 2017 06:58:39 +0000 (06:58 +0000)]
Update domtree incrementally in loop peeling.

With this change dominator tree remains in sync after each step of loop
peeling.

Differential Revision: https://reviews.llvm.org/D29029

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

7 years ago[X86] Remove unnecessary peakThroughBitcasts call that's already take care of by...
Craig Topper [Tue, 24 Jan 2017 06:57:29 +0000 (06:57 +0000)]
[X86] Remove unnecessary peakThroughBitcasts call that's already take care of by the ISD::isBuildVectorAllOnes check below.

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

7 years agoAMDGPU : Add trap handler support.
Wei Ding [Tue, 24 Jan 2017 06:41:21 +0000 (06:41 +0000)]
AMDGPU : Add trap handler support.

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

7 years ago[AVX-512] Simplify multiclasses for integer logic operations. There were several...
Craig Topper [Tue, 24 Jan 2017 06:25:34 +0000 (06:25 +0000)]
[AVX-512] Simplify multiclasses for integer logic operations. There were several inputs that didn't vary.

While there give them the same scheduling itinerary as the SSE/AVX versions.

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

7 years ago[Orc][RPC] Refactor ParallelCallGroup to decouple it from RPCEndpoint.
Lang Hames [Tue, 24 Jan 2017 06:13:47 +0000 (06:13 +0000)]
[Orc][RPC] Refactor ParallelCallGroup to decouple it from RPCEndpoint.

This refactor allows parallel calls to be made via an arbitrary async call
dispatcher. In particular, this allows ParallelCallGroup to be used with
derived RPC classes that expose custom async RPC call operations.

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

7 years agoMake VerifyDomInfo and VerifyLoopInfo global variables
Serge Pavlov [Tue, 24 Jan 2017 05:52:07 +0000 (05:52 +0000)]
Make VerifyDomInfo and VerifyLoopInfo global variables

Verifications of dominator tree and loop info are expensive operations
so they are disabled by default. They can be enabled by command line
options -verify-dom-info and -verify-loop-info. These options however
enable checks only in files Dominators.cpp and LoopInfo.cpp. If some
transformation changes dominaror tree and/or loop info, it would be
convenient to place similar checks to the files implementing the
transformation.

This change makes corresponding flags global, so they can be used in
any file to optionally turn verification on.

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

7 years ago[SystemZ] Gracefully fail in GeneralShuffle::add() instead of assertion.
Jonas Paulsson [Tue, 24 Jan 2017 05:43:03 +0000 (05:43 +0000)]
[SystemZ] Gracefully fail in GeneralShuffle::add() instead of assertion.

The GeneralShuffle::add() method used to have an assert that made sure that
source elements were at least as big as the destination elements. This was
wrong, since it is actually expected that an EXTRACT_VECTOR_ELT node with a
smaller source element type than the return type gets extended.

Therefore, instead of asserting this, it is just checked and if this is the
case 'false' is returned from the GeneralShuffle::add() method. This case
should be very rare and is not handled further by the backend.

Review: Ulrich Weigand.

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

7 years ago[PM] Further fixes to the test case in r292863.
Chandler Carruth [Tue, 24 Jan 2017 05:30:41 +0000 (05:30 +0000)]
[PM] Further fixes to the test case in r292863.

This should hopefully fix the MSVC failures remaining.

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

7 years ago[Orc][RPC] Refactor some common remote-function-id negotiation code.
Lang Hames [Tue, 24 Jan 2017 05:30:08 +0000 (05:30 +0000)]
[Orc][RPC] Refactor some common remote-function-id negotiation code.

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

7 years agoAdd test for default construction coverage of DenseSet iterators.
Dean Michael Berris [Tue, 24 Jan 2017 05:29:40 +0000 (05:29 +0000)]
Add test for default construction coverage of DenseSet iterators.

This is a follow-up to D28999.

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

7 years ago[X86] Don't split v8i32 all ones values if only AVX1 is available. Keep it intact...
Craig Topper [Tue, 24 Jan 2017 04:33:03 +0000 (04:33 +0000)]
[X86] Don't split v8i32 all ones values if only AVX1 is available. Keep it intact and split it at isel.

This allows us to remove the check in ANDN combining that had to look through the extraction.

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

7 years agoAllow DenseSet::iterators to be conveted to and compared with const_iterator
Dean Michael Berris [Tue, 24 Jan 2017 04:11:18 +0000 (04:11 +0000)]
Allow DenseSet::iterators to be conveted to and compared with const_iterator

Summary:
This seemed to be an oversight seeing as DenseMap has these conversions.

This patch does the following:
- Adds a default constructor to the iterators.
- Allows DenseSet::ConstIterators to be copy constructed from DenseSet::Iterators
- Allows mutual comparison between Iterators and ConstIterators.

All of these are available in the DenseMap implementation, so the implementation here is trivial.

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D28999

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

7 years ago[X86] Remove Undef handling from extractSubVector. This is now handled inside getNode.
Craig Topper [Tue, 24 Jan 2017 02:43:54 +0000 (02:43 +0000)]
[X86] Remove Undef handling from extractSubVector. This is now handled inside getNode.

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

7 years ago[SelectionDAG] Teach getNode to simplify a couple easy cases of EXTRACT_SUBVECTOR
Craig Topper [Tue, 24 Jan 2017 02:36:59 +0000 (02:36 +0000)]
[SelectionDAG] Teach getNode to simplify a couple easy cases of EXTRACT_SUBVECTOR

Summary:
This teaches getNode to simplify extracting from Undef. This is similar to what is done for EXTRACT_VECTOR_ELT. It also adds support for extracting from CONCAT_VECTOR when we can reuse one of the inputs to the concat. These seem like simple non-target specific optimizations.

For X86 we currently handle undef in extractSubvector, but not all EXTRACT_SUBVECTOR creations go through there.

Ultimately, my motivation here is to simplify extractSubvector and remove custom lowering for EXTRACT_SUBVECTOR since we don't do anything but handle undef and BUILD_VECTOR optimizations, but those should be DAG combines.

Reviewers: RKSimon, delena

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29000

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

7 years ago[APInt] Remove calls to clearUnusedBits from XorSlowCase and operator^=
Craig Topper [Tue, 24 Jan 2017 02:10:15 +0000 (02:10 +0000)]
[APInt] Remove calls to clearUnusedBits from XorSlowCase and operator^=

Summary:
There's a comment in XorSlowCase that says "0^0==1" which isn't true. 0 xored with 0 is still 0. So I don't think we need to clear any unused bits here.

Now there is no difference between XorSlowCase and AndSlowCase/OrSlowCase other than the operation being performed

Reviewers: majnemer, MatzeB, chandlerc, bkramer

Reviewed By: MatzeB

Subscribers: chfast, llvm-commits

Differential Revision: https://reviews.llvm.org/D28986

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

7 years ago[PM] Try to make all three compilers happy when it comes to pretty printing.
Davide Italiano [Tue, 24 Jan 2017 01:45:53 +0000 (01:45 +0000)]
[PM] Try to make all three compilers happy when it comes to pretty printing.

Modeled after a similar change from Michael Kuperstein. Let's hope this
sticks together.

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

7 years agoLiveIntervalAnalysis: Calculate liveness even if a superreg is reserved.
Matthias Braun [Tue, 24 Jan 2017 01:12:58 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Calculate liveness even if a superreg is reserved.

A register unit may be allocatable and non-reserved but some of the
register(tuples) built with it are reserved. We still need to calculate
liveness in this case.

Note to out of tree targets: If you start seeing machine verifier errors
with this commit, it probably means that you do not properly mark super
registers of reserved register as reserved. See for example r292836 or
r292870 for example on how to fix that.

rdar://29996737

Differential Revision: https://reviews.llvm.org/D28881

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

7 years agoPowerPC: Mark super regs of reserved regs reserved.
Matthias Braun [Tue, 24 Jan 2017 01:12:30 +0000 (01:12 +0000)]
PowerPC: Mark super regs of reserved regs reserved.

When a register like R1 is reserved, X1 should be reserved as well. This
was already done "manually" when 64bit code was enabled, however using
the markSuperRegs() function on the base register is more convenient and
allows to use the checksAllSuperRegsMarked() function even in 32bit mode
to avoid accidental breakage in the future.

This is also necessary to allow https://reviews.llvm.org/D28881

Differential Revision: https://reviews.llvm.org/D29056

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

7 years ago[LTO] Add test to show up we don't support ThinLTO yet.
Davide Italiano [Tue, 24 Jan 2017 00:59:00 +0000 (00:59 +0000)]
[LTO] Add test to show up we don't support ThinLTO yet.

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

7 years ago[LTO] Teach lib/LTO about the new pass manager.
Davide Italiano [Tue, 24 Jan 2017 00:58:24 +0000 (00:58 +0000)]
[LTO] Teach lib/LTO about the new pass manager.

Differential Revision:  https://reviews.llvm.org/D28997

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

7 years ago[PM] Flesh out the new pass manager LTO pipeline.
Davide Italiano [Tue, 24 Jan 2017 00:57:39 +0000 (00:57 +0000)]
[PM] Flesh out the new pass manager LTO pipeline.

Differential Revision:  https://reviews.llvm.org/D28996

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

7 years ago[sanitizer-coverage] emit __sanitizer_cov_trace_pc_guard w/o a preceding 'if' by...
Kostya Serebryany [Tue, 24 Jan 2017 00:57:31 +0000 (00:57 +0000)]
[sanitizer-coverage] emit __sanitizer_cov_trace_pc_guard w/o a preceding 'if' by default. Update the docs, also add deprecation notes around other parts of sanitizer coverage

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

7 years ago[APFloat] Add PPCDoubleDouble multiplication
Tim Shen [Tue, 24 Jan 2017 00:19:45 +0000 (00:19 +0000)]
[APFloat] Add PPCDoubleDouble multiplication

Reviewers: echristo, hfinkel, kbarton, iteratee

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D28382

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

7 years ago[WebAssembly] Update LibFunc::Func -> LibFunc
Derek Schuff [Tue, 24 Jan 2017 00:01:18 +0000 (00:01 +0000)]
[WebAssembly] Update LibFunc::Func -> LibFunc

Fixes compile failures after r292848

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

7 years agoSimplifyLibCalls: Replace more unary libcalls with intrinsics
Matt Arsenault [Mon, 23 Jan 2017 23:55:08 +0000 (23:55 +0000)]
SimplifyLibCalls: Replace more unary libcalls with intrinsics

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

7 years ago[LoopUnroll] First form LCSSA, then loop-simplify
Michael Kuperstein [Mon, 23 Jan 2017 23:45:42 +0000 (23:45 +0000)]
[LoopUnroll] First form LCSSA, then loop-simplify

Running non-LCSSA-preserving LoopSimplify followed by LCSSA on (roughly) the
same loop is incorrect, since LoopSimplify may break LCSSA arbitrarily higher
in the loop nest. Instead, run LCSSA first, and then run LCSSA-preserving
LoopSimplify on the result.

This fixes PR31718.

Differential Revision: https://reviews.llvm.org/D29055

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

7 years ago[AMDGPU] Fix obsolete comments, spotted by Malcolm Parsons. (NFC)
Eugene Zelenko [Mon, 23 Jan 2017 23:41:16 +0000 (23:41 +0000)]
[AMDGPU] Fix obsolete comments, spotted by Malcolm Parsons. (NFC)

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

7 years agoMakes promoteIndirectCall an external function.
Dehao Chen [Mon, 23 Jan 2017 23:18:24 +0000 (23:18 +0000)]
Makes promoteIndirectCall an external function.

Summary: promoteIndirectCall should be a utility function that could be invoked by other optimization passes.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29051

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

7 years ago[Analysis] Add LibFunc_ prefix to enums in TargetLibraryInfo. (NFC)
David L. Jones [Mon, 23 Jan 2017 23:16:46 +0000 (23:16 +0000)]
[Analysis] Add LibFunc_ prefix to enums in TargetLibraryInfo. (NFC)

Summary:
The LibFunc::Func enum holds enumerators named for libc functions.
Unfortunately, there are real situations, including libc implementations, where
function names are actually macros (musl uses "#define fopen64 fopen", for
example; any other transitively visible macro would have similar effects).

Strictly speaking, a conforming C++ Standard Library should provide any such
macros as functions instead (via <cstdio>). However, there are some "library"
functions which are not part of the standard, and thus not subject to this
rule (fopen64, for example). So, in order to be both portable and consistent,
the enum should not use the bare function names.

The old enum naming used a namespace LibFunc and an enum Func, with bare
enumerators. This patch changes LibFunc to be an enum with enumerators prefixed
with "LibFFunc_". (Unfortunately, a scoped enum is not sufficient to override
macros.)

There are additional changes required in clang.

Reviewers: rsmith

Subscribers: mehdi_amini, mzolotukhin, nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D28476

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

7 years agoAMDGPU: Custom lower more vector operations
Matt Arsenault [Mon, 23 Jan 2017 23:09:58 +0000 (23:09 +0000)]
AMDGPU: Custom lower more vector operations

This avoids stack usage.

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

7 years ago[RDF] Add registers to live set even if they are live already
Krzysztof Parzyszek [Mon, 23 Jan 2017 23:03:49 +0000 (23:03 +0000)]
[RDF] Add registers to live set even if they are live already

When calculating kills, a register may be considered live because a part
of it is live, but if there is a use of that (whole) register, the whole
register (and its subregisters) need to be added to the live set.

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

7 years ago[libFuzzer] mutate empty input using the regular mutators (instead of a custom dummy...
Kostya Serebryany [Mon, 23 Jan 2017 22:52:13 +0000 (22:52 +0000)]
[libFuzzer] mutate empty input using the regular mutators (instead of a custom dummy one). This way when we mutate an empty input there is a chance we will get a dictionary word

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

7 years agoDAG: Don't fold vector extract into load if target doesn't want to
Matt Arsenault [Mon, 23 Jan 2017 22:48:53 +0000 (22:48 +0000)]
DAG: Don't fold vector extract into load if target doesn't want to

Fixes turning a 32-bit scalar load into an extending vector load
for AMDGPU when dynamically indexing a vector.

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

7 years ago[InstSimplify] add tests to show missing folds from 'icmp (add nsw)'; NFC
Sanjay Patel [Mon, 23 Jan 2017 22:42:55 +0000 (22:42 +0000)]
[InstSimplify] add tests to show missing folds from 'icmp (add nsw)'; NFC

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

7 years agoRevert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)"
Evgeniy Stepanov [Mon, 23 Jan 2017 22:40:08 +0000 (22:40 +0000)]
Revert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)"

Causes MSan failures on the buildbot.

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

7 years ago[APFloat] Switch from (PPCDoubleDoubleImpl, IEEEdouble) layout to (IEEEdouble, IEEEdo...
Tim Shen [Mon, 23 Jan 2017 22:39:35 +0000 (22:39 +0000)]
[APFloat] Switch from (PPCDoubleDoubleImpl, IEEEdouble) layout to (IEEEdouble, IEEEdouble)

Summary:
This patch changes the layout of DoubleAPFloat, and adjust all
operations to do either:
1) (IEEEdouble, IEEEdouble) -> (uint64_t, uint64_t) -> PPCDoubleDoubleImpl,
   then run the old algorithm.
2) Do the right thing directly.

1) includes multiply, divide, remainder, mod, fusedMultiplyAdd, roundToIntegral,
   convertFromString, next, convertToInteger, convertFromAPInt,
   convertFromSignExtendedInteger, convertFromZeroExtendedInteger,
   convertToHexString, toString, getExactInverse.
2) includes makeZero, makeLargest, makeSmallest, makeSmallestNormalized,
   compare, bitwiseIsEqual, bitcastToAPInt, isDenormal, isSmallest,
   isLargest, isInteger, ilogb, scalbn, frexp, hash_value, Profile.

I could split this into two patches, e.g. use
1) for all operatoins first, then incrementally change some of them to
2). I didn't do that, because 1) involves code that converts data between
PPCDoubleDoubleImpl and (IEEEdouble, IEEEdouble) back and forth, and may
pessimize the compiler. Instead, I find easy functions and use
approach 2) for them directly.

Next step is to implement move multiply and divide from 1) to 2). I don't
have plans for other functions in 1).

Differential Revision: https://reviews.llvm.org/D27872

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

7 years agoAMDGPU: Combine fp16/fp64 subtarget features
Matt Arsenault [Mon, 23 Jan 2017 22:31:03 +0000 (22:31 +0000)]
AMDGPU: Combine fp16/fp64 subtarget features

The same control register controls both, and are set to
the same defaults. Keep the old names around as aliases.

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

7 years ago[Hexagon] Explicitly reserve aliases of reserved registers
Krzysztof Parzyszek [Mon, 23 Jan 2017 22:13:05 +0000 (22:13 +0000)]
[Hexagon] Explicitly reserve aliases of reserved registers

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

7 years ago[libFuzzer] make sure we use the feedback from std::string operator ==
Kostya Serebryany [Mon, 23 Jan 2017 22:11:04 +0000 (22:11 +0000)]
[libFuzzer] make sure we use the feedback from std::string operator ==

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

7 years agoAdd support for the x86_thread_state32_t and
Kevin Enderby [Mon, 23 Jan 2017 21:13:29 +0000 (21:13 +0000)]
Add support for the x86_thread_state32_t and
in llvm-objdump for Mach-O files add the printing of the
x86_thread_state32_t in the same format as
otool-classic(1) on darwin.

To do this the 32-bit x86 general tread state
needed to be defined in include/llvm/Support/MachO.h .

rdar://30110111

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

7 years ago[AArch64][GlobalISel] Legalize narrow scalar fp->int conversions.
Ahmed Bougacha [Mon, 23 Jan 2017 21:10:14 +0000 (21:10 +0000)]
[AArch64][GlobalISel] Legalize narrow scalar fp->int conversions.

Since we're now avoiding operations using narrow scalar integer types,
we have to legalize the integer side of the FP conversions.

This requires teaching the legalizer how to do that.

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

7 years ago[AArch64][GlobalISel] Legalize narrow scalar ops again.
Ahmed Bougacha [Mon, 23 Jan 2017 21:10:05 +0000 (21:10 +0000)]
[AArch64][GlobalISel] Legalize narrow scalar ops again.

Since r279760, we've been marking as legal operations on narrow integer
types that have wider legal equivalents (for instance, G_ADD s8).
Compared to legalizing these operations, this reduced the amount of
extends/truncates required, but was always a weird legalization decision
made at selection time.

So far, we haven't been able to formalize it in a way that permits the
selector generated from SelectionDAG patterns to be sufficient.

Using a wide instruction (say, s64), when a narrower instruction exists
(s32) would introduce register class incompatibilities (when one narrow
generic instruction is selected to the wider variant, but another is
selected to the narrower variant).

It's also impractical to limit which narrow operations are matched for
which instruction, as restricting "narrow selection" to ranges of types
clashes with potentially incompatible instruction predicates.

Concerns were also raised regarding  MIPS64's sign-extended register
assumptions, as well as wrapping behavior.
See discussions in https://reviews.llvm.org/D26878.

Instead, legalize the operations.

Should we ever revert to selecting these narrow operations, we should
try to represent this more accurately: for instance, by separating
a "concrete" type on operations, and an "underlying" type on vregs, we
could move the "this narrow-looking op is really legal" decision to the
legalizer, and let the selector use the "underlying" vreg type only,
which would be guaranteed to map to a register class.

In any case, we eventually should mitigate:
- the performance impact by selecting no-op extract/truncates to COPYs
  (which we currently do), and the COPYs to register reuses (which we
  don't do yet).
- the compile-time impact by optimizing away extract/truncate sequences
  in the legalizer.

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

7 years agoAttempt to fix the testcase in r292824
Steven Wu [Mon, 23 Jan 2017 20:42:17 +0000 (20:42 +0000)]
Attempt to fix the testcase in r292824

Try fix the testcase r292824 (failing on some bots) by reduce it to the
minimal. If this fix doesn't work, I will revert this test.

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

7 years ago[ARM] Classification Improvements to ARM Sched-Models. NFCI.
Javed Absar [Mon, 23 Jan 2017 20:20:39 +0000 (20:20 +0000)]
[ARM] Classification Improvements to ARM Sched-Models. NFCI.

This is a series of patches to enable adding of machine sched
models for ARM processors easier and compact. They define new
sched-readwrites for groups of ARM instructions. This has been
missing so far, and as a consequence, machine scheduler models
for individual sub-targets have tended to be larger than they
needed to be.

The current patch focuses on floating-point instructions.

Reviewers: Diana Picus (rovka), Renato Golin (rengolin)

Differential Revision: https://reviews.llvm.org/D28194

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

7 years agoAdd LC_BUILD_VERSION load command
Steven Wu [Mon, 23 Jan 2017 20:07:55 +0000 (20:07 +0000)]
Add LC_BUILD_VERSION load command

Summary:
Add a new load command LC_BUILD_VERSION. It is a generic version of
LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having
a seperate load command for each platform, LC_BUILD_VERSION is recording
platform info as an enum. It also records SDK version, min_os, and tools
that used to build the binary.

rdar://problem/29781291

Reviewers: enderby

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29044

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

7 years ago[SLP] Additional test with extra args in horizontal reductions.
Alexey Bataev [Mon, 23 Jan 2017 19:28:23 +0000 (19:28 +0000)]
[SLP] Additional test with extra args in horizontal reductions.

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

7 years agoAMDGPU: Propagate fast math flags in fneg combines
Matt Arsenault [Mon, 23 Jan 2017 19:08:34 +0000 (19:08 +0000)]
AMDGPU: Propagate fast math flags in fneg combines

Can't for fma/mad since it seems they can't have flags currently.

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

7 years agoAdd unittests for empty bitvectors.
Matthias Braun [Mon, 23 Jan 2017 19:06:54 +0000 (19:06 +0000)]
Add unittests for empty bitvectors.

Addendum to r292575

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

7 years agoAMDGPU: Remove unnecessary check
Matt Arsenault [Mon, 23 Jan 2017 19:00:15 +0000 (19:00 +0000)]
AMDGPU: Remove unnecessary check

There are no scalar FP types that can be extended.

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

7 years ago[PGO] add debug option to view annotated cfg after prof use annotation
Xinliang David Li [Mon, 23 Jan 2017 18:58:24 +0000 (18:58 +0000)]
[PGO] add debug option to view annotated cfg after prof use annotation

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

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

7 years agoDAG: Allow legalization of fcanonicalize vector types
Matt Arsenault [Mon, 23 Jan 2017 18:52:26 +0000 (18:52 +0000)]
DAG: Allow legalization of fcanonicalize vector types

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

7 years ago[libFuzzer] deflake a test
Kostya Serebryany [Mon, 23 Jan 2017 18:44:40 +0000 (18:44 +0000)]
[libFuzzer] deflake a test

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

7 years ago[InstSimplify] refactor finding limits for icmp with binop; NFCI
Sanjay Patel [Mon, 23 Jan 2017 18:22:26 +0000 (18:22 +0000)]
[InstSimplify] refactor finding limits for icmp with binop; NFCI

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

7 years agoRefactor SampleProfile.cpp to move computation inside a branch. (NFC)
Dehao Chen [Mon, 23 Jan 2017 17:09:02 +0000 (17:09 +0000)]
Refactor SampleProfile.cpp to move computation inside a branch. (NFC)

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

7 years agoPost-commit review feedback from dblaikie
Chris Bieneman [Mon, 23 Jan 2017 16:49:34 +0000 (16:49 +0000)]
Post-commit review feedback from dblaikie

Use ASSERT_* instead of EXPECT_* for error condition.

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

7 years ago[MemorySSA] Add new tests for invariant.groups
Piotr Padlewski [Mon, 23 Jan 2017 16:38:10 +0000 (16:38 +0000)]
[MemorySSA] Add new tests for invariant.groups

Summary:
Next round of extra tests for MSSA.
I have a prototype invariant.group handling implementation
that fixes all the FIXMEs, and I think it will be
easier to see what is the difference if I firstly
post this, and then only fix fixits.

Reviewers: george.burgess.iv, dberlin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29022

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

7 years ago[InstCombine][X86] Add MULDQ/MULUDQ constant folding support
Simon Pilgrim [Mon, 23 Jan 2017 15:22:59 +0000 (15:22 +0000)]
[InstCombine][X86] Add MULDQ/MULUDQ constant folding support

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

7 years agoTweak ASCII art in Simplify CFG. NFC
Amaury Sechet [Mon, 23 Jan 2017 15:13:01 +0000 (15:13 +0000)]
Tweak ASCII art in Simplify CFG. NFC

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

7 years ago[SystemZ] Mark vector immediate load instructions with useful flags.
Jonas Paulsson [Mon, 23 Jan 2017 14:09:58 +0000 (14:09 +0000)]
[SystemZ] Mark vector immediate load instructions with useful flags.

Vector immediate load instructions should have the isAsCheapAsAMove, isMoveImm
and isReMaterializable flags set. With them, these instruction will get
hoisted out of loops.

Review: Ulrich Weigand

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

7 years agoRuntimeDyldELF: add LDST128_ABS_LO12_NC reloc
Eugene Leviant [Mon, 23 Jan 2017 13:52:08 +0000 (13:52 +0000)]
RuntimeDyldELF: add LDST128_ABS_LO12_NC reloc

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

7 years agoRuntimeDyldELF: add LDST8_ABS_LO12_NC and LDST16_ABS_LO12_NC relocs
Eugene Leviant [Mon, 23 Jan 2017 13:13:47 +0000 (13:13 +0000)]
RuntimeDyldELF: add LDST8_ABS_LO12_NC and LDST16_ABS_LO12_NC relocs

Differential revision: https://reviews.llvm.org/D28863

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

7 years ago[InstCombine][X86] MULDQ/MULUDQ undef -> zero
Simon Pilgrim [Mon, 23 Jan 2017 12:07:32 +0000 (12:07 +0000)]
[InstCombine][X86] MULDQ/MULUDQ undef -> zero

Match generic mul behaviour so that <X x i64> multiply and muldq/muludq pattern act the same

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

7 years ago[SLP] Additional test for SLP vectorizer with 31 reduction elements.
Alexey Bataev [Mon, 23 Jan 2017 11:53:16 +0000 (11:53 +0000)]
[SLP] Additional test for SLP vectorizer with 31 reduction elements.

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

7 years ago[InstCombine][SSE] Tests showing missed opportunities to constant fold PMULDQ/PMULUDQ
Simon Pilgrim [Mon, 23 Jan 2017 10:57:39 +0000 (10:57 +0000)]
[InstCombine][SSE] Tests showing missed opportunities to constant fold PMULDQ/PMULUDQ

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

7 years agoThis test apparently requires an x86 target and is failing on numerous
Chandler Carruth [Mon, 23 Jan 2017 08:33:29 +0000 (08:33 +0000)]
This test apparently requires an x86 target and is failing on numerous
bots ever since d0k fixed the CHECK lines so that it did something at
all.

It isn't actually testing SCEV directly but LSR, so move it into LSR and
the x86-specific tree of tests that already exists there. Target
dependence is common and unavoidable with the current design of LSR.

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

7 years ago[PM] Replace the hard invalidate in JumpThreading for LVI with correct
Chandler Carruth [Mon, 23 Jan 2017 08:33:24 +0000 (08:33 +0000)]
[PM] Replace the hard invalidate in JumpThreading for LVI with correct
invalidation of deleted functions in GlobalDCE.

This was always testing a bug really triggered in GlobalDCE. Right now
we have analyses with asserting value handles into IR. As long as those
remain, when *deleting* an IR unit, we cannot wait for the normal
invalidation scheme to kick in even though it was designed to work
correctly in the face of these kinds of deletions. Instead, the pass
needs to directly handle invalidating the analysis results pointing at
that IR unit.

I've tought the Inliner about this and this patch teaches GlobalDCE.
This will handle the asserting VH case in the existing test as well as
other issues of the same fundamental variety. I've moved the test into
the GlobalDCE directory and added a comment explaining what is going on.

Note that we cannot simply require LVI here because LVI is too lazy.

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

7 years ago[PM] Add a dedicated test case for the issue fixed in r292770.
Chandler Carruth [Mon, 23 Jan 2017 07:53:20 +0000 (07:53 +0000)]
[PM] Add a dedicated test case for the issue fixed in r292770.

While this is covered by a clang test case, we should have something
locally to LLVM that immediately checks the inliner doesn't leave
analyses to dangling IR bodies.

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

7 years ago[globalisel] Remove unused, duplicate file added in r292478
Daniel Sanders [Mon, 23 Jan 2017 07:33:21 +0000 (07:33 +0000)]
[globalisel] Remove unused, duplicate file added in r292478

It seems it appeared during a rebase (diff 6) of D27338
and went unnoticed.

Thanks to David Majnemer for noticing.

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

7 years ago[PM] Clear any analyses for a dead function after inlining it and before
Chandler Carruth [Mon, 23 Jan 2017 07:03:41 +0000 (07:03 +0000)]
[PM] Clear any analyses for a dead function after inlining it and before
clearing its body. This is essential to avoid triggering asserting value
handles in analyses on the function's body.

I'm working on a test case for this behavior in LLVM, but Clang has
a great one that managed to trigger this on all of the bots already.

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

7 years ago[PM] Teach LVI to correctly invalidate itself when its dependencies
Chandler Carruth [Mon, 23 Jan 2017 06:35:12 +0000 (06:35 +0000)]
[PM] Teach LVI to correctly invalidate itself when its dependencies
become unavailable.

The AssumptionCache is now immutable but it still needs to respond to
DomTree invalidation if it ended up caching one.

This lets us remove one of the explicit invalidates of LVI but the
other one continues to avoid hitting a latent bug.

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

7 years ago[X86][SSE] Add missing X86ISD::ANDNP combines.
Simon Pilgrim [Sun, 22 Jan 2017 22:45:23 +0000 (22:45 +0000)]
[X86][SSE] Add missing X86ISD::ANDNP combines.

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

7 years ago[X86][SSE] Improve shuffle combining with zero insertions
Simon Pilgrim [Sun, 22 Jan 2017 22:21:44 +0000 (22:21 +0000)]
[X86][SSE] Improve shuffle combining with zero insertions

Add support for handling shuffles with scalar_to_vector(0)

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