oota-llvm.git
9 years ago[SDAG] Don't widen VSETCC during type legalization for split operands
Hal Finkel [Mon, 23 Mar 2015 08:22:43 +0000 (08:22 +0000)]
[SDAG] Don't widen VSETCC during type legalization for split operands

Because the operands of a vector SETCC node can be of a different type from the
result (and often are), it can happen that even if we'd prefer to widen the
result type of the SETCC, the operands have been split instead. In this case,
the SETCC result also must be split. This mirrors what is done in
WidenVecRes_SELECT, and should be NFC elsewhere because if the operands are not
widened the following calls to GetWidenedVector will assert (which is what was
happening in the test case).

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

9 years ago[Orc] Add missing -use-orcmcjit flag to a number of Orc regression tests.
Lang Hames [Mon, 23 Mar 2015 06:02:49 +0000 (06:02 +0000)]
[Orc] Add missing -use-orcmcjit flag to a number of Orc regression tests.

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

9 years agoFix typo 'AVX too' instead of 'AVX2'
Craig Topper [Mon, 23 Mar 2015 04:17:11 +0000 (04:17 +0000)]
Fix typo 'AVX too' instead of 'AVX2'

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

9 years ago[X86] Add one stepping of Broadwell to the CPU name autodetection for march=native.
Craig Topper [Mon, 23 Mar 2015 00:15:06 +0000 (00:15 +0000)]
[X86] Add one stepping of Broadwell to the CPU name autodetection for march=native.

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

9 years agoSilence a GCC warning
David Majnemer [Sun, 22 Mar 2015 21:27:10 +0000 (21:27 +0000)]
Silence a GCC warning

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

9 years agoFoldingSet: Make FoldingSetImpl's dtor protected and non-virtual
Benjamin Kramer [Sun, 22 Mar 2015 18:22:33 +0000 (18:22 +0000)]
FoldingSet: Make FoldingSetImpl's dtor protected and non-virtual

It's not intended to be polymorphically deleted. Make FoldingSet
and ContextualFoldingSet final to avoid noise from -Wnon-virtual-dtor.

No functional change intended.

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

9 years agoPrevent CHECK-NOTs from matching file paths
Duncan P. N. Exon Smith [Sun, 22 Mar 2015 15:58:21 +0000 (15:58 +0000)]
Prevent CHECK-NOTs from matching file paths

A build directory with a name like `build-Werror` would hit a false
positive on these `CHECK-NOT`s before, since the actual error line looks
like:

    .../build-Werror/bin/llvm-as <stdin>:1:2: error: ...

Switch to using:

    CHECK-NOT: error:

(note the trailing semi-colon) to avoid matching almost any file path.

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

9 years agoFixed MSVC compile warning issue introduced in r232837
Simon Pilgrim [Sun, 22 Mar 2015 13:38:36 +0000 (13:38 +0000)]
Fixed MSVC compile warning issue introduced in r232837

- was reporting 'warning C4715: 'getType32' : not all control paths return a value'

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

9 years ago[SimplifyLibCalls] Fix negative shifts being produced by the memchr -> bitfield trans...
Benjamin Kramer [Sat, 21 Mar 2015 22:04:26 +0000 (22:04 +0000)]
[SimplifyLibCalls] Fix negative shifts being produced by the memchr -> bitfield transform.

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

9 years ago[SimplifyLibCalls] Turn memchr(const, C, const) into a bitfield check.
Benjamin Kramer [Sat, 21 Mar 2015 21:09:33 +0000 (21:09 +0000)]
[SimplifyLibCalls] Turn memchr(const, C, const) into a bitfield check.

strchr("123!", C) != nullptr is a common pattern to check if C is one
of 1, 2, 3 or !. If the largest element of the string is smaller than
the target's register size we can easily create a bitfield and just
do a simple test for set membership.

int foo(char C) { return strchr("123!", C) != nullptr; } now becomes

cmpl $64, %edi ## range check
sbbb %al, %al
movabsq $0xE000200000001, %rcx
btq %rdi, %rcx ## bit test
sbbb %cl, %cl
andb %al, %cl ## and the two conditions
andb $1, %cl
movzbl %cl, %eax ## returning an int
ret

