OSDN Git Service

android-x86/external-llvm.git
7 years ago[ARM] GlobalISel: Fix stack-use-after-scope bug.
Martin Bohme [Wed, 25 Jan 2017 14:28:19 +0000 (14:28 +0000)]
[ARM] GlobalISel: Fix stack-use-after-scope bug.

Summary:
Lifetime extension wasn't triggered on the result of BuildMI because the
reference was non-const. However, instead of adding a const, I've
removed the reference entirely as RVO should kick in anyway.

Reviewers: rovka, bkramer

Reviewed By: bkramer

Subscribers: aemerson, rengolin, dberris, llvm-commits, kristof.beyls

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

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

7 years ago[InstCombine] Canonicalize guards for AND condition
Artur Pilipenko [Wed, 25 Jan 2017 14:20:52 +0000 (14:20 +0000)]
[InstCombine] Canonicalize guards for AND condition

This is a partial fix for Bug 31520 - [guards] canonicalize guards in instcombine

Reviewed By: apilipenko

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

Patch by Maxim Kazantsev.

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

7 years ago[InstCombine] Allow InstrCombine to remove one of adjacent guards if they are equivalent
Artur Pilipenko [Wed, 25 Jan 2017 14:12:12 +0000 (14:12 +0000)]
[InstCombine] Allow InstrCombine to remove one of adjacent guards if they are equivalent

This is a partial fix for Bug 31520 - [guards] canonicalize guards in instcombine

Reviewed By: majnemer, apilipenko

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

Patch by Maxim Kazantsev.

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

7 years ago[SLP] Improve horizontal vectorization for non-power-of-2 number of
Alexey Bataev [Wed, 25 Jan 2017 09:54:38 +0000 (09:54 +0000)]
[SLP] Improve horizontal vectorization for non-power-of-2 number of
instructions.

If number of instructions in horizontal reduction list is not power of 2
then only PowerOf2Floor(NumberOfInstructions) last elements are actually
vectorized, other instructions remain scalar. Patch tries to vectorize
the remaining elements either.

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

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

7 years agoMark @llvm.powi.* as safe to speculatively execute.
whitequark [Wed, 25 Jan 2017 09:32:30 +0000 (09:32 +0000)]
Mark @llvm.powi.* as safe to speculatively execute.

Floating point intrinsics in LLVM are generally not speculatively
executed, since most of them are defined to behave the same as libm
functions, which set errno.

However, the @llvm.powi.* intrinsics do not correspond to any libm
function, and lacks any defined error handling semantics in LangRef.
It most certainly does not alter errno.

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

7 years ago[X86] enable memory interleaving for X86\SLM arch.
Mohammed Agabaria [Wed, 25 Jan 2017 09:14:48 +0000 (09:14 +0000)]
[X86] enable memory interleaving for X86\SLM arch.

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

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

7 years agoFix buildbot failures introduced by 293036
Artur Pilipenko [Wed, 25 Jan 2017 09:10:07 +0000 (09:10 +0000)]
Fix buildbot failures introduced by 293036

Fix unused variable, specify types explicitly to make VC compiler happy.

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

7 years ago[DAGCombiner] Match load by bytes idiom and fold it into a single load. Attempt #2.
Artur Pilipenko [Wed, 25 Jan 2017 08:53:31 +0000 (08:53 +0000)]
[DAGCombiner] Match load by bytes idiom and fold it into a single load. Attempt #2.

The previous patch (https://reviews.llvm.org/rL289538) got reverted because of a bug. Chandler also requested some changes to the algorithm.
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161212/413479.html

This is an updated patch. The key difference is that collectBitProviders (renamed to calculateByteProvider) now collects the origin of one byte, not the whole value. It simplifies the implementation and allows to stop the traversal earlier if we know that the result won't be used.

From the original commit:

Match a pattern where a wide type scalar value is loaded by several narrow loads and combined by shifts and ors. Fold it into a single load or a load and a bswap if the targets supports it.

Assuming little endian target:
  i8 *a = ...
  i32 val = a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)