(imho the backend should expand this into a series of branches, but
that's a different story)

The code is currently limited to bit fields that fit in a register, so
usually 64 or 32 bits. Sadly, this misses anything using alpha chars
or {}. This could be fixed by just emitting a i128 bit field, but that
can generate really ugly code so we have to find a better way. To some
degree this is also recreating switch lowering logic, but we can't
simply emit a switch instruction and thus change the CFG within
instcombine.

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

9 years agoR600: Cleanup test with multiple check prefixes
Matt Arsenault [Sat, 21 Mar 2015 19:15:46 +0000 (19:15 +0000)]
R600: Cleanup test with multiple check prefixes

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

9 years agoStringRef: Just forward StringRef::find to libc's memchr.
Benjamin Kramer [Sat, 21 Mar 2015 16:42:35 +0000 (16:42 +0000)]
StringRef: Just forward StringRef::find to libc's memchr.

Modern libc's have an SSE version of memchr which is a lot faster than our
hand-rolled version. In the past I was reluctant to use it because Darwin's
memchr used a naive ridiculously slow implementation, but that has been fixed
some versions ago.

Should have zero functional impact.

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

9 years agoRevert accidental commit.
Benjamin Kramer [Sat, 21 Mar 2015 15:37:32 +0000 (15:37 +0000)]
Revert accidental commit.

While this is a fun change, I didn't really test it :)

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

9 years agoSimplifyLibCalls: Add basic optimization of memchr calls.
Benjamin Kramer [Sat, 21 Mar 2015 15:36:21 +0000 (15:36 +0000)]
SimplifyLibCalls: Add basic optimization of memchr calls.

This is just memchr(x, y, 0) -> nullptr and constant folding.

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

9 years agoValueTracking: Forward getConstantStringInfo's TrimAtNul param into recursive invocation
Benjamin Kramer [Sat, 21 Mar 2015 15:36:06 +0000 (15:36 +0000)]
ValueTracking: Forward getConstantStringInfo's TrimAtNul param into recursive invocation

Currently this is only used to tweak the backend's memcpy inlining
heuristics, testing that isn't very helpful. A real test case will
follow in the next commit, where this behavior would cause a real
miscompilation.

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

9 years agoTidied up vec_zero_cse.ll test. NFCI.
Simon Pilgrim [Sat, 21 Mar 2015 14:05:12 +0000 (14:05 +0000)]
Tidied up vec_zero_cse.ll test. NFCI.

Added target triple and refactored the CHECKs to be per function.

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

9 years agoMemoryDependenceAnalysis: Don't miscompile atomics
David Majnemer [Sat, 21 Mar 2015 06:19:17 +0000 (06:19 +0000)]
MemoryDependenceAnalysis: Don't miscompile atomics

r216771 introduced a change to MemoryDependenceAnalysis that allowed it
to reason about acquire/release operations.  However, this change does
not ensure that the acquire/release operations pair.  Unfortunately,
this leads to miscompiles as we won't see an acquire load as properly
memory effecting.  This largely reverts r216771.

This fixes PR22708.

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

9 years agoAArch64: simplify test case
Tim Northover [Sat, 21 Mar 2015 04:37:08 +0000 (04:37 +0000)]
AArch64: simplify test case

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

9 years agoRemove the target independent TargetMachine::getSubtarget and
Eric Christopher [Sat, 21 Mar 2015 04:22:23 +0000 (04:22 +0000)]
Remove the target independent TargetMachine::getSubtarget and
TargetMachine::getSubtargetImpl routines.

This keeps the target independent code free of bare subtarget
calls while the remainder of the backends are migrated, or not
if they don't wish to support per-function subtargets as would
be needed for function multiversioning or LTO of disparate
cpu subarchitecture types, e.g.

clang -msse4.2 -c foo.c -emit-llvm -o foo.bc
clang -c bar.c -emit-llvm -o bar.bc
llvm-link foo.bc bar.bc -o baz.bc
llc baz.bc

and get appropriate code for what the command lines requested.

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

9 years agoRemove the bare getSubtargetImpl call from the AArch64 port. As part
Eric Christopher [Sat, 21 Mar 2015 04:04:50 +0000 (04:04 +0000)]
Remove the bare getSubtargetImpl call from the AArch64 port. As part
of this add a test that shows we can generate code for functions
that specifically enable a subtarget feature.

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

9 years agoRemove the bare getSubtargetImpl call from the PPC port. As part
Eric Christopher [Sat, 21 Mar 2015 03:36:02 +0000 (03:36 +0000)]
Remove the bare getSubtargetImpl call from the PPC port. As part
of this add a test that shows we can generate code with
for functions that differ by subtarget feature.

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

9 years agoForward the Function based getSubtarget call to the appropriate Impl
Eric Christopher [Sat, 21 Mar 2015 03:32:45 +0000 (03:32 +0000)]
Forward the Function based getSubtarget call to the appropriate Impl
call.

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

9 years agoGrab a subtarget off of an AMDGPUTargetMachine rather than a
Eric Christopher [Sat, 21 Mar 2015 03:17:25 +0000 (03:17 +0000)]
Grab a subtarget off of an AMDGPUTargetMachine rather than a
bare target machine in preparation for the TargetMachine bare
getSubtarget/getSubtargetImpl calls going away.

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

9 years agoCache the Function dependent subtarget on the MachineFunction.
Eric Christopher [Sat, 21 Mar 2015 03:13:10 +0000 (03:13 +0000)]
Cache the Function dependent subtarget on the MachineFunction.

As preparation for removing the getSubtargetImpl() call from
TargetMachine go ahead and flip the switch on caching the function
dependent subtarget and remove the bare getSubtargetImpl call
from the X86 port. As part of this add a few tests that show we
can generate code and assemble on X86 based on features/cpu on
the Function.

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

9 years agoGrab the cached subtarget off of the MachineFunction.
Eric Christopher [Sat, 21 Mar 2015 03:13:07 +0000 (03:13 +0000)]
Grab the cached subtarget off of the MachineFunction.

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

9 years agoGrab a subtarget off of a MipsTargetMachine rather than a
Eric Christopher [Sat, 21 Mar 2015 03:13:05 +0000 (03:13 +0000)]
Grab a subtarget off of a MipsTargetMachine rather than a
bare target machine in preparation for the TargetMachine bare
getSubtarget/getSubtargetImpl calls going away.

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

9 years agoSimplify the query for a subtarget in the NVPTX pass manager.
Eric Christopher [Sat, 21 Mar 2015 03:13:03 +0000 (03:13 +0000)]
Simplify the query for a subtarget in the NVPTX pass manager.

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

9 years agoChange getISAEncoding to use the target triple to determine
Eric Christopher [Sat, 21 Mar 2015 03:13:01 +0000 (03:13 +0000)]
Change getISAEncoding to use the target triple to determine
thumb-ness similar to the rest of the Module level asm printing
infrastructure as debug info finalization happens after the function
may be missing.

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

9 years agoMake the Hexagon ISelDAGToDAG pass set the subtarget dynamically
Eric Christopher [Sat, 21 Mar 2015 03:12:59 +0000 (03:12 +0000)]
Make the Hexagon ISelDAGToDAG pass set the subtarget dynamically
on each runOnMachineFunction invocation.

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

9 years ago[sanitizer] experimental tracing for cmp instructions
Kostya Serebryany [Sat, 21 Mar 2015 01:29:36 +0000 (01:29 +0000)]
[sanitizer] experimental tracing for cmp instructions

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

9 years ago[CodeGen][IfCvt] Don't re-ifcvt blocks with unanalyzable terminators.
Ahmed Bougacha [Sat, 21 Mar 2015 01:23:15 +0000 (01:23 +0000)]
[CodeGen][IfCvt] Don't re-ifcvt blocks with unanalyzable terminators.

If we couldn't analyze its terminator (i.e., it's an indirectbr, or some
other weirdness), we can't safely re-if-convert a predicated block,
because we can't tell whether the predicated terminator can
fallthrough (it does).

Currently, we would completely ignore the fallthrough successor. In
the added testcase, this means we used to generate:

    ...
  @ %entry:
    cmp   r5, #21
    ittt  ne
  @ %cc1f:
    cmpne r7, #42
  @ %cc2t:
    strne.w       r5, [r8]
    movne pc, r10
  @ %cc1t:
    ...

Whereas the successor of %cc1f was originally %bb1.
With the fix, we get the correct:

    ...
  @ %entry:
    cmp   r5, #21
    itt   eq
  @ %cc1t:
    streq.w       r5, [r11]
    moveq pc, r0
  @ %cc1f:
    cmp   r7, #42
    itt   ne
  @ %cc2t:
    strne.w       r5, [r8]
    movne pc, r10
  @ %bb1:
    ...

rdar://20192768
Differential Revision: http://reviews.llvm.org/D8509

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

9 years ago[AArch64] Prefer UZP for concat_vector of illegal truncs.
Ahmed Bougacha [Sat, 21 Mar 2015 01:08:39 +0000 (01:08 +0000)]
[AArch64] Prefer UZP for concat_vector of illegal truncs.

Follow-up to r232459: prefer a UZP shuffle to the intermediate truncs.

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

9 years agoMake getLastArgNoClaim work for up to 4 arguments.
Filipe Cabecinhas [Fri, 20 Mar 2015 23:32:58 +0000 (23:32 +0000)]
Make getLastArgNoClaim work for up to 4 arguments.

Summary:
This is needed for http://reviews.llvm.org/D8507
I have no idea what stand-alone tests could be done, if needed.

Reviewers: Bigcheese, craig.topper, samsonov

Subscribers: llvm-commits

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

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

9 years agoTell lit.cfg about more Windows triples.
Yunzhong Gao [Fri, 20 Mar 2015 22:08:40 +0000 (22:08 +0000)]
Tell lit.cfg about more Windows triples.
For example, the host triple on my 64-bit PC is x86_64-pc-windows-msvc.

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

9 years ago[X86, AVX] instcombine common cases of vperm2* intrinsics into shuffles
Sanjay Patel [Fri, 20 Mar 2015 21:47:56 +0000 (21:47 +0000)]
[X86, AVX] instcombine common cases of vperm2* intrinsics into shuffles

vperm2* intrinsics are just shuffles.
In a few special cases, they're not even shuffles.

Optimizing intrinsics in InstCombine is better than
handling this in the front-end for at least two reasons:

1. Optimizing custom-written SSE intrinsic code at -O0 makes vector coders
   really angry (and so I have regrets about some patches from last week).

2. Doing mask conversion logic in header files is hard to write and
   subsequently read.

There are a couple of TODOs in this patch to complete this optimization.

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

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

9 years agoFixing a bug with WinEH PHI handling
Andrew Kaylor [Fri, 20 Mar 2015 21:42:54 +0000 (21:42 +0000)]
Fixing a bug with WinEH PHI handling

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