=>
  i32 val = *((i32)a)

  i8 *a = ...
  i32 val = (a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3]
=>
  i32 val = BSWAP(*((i32)a))

This optimization was discussed on llvm-dev some time ago in "Load combine pass" thread. We came to the conclusion that we want to do this transformation late in the pipeline because in presence of atomic loads load widening is irreversible transformation and it might hinder other optimizations.

Eventually we'd like to support folding patterns like this where the offset has a variable and a constant part:
  i32 val = a[i] | (a[i + 1] << 8) | (a[i + 2] << 16) | (a[i + 3] << 24)

Matching the pattern above is easier at SelectionDAG level since address reassociation has already happened and the fact that the loads are adjacent is clear. Understanding that these loads are adjacent at IR level would have involved looking through geps/zexts/adds while looking at the addresses.

The general scheme is to match OR expressions by recursively calculating the origin of individual bytes which constitute the resulting OR value. If all the OR bytes come from memory verify that they are adjacent and match with little or big endian encoding of a wider value. If so and the load of the wider type (and bswap if needed) is allowed by the target generate a load and a bswap if needed.

Reviewed By: RKSimon, filcab, chandlerc

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

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

7 years ago[ARM] GlobalISel: Support i1 add and ABI extensions
Diana Picus [Wed, 25 Jan 2017 08:47:40 +0000 (08:47 +0000)]
[ARM] GlobalISel: Support i1 add and ABI extensions

Add support for:
* i1 add
* i1 function arguments, if passed through registers
* i1 returns, with ABI signext/zeroext

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

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

7 years ago[ARM] GlobalISel: Support i8/i16 ABI extensions
Diana Picus [Wed, 25 Jan 2017 08:10:40 +0000 (08:10 +0000)]
[ARM] GlobalISel: Support i8/i16 ABI extensions

At the moment, this means supporting the signext/zeroext attribute on the return
type of the function. For function arguments, signext/zeroext should be handled
by the caller, so there's nothing for us to do until we start lowering calls.

Note that this does not include support for other extensions (i8 to i16), those
will be added later.

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

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

7 years agoDo not verify dominator tree if it has no roots
Serge Pavlov [Wed, 25 Jan 2017 07:58:10 +0000 (07:58 +0000)]
Do not verify dominator tree if it has no roots

If dominator tree has no roots, the pass that calculates it is
likely to be skipped. It occures, for instance, in the case of
entities with linkage available_externally. Do not run tree
verification in such case.

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

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

7 years agoImplemented color coding and Vertex labels in XRay Graph
Dean Michael Berris [Wed, 25 Jan 2017 07:14:43 +0000 (07:14 +0000)]
Implemented color coding and Vertex labels in XRay Graph

Summary:
A patch to enable the llvm-xray graph subcommand to color edges and
vertices based on statistics and to annotate vertices with statistics.

Depends on D27243

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

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

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

7 years ago[X86]Enable the use of 'mov' with a 64bit GPR and a large immediate
Coby Tayree [Wed, 25 Jan 2017 07:09:42 +0000 (07:09 +0000)]
[X86]Enable the use of 'mov' with a 64bit GPR and a large immediate

Enable the next form (intel style):
"mov <reg64>, <largeImm>"
which is should be available,
where <largeImm> stands for immediates which exceed the range of a singed 32bit integer

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

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

7 years ago[ARM] GlobalISel: Bail out on Thumb. NFC
Diana Picus [Wed, 25 Jan 2017 07:08:53 +0000 (07:08 +0000)]
[ARM] GlobalISel: Bail out on Thumb. NFC

Thumb is not supported yet, so bail out early.

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

7 years agoAMDGPU: Check nsz instead of unsafe math
Matt Arsenault [Wed, 25 Jan 2017 06:27:02 +0000 (06:27 +0000)]
AMDGPU: Check nsz instead of unsafe math

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