9 years ago[X86] Prefer blendps over insertps codegen for one special case
Sanjay Patel [Fri, 20 Mar 2015 21:19:52 +0000 (21:19 +0000)]
[X86] Prefer blendps over insertps codegen for one special case

With this patch, for this one exact case, we'll generate:

  blendps %xmm0, %xmm1, $1

instead of:

  insertps %xmm0, %xmm1, $0

If there's a memory operand available for load folding and we're
optimizing for size, we'll still generate the insertps.

The detailed performance data motivation for this may be found in D7866;
in summary, blendps has 2-3x throughput vs. insertps on widely used chips.

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

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

9 years agoX86: Make helper functions static. NFC.
Benjamin Kramer [Fri, 20 Mar 2015 21:07:30 +0000 (21:07 +0000)]
X86: Make helper functions static. NFC.

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

9 years agoRemove dead calls and function arguments dealing with TRI in StackMaps.
Eric Christopher [Fri, 20 Mar 2015 21:05:18 +0000 (21:05 +0000)]
Remove dead calls and function arguments dealing with TRI in StackMaps.

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

9 years agoDebugInfo: Require valid DIDescriptors
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 20:17:07 +0000 (20:17 +0000)]
DebugInfo: Require valid DIDescriptors

As part of PR22777, switch from `dyn_cast_or_null<>` to `cast<>` in most
`DIDescriptor` accessors.  These classes are lightweight wrappers around
pointers, so the users should check for valid pointers before using
them.

This survives a Darwin clang -g bootstrap (after fixing testcases), but
it's possible the bots will complain about other configurations.  I'll
fix any fallout as quickly as I can!  Once this bakes for a bit I'll
remove the macros.

Note that `DebugLoc` implicitly gets stricter with this change as well,
since it forward to `DILocation`.  Any code that's using `DebugLoc`
accessors should check `DebugLoc::isUnknown()` first.  (BTW, I'm also
partway through a cleanup of the `DebugLoc` API to make it more obvious
what it is (a glorified pointer wrapper) and remove cruft from before
the Metadata/Value split.  I'll commit soon.)

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

9 years agoDon't declare all text sections at the start of the .s
Rafael Espindola [Fri, 20 Mar 2015 20:00:01 +0000 (20:00 +0000)]
Don't declare all text sections at the start of the .s

The code this patch removes was there to make sure the text sections went
before the dwarf sections. That is necessary because MachO uses offsets
relative to the start of the file, so adding a section can change relaxations.

The dwarf sections were being printed at the start just to produce symbols
pointing at the start of those sections.

The underlying issue was fixed in r231898. The dwarf sections are now printed
when they are about to be used, which is after we printed the text sections.

To make sure we don't regress, the patch makes the MachO streamer assert
if CodeGen puts anything unexpected after the DWARF sections.

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

9 years agoBugpoint: Fix invalid 'inlinedAt:' references in testcase
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 19:51:34 +0000 (19:51 +0000)]
Bugpoint: Fix invalid 'inlinedAt:' references in testcase

These are causing crashes in `DebugInfoFinder` after a WIP patch to
increase strictness of `DIDescriptor` accessors.

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

9 years agoAsmPrinter: Check subprogram before using it
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 19:50:00 +0000 (19:50 +0000)]
AsmPrinter: Check subprogram before using it

Check return of `getDISubprogram()` before using it.  A WIP patch makes
`DIDescriptor` accessors more strict (and would crash on this).

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

9 years agoReorganize the x86 ELF relocation selection logic.
Rafael Espindola [Fri, 20 Mar 2015 19:48:54 +0000 (19:48 +0000)]
Reorganize the x86 ELF relocation selection logic.

The main differences are:

* Split in 32 and 64 bit functions.
* First switch on the Modifier so that we have only one non fully covered
  switch.
* Map the fixup kind first to a x86_64 (or i386) specific enum, to make
  it easy to handle cases like X86::reloc_riprel_4byte_movq_load.
* Switch on IsPCRel last, which reduces code duplication.

Fixes pr22308.

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

9 years agoDwarfDebug: Check for null DebugLocs
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 19:37:03 +0000 (19:37 +0000)]
DwarfDebug: Check for null DebugLocs

`DL` might be null, so check for that before using accessors.  A WIP
patch to make `DIDescriptors` more strict fails otherwise.

As a bonus, I think the logic is easier to follow now (despite the extra
nesting depth).

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

9 years agoVerifier: Check that !dbg attachments have the right type
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 19:26:58 +0000 (19:26 +0000)]
Verifier: Check that !dbg attachments have the right type

A WIP patch makes `DIDescriptor` accessors more strict, which in turn
causes the `DebugInfoFinder` to crash on wrongly typed `!dbg`
attachments.  Catch that error up front in
`Verifier::visitInstruction()`.

Also remove a test that we "handle" invalid `!dbg` attachments, added
back in r99938.  We don't want to handle those anymore.

Note: I'm *not* recursing and verifying the debug info graph reachable
from this node; that work is already done by `verifyDebugInfo()`.

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

9 years agoDebugInfoFinder: Check for null imported entities
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 19:13:53 +0000 (19:13 +0000)]
DebugInfoFinder: Check for null imported entities

Don't use the accessors in `DIImportedEntity` on a null pointer.  (A WIP
patch to make `DIDescriptor` accessors more strict crashes here
otherwise.)

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

9 years agoSanitizerCoverage: Check for null DebugLocs
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 18:48:45 +0000 (18:48 +0000)]
SanitizerCoverage: Check for null DebugLocs

After a WIP patch to make `DIDescriptor` accessors more strict, this
started asserting.

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

9 years agoSelectionDAGBuilder: Rangeify a loop. NFC.
Hans Wennborg [Fri, 20 Mar 2015 18:48:40 +0000 (18:48 +0000)]
SelectionDAGBuilder: Rangeify a loop. NFC.

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

9 years agoSelectionDAGBuilder::handleJTSwitchCase, simplify loop; NFC
Hans Wennborg [Fri, 20 Mar 2015 18:48:31 +0000 (18:48 +0000)]
SelectionDAGBuilder::handleJTSwitchCase, simplify loop; NFC

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

9 years agoRewrite test/Feature/md_on_instruction.ll
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 18:34:53 +0000 (18:34 +0000)]
Rewrite test/Feature/md_on_instruction.ll

This test is supposed to be testing whether metadata attachments to
instructions work, but it was using invalid debug info to do so.  (This
was causing assertion failures in the `DebugInfoFinder` with a WIP patch
to be more strict about `DIDescriptor` accessors.)

Rather than fix the debug info -- which is better tested elsewhere --
just test the IR feature directly.

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

9 years agoCorrectly estimate SROA savings for store operands in inline cost analysis.
Wei Mi [Fri, 20 Mar 2015 18:33:12 +0000 (18:33 +0000)]
Correctly estimate SROA savings for store operands in inline cost analysis.

When estimating SROA savings, we want to see if an address is derived
off an alloca in the caller. For store instructions, operand 1 is the
address operand, but the current code uses operand 0.  Use
getPointerOperand for loads and stores to fix this.

Patch by Easwaran Raman.
http://reviews.llvm.org/D8425

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

9 years agoSmall optimization to avoid getting pass info when we will not run loop
Daniel Berlin [Fri, 20 Mar 2015 18:05:49 +0000 (18:05 +0000)]
Small optimization to avoid getting pass info when we will not run loop

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

9 years ago[ARM] Fix handling of thumb1 out-of-range frame offsets
John Brawn [Fri, 20 Mar 2015 17:20:07 +0000 (17:20 +0000)]
[ARM] Fix handling of thumb1 out-of-range frame offsets

LocalStackSlotPass assumes that isFrameOffsetLegal doesn't change its
answer when the base register changes. Unfortunately this isn't true
in thumb1, where SP-based loads allow a larger offset than
non-SP-based loads, and this causes the base register reuse code to
generate instructions that are unencodable, causing an assertion
failure.

Solve this by adding a BaseReg parameter to isFrameOffsetLegal, which
ARMBaseRegisterInfo can then make use of to give the correct answer.

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

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

9 years agoStripped trailing whitespace. NFC.
Simon Pilgrim [Fri, 20 Mar 2015 16:08:17 +0000 (16:08 +0000)]
Stripped trailing whitespace. NFC.

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

9 years agoRewrite StackMap location handling to pre-compute the dwarf register
Eric Christopher [Fri, 20 Mar 2015 16:03:42 +0000 (16:03 +0000)]
Rewrite StackMap location handling to pre-compute the dwarf register
numbers before emission.

This removes a dependency on being able to access TRI at the module
level and is similar to the DwarfExpression handling. I've modified
the debug support into print/dump routines that'll do the same dumping
but is now callable anywhere and if TRI isn't available will go ahead
and just print out raw register numbers.

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

9 years agoAt the beginning of doFinalization set the MachineFunction to
Eric Christopher [Fri, 20 Mar 2015 16:03:39 +0000 (16:03 +0000)]
At the beginning of doFinalization set the MachineFunction to
nullptr so that users get an earlier dereferencing error and
so that we can use it to conditionalize access to MachineFunction
specific data.

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

9 years agoTypo.
Chad Rosier [Fri, 20 Mar 2015 15:45:14 +0000 (15:45 +0000)]
Typo.

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

9 years agoR600/SI: Refactor VOP2 instruction defs
Tom Stellard [Fri, 20 Mar 2015 15:14:23 +0000 (15:14 +0000)]
R600/SI: Refactor VOP2 instruction defs

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

9 years agoR600/SI: Refactor VOP1 instruction defs
Tom Stellard [Fri, 20 Mar 2015 15:14:21 +0000 (15:14 +0000)]
R600/SI: Refactor VOP1 instruction defs

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

9 years agoReduce indentation after return. NFC.
Rafael Espindola [Fri, 20 Mar 2015 14:33:25 +0000 (14:33 +0000)]
Reduce indentation after return. NFC.

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