7 years ago[SimplifyCFG] Do not sink and merge inline-asm instructions.
Akira Hatanaka [Wed, 25 Jan 2017 06:21:51 +0000 (06:21 +0000)]
[SimplifyCFG] Do not sink and merge inline-asm instructions.

Conservatively disable sinking and merging inline-asm instructions as doing so
can potentially create arguments that cannot satisfy the inline-asm constraints.

For example, SimplifyCFG used to do the following transformation:

(before)
if.then:
  %0 = call i32 asm "rorl $2, $0", "=&r,0,n"(i32 %r6, i32 8)
  br label %if.end
if.else:
  %1 = call i32 asm "rorl $2, $0", "=&r,0,n"(i32 %r6, i32 6)
  br label %if.end

(after)
  %.sink = select i1 %tobool, i32 6, i32 8
  %0 = call i32 asm "rorl $2, $0", "=&r,0,n"(i32 %r6, i32 %.sink)

This would result in a crash in the backend since only immediate integer operands
are permitted for constraint "n".

rdar://problem/30110806

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

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

7 years agoDAG: Recognize no-signed-zeros-fp-math attribute
Matt Arsenault [Wed, 25 Jan 2017 06:08:42 +0000 (06:08 +0000)]
DAG: Recognize no-signed-zeros-fp-math attribute

clang already emits this with -cl-no-signed-zeros, but codegen
doesn't do anything with it. Treat it like the other fast math
attributes, and change one place to use it.

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

7 years agoGlobalISel: Fix typo in error message
Justin Bogner [Wed, 25 Jan 2017 06:02:10 +0000 (06:02 +0000)]
GlobalISel: Fix typo in error message

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

7 years agoIgnore llvm/test/tools/llvm-symbolizer/coff-exports.test on mingw.
NAKAMURA Takumi [Wed, 25 Jan 2017 05:26:23 +0000 (05:26 +0000)]
Ignore llvm/test/tools/llvm-symbolizer/coff-exports.test on mingw.

FIXME: Demangler could behave along not host but target.
For example, assume host=mingw, target=msc.

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

7 years agoDAGCombiner: Allow negating ConstantFP after legalize
Matt Arsenault [Wed, 25 Jan 2017 04:54:34 +0000 (04:54 +0000)]
DAGCombiner: Allow negating ConstantFP after legalize

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

7 years ago[InstCombine] Added regression test to narrow-swich.ll
Gerolf Hoflehner [Wed, 25 Jan 2017 04:34:59 +0000 (04:34 +0000)]
[InstCombine] Added regression test to narrow-swich.ll

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

7 years agoRewind instantiations of OuterAnalysisManagerProxy in r289317, r291651, and r291662.
NAKAMURA Takumi [Wed, 25 Jan 2017 04:26:29 +0000 (04:26 +0000)]
Rewind instantiations of OuterAnalysisManagerProxy in r289317, r291651, and r291662.

I found root class should be instantiated for variadic tempate to instantiate static member explicitly.

This will fix failures in mingw DLL build.

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

7 years agoAMDGPU: Implement early ifcvt target hooks.
Matt Arsenault [Wed, 25 Jan 2017 04:25:02 +0000 (04:25 +0000)]
AMDGPU: Implement early ifcvt target hooks.

Leave early ifcvt disabled for now since there are some
shader-db regressions.

This causes some immediate improvements, but could be better.
The cost checking that the pass does is based on critical path
length for out of order CPUs which we do not want so it skips out
on many cases we want.

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

7 years agogold-plugin: Add the file path to the file open error diagnostic.
Peter Collingbourne [Wed, 25 Jan 2017 03:35:28 +0000 (03:35 +0000)]
gold-plugin: Add the file path to the file open error diagnostic.

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

7 years agoTry to prevent build breakage by touching a CMakeLists.txt.
Ahmed Bougacha [Wed, 25 Jan 2017 02:55:24 +0000 (02:55 +0000)]
Try to prevent build breakage by touching a CMakeLists.txt.