9 years agoUse early returns. NFC.
Rafael Espindola [Fri, 20 Mar 2015 14:23:46 +0000 (14:23 +0000)]
Use early returns. NFC.

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

9 years agoFold a llvm_unreachable into an assert. NFC.
Rafael Espindola [Fri, 20 Mar 2015 13:50:15 +0000 (13:50 +0000)]
Fold a llvm_unreachable into an assert. NFC.

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

9 years agoclang-format a function. NFC.
Rafael Espindola [Fri, 20 Mar 2015 13:47:40 +0000 (13:47 +0000)]
clang-format a function. NFC.

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

9 years ago[MBP] Don't outline short optional branches
Daniel Jasper [Fri, 20 Mar 2015 10:00:37 +0000 (10:00 +0000)]
[MBP] Don't outline short optional branches

With the option -outline-optional-branches, LLVM will place optional
branches out of line (more details on r231230).

With this patch, this is not done for short optional branches. A short
optional branch is a branch containing a single block with an
instruction count below a certain threshold (defaulting to 3). Still
everything is guarded under -outline-optional-branches).

Outlining a short branch can't significantly improve code locality. It
can however decrease performance because of the additional jmp and in
cases where the optional branch is hot. This fixes a compile time
regression I have observed in a benchmark.

Review: http://reviews.llvm.org/D8108

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

9 years ago[Tablegen] Attempt to add support for patterns containing nodes with multiple results.
Craig Topper [Fri, 20 Mar 2015 05:09:06 +0000 (05:09 +0000)]
[Tablegen] Attempt to add support for patterns containing nodes with multiple results.

This is needed for AVX512 masked scatter/gather support.

The R600 change is necessary to remove a hack that was working around the lack of multiple results.

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

9 years agoR600/SI: Add missing CHECK-LABEL lines to a test
Tom Stellard [Fri, 20 Mar 2015 03:12:42 +0000 (03:12 +0000)]
R600/SI: Add missing CHECK-LABEL lines to a test

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

9 years agoFix comment from r232794. NFC
Nick Lewycky [Fri, 20 Mar 2015 02:52:23 +0000 (02:52 +0000)]
Fix comment from r232794. NFC

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

9 years ago[bpf] fix build
Alexei Starovoitov [Fri, 20 Mar 2015 02:35:29 +0000 (02:35 +0000)]
[bpf] fix build

fix BPF backend build broken by r232699

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

9 years agoWhen simplifying a SCEV truncate by distributing, consider it a simplification to...
Nick Lewycky [Fri, 20 Mar 2015 02:25:00 +0000 (02:25 +0000)]
When simplifying a SCEV truncate by distributing, consider it a simplification to replace a cast, even if we end up with a trunc around the term. Fixes PR22960!

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

9 years agoSampleProfile: Check for missing debug locations
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 00:56:55 +0000 (00:56 +0000)]
SampleProfile: Check for missing debug locations

Don't use `DebugLoc` accessors if we're pointing at null, which will be
a problem after a WIP patch to make the `DIDescriptor` accessors more
strict.  Caught by Frontend/profile-sample-use-loc-tracking.c (in
clang).

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

9 years agoVerifier: Remove the separate DebugInfoVerifier class
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 00:48:23 +0000 (00:48 +0000)]
Verifier: Remove the separate DebugInfoVerifier class

Remove the separate `DebugInfoVerifier` class, as a partial step toward
better integrating debug info verification with the `Verifier`.

Right now, verification of debug info is kind of a mess.

  - There are `DIDescriptor::Verify()` checks live in `DebugInfo.cpp`.
    These return `bool`, and there's no way to see (except by opening a
    debugger) why they fail.
  - We rely on `DebugInfoFinder` to traverse the debug info graph and
    dig up nodes.  However, the regular `Verifier` visits many of these
    nodes when it calls into debug info intrinsic operands.  Visiting
    twice and running different checks is kind of absurd.
  - Moreover, `DebugInfoFinder` asserts on failed type resolution -- the
    verifier should never assert!

By integrating the two verifiers, I'm aiming at solving these problems
(work to be done, obviously).  Verification can be localized to the
`Verifier`; we can use a naive `MDNode` operand traversal to find all
the nodes; we can verify type references instead of asserting on
failure.

There are `assert()`s sprinkled throughout the optimizer and dwarf
backend on `DIDescriptor::Verify()` checks.  This is a hangover from
when the debug info verifier was off, so I plan to remove them as I go
(once I confirm that the checks are done at verification time).

Note: to keep the behaviour of only running the debug info verifier when
-verify succeeds, I've added an `EverBroken` flag.  Once the
`DebugInfoFinder` assertions are gone and the two traversals have been
merged, I expect to be able to remove this.

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

9 years agoRewrite SelectionDAGBuilder::Clusterify to run in linear time. NFC.
Hans Wennborg [Fri, 20 Mar 2015 00:41:03 +0000 (00:41 +0000)]
Rewrite SelectionDAGBuilder::Clusterify to run in linear time. NFC.

It was previously repeatedly erasing elements from the middle of a vector,
causing O(n^2) worst-case run-time.

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

9 years agotest: Make a start on a test suite for libLTO.
Peter Collingbourne [Thu, 19 Mar 2015 23:55:38 +0000 (23:55 +0000)]
test: Make a start on a test suite for libLTO.

This works in a similar way to the gold plugin tests. We search for a compatible
linker on $PATH and use it to run tests against our just-built libLTO. To start
with, test the just added opt level functionality.

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

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

9 years agoUse the cached subtarget on the MachineFunction when the AsmPrinter
Eric Christopher [Thu, 19 Mar 2015 23:27:42 +0000 (23:27 +0000)]
Use the cached subtarget on the MachineFunction when the AsmPrinter
will have a MachineFunction, i.e. in places other than the module
level doInitialize/doFinalize.

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

9 years agoUse the cached subtarget off of the machine function.
Eric Christopher [Thu, 19 Mar 2015 23:06:21 +0000 (23:06 +0000)]
Use the cached subtarget off of the machine function.

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

9 years agomove insert, extract, concat helper functions closer to related helper functions...
Sanjay Patel [Thu, 19 Mar 2015 23:04:25 +0000 (23:04 +0000)]
move insert, extract, concat helper functions closer to related helper functions; NFCI

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

9 years agoFix a nasty bug in DAGCombine of STORE nodes.
Owen Anderson [Thu, 19 Mar 2015 22:48:57 +0000 (22:48 +0000)]
Fix a nasty bug in DAGCombine of STORE nodes.

This is very related to the bug fixed in r174431.  The problem is that
SelectionDAG does not include alignment in the uniquing of loads and
stores.  When an otherwise no-op DAGCombine would increase the alignment
of a load or store, the original node would be returned (with the
alignment increased), which would cause the node not to be processed by
any further DAGCombines.

I don't have a direct testcase for this that manifests on an in-tree
target, but I did see some noise in the tests for other targets and have
updated them for it.

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

9 years agoRemove unused headers.
Eric Christopher [Thu, 19 Mar 2015 22:36:38 +0000 (22:36 +0000)]
Remove unused headers.

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

9 years agoAdd an MCSubtargetInfo variable to the TargetMachine.
Eric Christopher [Thu, 19 Mar 2015 22:36:37 +0000 (22:36 +0000)]
Add an MCSubtargetInfo variable to the TargetMachine.

This enables us to remove calls to the subtarget from the TargetMachine
and with a small hack for backends that require global subtarget
information for module level code generation, e.g. mips abi flags, as
mentioned in a fixme in the code.

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

9 years agoAdd a TargetMachine local MCRegisterInfo and MCInstrInfo so that
Eric Christopher [Thu, 19 Mar 2015 22:36:32 +0000 (22:36 +0000)]
Add a TargetMachine local MCRegisterInfo and MCInstrInfo so that
they can be used without a subtarget in constructing subtarget
independent passes.

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

9 years agoWinEH: Make llvm.eh.actions emission match the EH docs
Reid Kleckner [Thu, 19 Mar 2015 22:31:02 +0000 (22:31 +0000)]
WinEH: Make llvm.eh.actions emission match the EH docs

This switches the sense of the i32 values and updates the test cases.

We can also use CHECK-SAME to clean up some tests, and reduce the visual
noise from bitcasts.

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

9 years ago[X86, AVX] use blends instead of insert128 with index 0
Sanjay Patel [Thu, 19 Mar 2015 22:29:40 +0000 (22:29 +0000)]
[X86, AVX] use blends instead of insert128 with index 0

Another case of x86-specific shuffle strength reduction:
avoid generating insert*128 instructions with index 0 because
they are slower than their non-lane-changing blend equivalents.

Shuffle lowering already catches most of these cases, but
the zero vector case and some other paths such as in the
modified test in vector-shuffle-256-v32.ll were getting
through.

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

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

9 years agoVerifier: Remove the separate -verify-di pass
Duncan P. N. Exon Smith [Thu, 19 Mar 2015 22:24:17 +0000 (22:24 +0000)]
Verifier: Remove the separate -verify-di pass

Remove `DebugInfoVerifierLegacyPass` and the `-verify-di` pass.
Instead, call into the `DebugInfoVerifier` from inside
`VerifierLegacyPass::finalizeModule()`.  This better matches the logic
in `verifyModule()` (used by the new PassManager), avoids requiring two
separate passes to verify the IR, and makes the API for "add a pass to
verify the IR" simple.

Note: the `-verify-debug-info` flag still works (for now, at least;
eventually it might make sense to just remove it).

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

9 years agoFix build failure.
Peter Collingbourne [Thu, 19 Mar 2015 22:12:08 +0000 (22:12 +0000)]
Fix build failure.

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

9 years agoLowerBitSets: Avoid reusing byte set addresses.
Peter Collingbourne [Thu, 19 Mar 2015 22:02:10 +0000 (22:02 +0000)]
LowerBitSets: Avoid reusing byte set addresses.

Each use of the byte array uses a different alias. This makes the
backend less likely to reuse previously computed byte array addresses,
improving the security of the CFI mechanism based on this pass.

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

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