Looks like our cmake goop for handling .inc->td dependencies doesn't
track the .td files.

This manifests as cmake complaining about missing files since r293009.

Force a rerun to avoid that.

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

7 years ago[PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls
Chandler Carruth [Wed, 25 Jan 2017 02:49:01 +0000 (02:49 +0000)]
[PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls
loops.

We do this by reconstructing the newly added loops after the unroll
completes to avoid threading pass manager details through all the mess
of the unrolling infrastructure.

I've enabled some extra assertions in the LPM to try and catch issues
here and enabled a bunch of unroller tests to try and make sure this is
sane.

Currently, I'm manually running loop-simplify when needed. That should
go away once it is folded into the LPM infrastructure.

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

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

7 years ago[GlobalISel] Generate selector for more integer binop patterns.
Ahmed Bougacha [Wed, 25 Jan 2017 02:41:38 +0000 (02:41 +0000)]
[GlobalISel] Generate selector for more integer binop patterns.

This surprisingly isn't NFC because there are patterns to select GPR
sub to SUBSWrr (rather than SUBWrr/rs); SUBS is later optimized to
SUB if NZCV is dead.  From ISel's perspective, both are fine.

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

7 years ago[GlobalISel] Rename TargetGlobalISel.td to GISel/SelectionDAGCompat.td
Ahmed Bougacha [Wed, 25 Jan 2017 02:41:26 +0000 (02:41 +0000)]
[GlobalISel] Rename TargetGlobalISel.td to GISel/SelectionDAGCompat.td

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

7 years agoReinstate "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
Greg Parker [Wed, 25 Jan 2017 02:26:03 +0000 (02:26 +0000)]
Reinstate "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
and UNSUPPORTED"

This reverts the revert in r292942.

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

7 years ago[coroutines] Spill the result of the invoke instruction correctly
Gor Nishanov [Wed, 25 Jan 2017 02:25:54 +0000 (02:25 +0000)]
[coroutines] Spill the result of the invoke instruction correctly

Summary:
When we decide that the result of the invoke instruction need to be spilled, we need to insert the spill into a block that is on the normal edge coming out of the invoke instruction. (Prior to this change the code would insert the spill immediately after the invoke instruction, which breaks the IR, since invoke is a terminator instruction).

In the following example, we will split the edge going into %cont and insert the spill there.

```
  %r = invoke double @print(double 0.0) to label %cont unwind label %pad

  cont:
    %0 = call i8 @llvm.coro.suspend(token none, i1 false)
    switch i8 %0, label %suspend [i8 0, label %resume
                                  i8 1, label %cleanup]
  resume:
    call double @print(double %r)
```

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: mehdi_amini, llvm-commits, EricWF

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

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

7 years agoAMDGPU add support for spilling to a user sgpr pointed buffers
Tom Stellard [Wed, 25 Jan 2017 01:25:13 +0000 (01:25 +0000)]
AMDGPU add support for spilling to a user sgpr pointed buffers

Summary:
This lets you select which sort of spilling you want, either s[0:1] or 64-bit loads from s[0:1].

Patch By: Dave Airlie

Reviewers: nhaehnle, arsenm, tstellarAMD

Reviewed By: arsenm

Subscribers: mareko, llvm-commits, kzhuravl, wdng, yaxunl, tony-tye

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

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

7 years ago[AArch64] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Wed, 25 Jan 2017 00:29:26 +0000 (00:29 +0000)]
[AArch64] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoGlobalISel: Use the correct types when translating landingpad instructions
Justin Bogner [Wed, 25 Jan 2017 00:16:53 +0000 (00:16 +0000)]
GlobalISel: Use the correct types when translating landingpad instructions

There was a bug here where we were using p0 instead of s32 for the
selector type in the landingpad. Instead of hardcoding these types we
should get the types from the landingpad instruction directly.

Note that we replicate an assert from SDAG here to only support
two-valued landingpads.

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

7 years agoFix llvm-objdump so it picks a good CPU based for Mach-O files
Kevin Enderby [Tue, 24 Jan 2017 23:41:04 +0000 (23:41 +0000)]
Fix llvm-objdump so it picks a good CPU based for Mach-O files
for CPU_SUBTYPE_ARM_V7S and CPU_SUBTYPE_ARM_V7K.

For these two cpusubtypes they should default to a cortex-a7 CPU
to give proper disassembly without a -mcpu= flag.

rdar://27431703

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

7 years ago[XCore] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Tue, 24 Jan 2017 23:02:48 +0000 (23:02 +0000)]
[XCore] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoAMDGPU: Remove spurious out branches after a kill
Matt Arsenault [Tue, 24 Jan 2017 22:18:39 +0000 (22:18 +0000)]
AMDGPU: Remove spurious out branches after a kill

The sequence like this:
  v_cmpx_le_f32_e32 vcc, 0, v0
  s_branch BB0_30
  s_cbranch_execnz BB0_30
  ; BB#29:
  exp null off, off, off, off done vm
  s_endpgm
  BB0_30:
  ; %endif110

is likely wrong. The s_branch instruction will unconditionally jump
to BB0_30 and the skip block (exp done + endpgm) inserted for
performing the kill instruction will never be executed. This results
in a GPU hang with Star Ruler 2.

The s_branch instruction is added during the "Control Flow Optimizer"
pass which seems to re-organize the basic blocks, and we assume
that SI_KILL_TERMINATOR is always the last instruction inside a
basic block. Thus, after inserting a skip block we just go to the
next BB without looking at the subsequent instructions after the
kill, and the s_branch op is never removed.

Instead, we should remove the unconditional out branches and let
skip the two instructions if the exec mask is non-zero.

This patch fixes the GPU hang and doesn't introduce any regressions
with "make check".

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

Patch by Samuel Pitoiset <samuel.pitoiset@gmail.com>

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

7 years agoRevert rL292621. Caused some internal build bot failures in apple.
Wei Mi [Tue, 24 Jan 2017 22:15:06 +0000 (22:15 +0000)]
Revert rL292621. Caused some internal build bot failures in apple.

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

7 years ago[SystemZ] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Tue, 24 Jan 2017 22:10:43 +0000 (22:10 +0000)]
[SystemZ] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoEnable FeatureFlatForGlobal on Volcanic Islands
Matt Arsenault [Tue, 24 Jan 2017 22:02:15 +0000 (22:02 +0000)]
Enable FeatureFlatForGlobal on Volcanic Islands

This switches to the workaround that HSA defaults to
for the mesa path.

This should be applied to the 4.0 branch.

Patch by Vedran Miletić <vedran@miletic.net>

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

7 years agoExplicitly promote indirect calls before sample profile annotation.
Dehao Chen [Tue, 24 Jan 2017 21:05:51 +0000 (21:05 +0000)]
Explicitly promote indirect calls before sample profile annotation.

Summary: In iterative sample pgo where profile is collected from PGOed binary, we may see indirect call targets promoted and inlined in the profile. Before profile annotation, we need to make this happen in order to annotate correctly on IR. This patch explicitly promotes these indirect calls and inlines them before profile annotation.

Reviewers: xur, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

7 years agoDemangle: correct demangling for CV-qualified functions
Saleem Abdulrasool [Tue, 24 Jan 2017 20:04:58 +0000 (20:04 +0000)]
Demangle: correct demangling for CV-qualified functions

When demangling a CV-qualified function type with a final reference type
parameter, we would treat the reference type parameter as a r-value ref
accidentally.  This would result in the improper decoration of the
function type itself.

Resolves PR31741!

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

7 years agoDemangle: use named values for CV qualifiers
Saleem Abdulrasool [Tue, 24 Jan 2017 20:04:56 +0000 (20:04 +0000)]
Demangle: use named values for CV qualifiers

Rather than hard-coding magic values of 1, 2, 4 (bit-field), use an enum
to name the values.  NFC.

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