9 years agolibLTO, llvm-lto, gold: Introduce flag for controlling optimization level.
Peter Collingbourne [Thu, 19 Mar 2015 22:01:00 +0000 (22:01 +0000)]
libLTO, llvm-lto, gold: Introduce flag for controlling optimization level.

This change also introduces a link-time optimization level of 1. This
optimization level runs only the globaldce pass as well as cleanup passes for
passes that run at -O0, specifically simplifycfg which cleans up lowerbitsets.

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150316/266951.html

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

9 years agoPassManagerBuilder: Remove effectively dead 'StripDebug' option
Duncan P. N. Exon Smith [Thu, 19 Mar 2015 21:37:17 +0000 (21:37 +0000)]
PassManagerBuilder: Remove effectively dead 'StripDebug' option

`StripDebug` was only used by tools/opt/opt.cpp in
`AddStandardLinkPasses()`, but opt.cpp adds the same pass based on its
command-line flag before it calls `AddStandardLinkPasses()`.  Stripping
debug info twice isn't very useful.

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

9 years agoSwitch lowering: extract NextBlock function. NFC.
Hans Wennborg [Thu, 19 Mar 2015 20:41:48 +0000 (20:41 +0000)]
Switch lowering: extract NextBlock function. NFC.

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

9 years agoUnxfail test/CodeGen/Generic/vector.ll now passing on Hexagon
Krzysztof Parzyszek [Thu, 19 Mar 2015 20:22:17 +0000 (20:22 +0000)]
Unxfail test/CodeGen/Generic/vector.ll now passing on Hexagon

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

9 years agogold: Make powerpc support optional for the tests.
Peter Collingbourne [Thu, 19 Mar 2015 18:23:31 +0000 (18:23 +0000)]
gold: Make powerpc support optional for the tests.

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

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

9 years agoGlobalDCE: Improve performance for large modules containing comdats.
Peter Collingbourne [Thu, 19 Mar 2015 18:23:29 +0000 (18:23 +0000)]
GlobalDCE: Improve performance for large modules containing comdats.

When we encounter a global with a comdat, rather than iterating over
every global in the module to find globals in the same comdat, store the
members in a multimap. This effectively lowers the complexity to O(N log N),
improving performance significantly for large modules such as might be
encountered during LTO.

It looks like we used to do something like this until r219191.

No functional change.

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

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

9 years agodocs: Update llvm-cov docs for the -use-color flag
Justin Bogner [Thu, 19 Mar 2015 18:22:46 +0000 (18:22 +0000)]
docs: Update llvm-cov docs for the -use-color flag

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

9 years agoAdd support for __nvvm_reflect changes in libdevice in CUDA-7.0
Artem Belevich [Thu, 19 Mar 2015 17:05:35 +0000 (17:05 +0000)]
Add support for __nvvm_reflect changes in libdevice in CUDA-7.0

Summary:
CUDA 7.0's libdevice uses slightly different IR to call __nvvm_reflect
and that triggers an assertion in nvvm_reflect optimization pass. This
change allows nvvm_reflect pass to deal with both old and new ways to
pass an argument to __nvvm_reflect.

Test Plan: ninja check-all

Reviewers: eliben, echristo

Subscribers: jholewinski, llvm-commits

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

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

9 years agoFixing dependencies for native tablegen.
Chris Bieneman [Thu, 19 Mar 2015 16:49:44 +0000 (16:49 +0000)]
Fixing dependencies for native tablegen.

The dependencies for cross-built tablegen were a bit confused. This fixes that. The following dependencies are now enforced:

(1) Tablegen tasks depend on the native tablegen
(2) Native tablegen depends on the cross-compiled tablegen

Although the native tablegen doesn't actually require the cross tablegen, having this dependency forces the native tablegen to rebuild whenever the cross tablegen changes.

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

9 years agoSwitch lowering: remove unnecessary ConstantInt casts. NFC.
Hans Wennborg [Thu, 19 Mar 2015 16:42:21 +0000 (16:42 +0000)]
Switch lowering: remove unnecessary ConstantInt casts. NFC.

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

9 years ago[Hexagon] Add support for vector instructions
Krzysztof Parzyszek [Thu, 19 Mar 2015 16:33:08 +0000 (16:33 +0000)]
[Hexagon] Add support for vector instructions

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

9 years ago[CMake] Don't pass in MSVC warning flags as definitions.
Greg Bedwell [Thu, 19 Mar 2015 16:32:47 +0000 (16:32 +0000)]
[CMake] Don't pass in MSVC warning flags as definitions.

NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.

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

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

9 years ago[Hexagon] ENDLOOP is a non-reversible conditional branch
Krzysztof Parzyszek [Thu, 19 Mar 2015 15:18:57 +0000 (15:18 +0000)]
[Hexagon] ENDLOOP is a non-reversible conditional branch

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

9 years agoInternalize PEI. NFC.
Benjamin Kramer [Thu, 19 Mar 2015 14:09:20 +0000 (14:09 +0000)]
Internalize PEI. NFC.

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