7 years agoRevert [AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.
Ivan Krasin [Tue, 24 Jan 2017 19:58:59 +0000 (19:58 +0000)]
Revert [AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.

Reason: broke ASAN bots with a global buffer overflow.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/2291

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@292974 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove the load hoisting code of MLSM, it is completely subsumed by GVNHoist
Daniel Berlin [Tue, 24 Jan 2017 19:55:36 +0000 (19:55 +0000)]
Remove the load hoisting code of MLSM, it is completely subsumed by GVNHoist

Summary:
GVNHoist performs all the optimizations that MLSM does to loads, in a
more general way, and in a faster time bound (MLSM is N^3 in most
cases, N^4 in a few edge cases).

This disables the load portion.

Note that the way ld_hoist_st_sink.ll is written makes one think that
the loads should be moved to the while.preheader block, but

1. Neither MLSM nor GVNHoist do it (they both move them to identical places).

2. MLSM couldn't possibly do it anyway, as the while.preheader block
is not the head of the diamond, while.body is.  (GVNHoist could do it
if it was legal).

3. At a glance, it's not legal anyway because the in-loop load
conflict with the in-loop store, so the loads must stay in-loop.

I am happy to update the test to use update_test_checks so that
checking is tighter, just was going to do it as a followup.

Note that i can find no particular benefit to the store portion on any
real testcase/benchmark i have (even size-wise).  If we really still
want it, i am happy to commit to writing a targeted store sinker, just
taking the code from the MemorySSA port of MergedLoadStoreMotion
(which is N^2 worst case, and N most of the time).

We can do what it does in a much better time bound.

We also should be both hoisting and sinking stores, not just sinking
them, anyway, since whether we should hoist or sink to merge depends
basically on luck of the draw of where the blockers are placed.

Nonetheless, i have left it alone for now.

Reviewers: chandlerc, davide

Subscribers: llvm-commits

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

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

7 years agoAMDGPU/SI: Give up in promote alloca when a pointer may be captured.
Changpeng Fang [Tue, 24 Jan 2017 19:06:28 +0000 (19:06 +0000)]
AMDGPU/SI: Give up in promote alloca when a pointer may be captured.

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

Reviewer:
  Matt

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

7 years agoDemangle: avoid butchering parameter type
Saleem Abdulrasool [Tue, 24 Jan 2017 18:52:19 +0000 (18:52 +0000)]
Demangle: avoid butchering parameter type

When demangling a CV-qualified function type with a final parameter with
a reference type, we would insert the CV qualification on the parameter
rather than the function, and in the process adjust the insertion point
by one extra, splitting the type name.  This avoids doing so, even
though the attribution is still incorrect.

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

7 years ago[AArch64] Fix typo. NFC.
Chad Rosier [Tue, 24 Jan 2017 18:08:10 +0000 (18:08 +0000)]
[AArch64] Fix typo. NFC.

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

7 years agoUse InstCombine's builder in foldSelectCttzCtlz instead of creating a new one.
Amaury Sechet [Tue, 24 Jan 2017 17:48:25 +0000 (17:48 +0000)]
Use InstCombine's builder in foldSelectCttzCtlz instead of creating a new one.

Summary: As per title. This will add the instructiions we are interested in in the worklist.

Reviewers: mehdi_amini, majnemer, andreadb

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

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

7 years ago[AMDGPU] Add VGPR copies post regalloc fix pass
Stanislav Mekhanoshin [Tue, 24 Jan 2017 17:46:17 +0000 (17:46 +0000)]
[AMDGPU] Add VGPR copies post regalloc fix pass

Regalloc creates COPY instructions which do not formally use VALU.
That results in v_mov instructions displaced after exec mask modification.
One pass which do it is SIOptimizeExecMasking, but potentially it can be
done by other passes too.

This patch adds a pass immediately after regalloc to add implicit exec
use operand to all VGPR copy instructions.

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

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

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