oota-llvm.git
8 years agoX86: More efficient legalization of wide integer compares
Hans Wennborg [Thu, 19 Nov 2015 16:35:08 +0000 (16:35 +0000)]
X86: More efficient legalization of wide integer compares

In particular, this makes the code for 64-bit compares on 32-bit targets
much more efficient.

Example:

  define i32 @test_slt(i64 %a, i64 %b) {
  entry:
    %cmp = icmp slt i64 %a, %b
    br i1 %cmp, label %bb1, label %bb2
  bb1:
    ret i32 1
  bb2:
    ret i32 2
  }

Before this patch:

  test_slt:
          movl    4(%esp), %eax
          movl    8(%esp), %ecx
          cmpl    12(%esp), %eax
          setae   %al
          cmpl    16(%esp), %ecx
          setge   %cl
          je      .LBB2_2
          movb    %cl, %al
  .LBB2_2:
          testb   %al, %al
          jne     .LBB2_4
          movl    $1, %eax
          retl
  .LBB2_4:
          movl    $2, %eax
          retl

After this patch:

  test_slt:
          movl    4(%esp), %eax
          movl    8(%esp), %ecx
          cmpl    12(%esp), %eax
          sbbl    16(%esp), %ecx
          jge     .LBB1_2
          movl    $1, %eax
          retl
  .LBB1_2:
          movl    $2, %eax
          retl

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

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

8 years agoTargetParser.cpp: Fixup -- StringRef::startswith() is better here. NFC.
NAKAMURA Takumi [Thu, 19 Nov 2015 15:42:52 +0000 (15:42 +0000)]
TargetParser.cpp: Fixup -- StringRef::startswith() is better here. NFC.

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

8 years agoRemove unused function parameter (NFC)
Mehdi Amini [Thu, 19 Nov 2015 15:42:34 +0000 (15:42 +0000)]
Remove unused function parameter (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoSamplePGO - Sort samples by source location when emitting as text.
Diego Novillo [Thu, 19 Nov 2015 15:33:08 +0000 (15:33 +0000)]
SamplePGO - Sort samples by source location when emitting as text.

When dumping function samples or writing them out as text format, it
helps if the samples are emitted sorted by source location. The sorting
of the maps is a bit slow, so we only do it on demand.

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

8 years ago[mips] Add tests for ROL and ROR macros expansion
Zoran Jovanovic [Thu, 19 Nov 2015 15:04:31 +0000 (15:04 +0000)]
[mips] Add tests for ROL and ROR macros expansion

Author: obucina

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

8 years agollvm/lib/Support/TargetParser.cpp: Rework llvm::ARM::getArchExtFeature() to avoid...
NAKAMURA Takumi [Thu, 19 Nov 2015 15:03:11 +0000 (15:03 +0000)]
llvm/lib/Support/TargetParser.cpp: Rework llvm::ARM::getArchExtFeature() to avoid abuse of Twine in r253470.

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

8 years ago[LV] Add a helper function, isReductionVariable. NFC.
Chad Rosier [Thu, 19 Nov 2015 14:19:06 +0000 (14:19 +0000)]
[LV] Add a helper function, isReductionVariable. NFC.

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

8 years ago[mips] Expansion of ROL and ROR macros
Zoran Jovanovic [Thu, 19 Nov 2015 14:15:03 +0000 (14:15 +0000)]
[mips] Expansion of ROL and ROR macros

Author: obucina

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

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

8 years agoAVX-512: Fixed COPY_TO_REGCLASS for mask registers
Elena Demikhovsky [Thu, 19 Nov 2015 13:13:00 +0000 (13:13 +0000)]
AVX-512: Fixed COPY_TO_REGCLASS for mask registers

Copying one mask register to another under BW should be done with kmovq instruction, otherwise we can loose some bits.
Copying 8 bits under DQ may be done with kmovb.

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

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

8 years agoRemoving specific target from the generic test
Artyom Skrobov [Thu, 19 Nov 2015 12:24:47 +0000 (12:24 +0000)]
Removing specific target from the generic test

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

8 years ago[X86][AVX] Fix lowering of X86ISD::VZEXT_MOVL for 128-bit -> 256-bit extension
Simon Pilgrim [Thu, 19 Nov 2015 12:18:37 +0000 (12:18 +0000)]
[X86][AVX] Fix lowering of X86ISD::VZEXT_MOVL for 128-bit -> 256-bit extension

The lowering patterns for X86ISD::VZEXT_MOVL for 128-bit to 256-bit vectors were just copying the lower xmm instead of actually masking off the first scalar using a blend.

Fix for PR25320.

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

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

8 years agoAlternative to long nops for X86 CPUs, by Andrey Turetsky
Alexey Bataev [Thu, 19 Nov 2015 11:44:35 +0000 (11:44 +0000)]
Alternative to long nops for X86 CPUs, by Andrey Turetsky
Make X86AsmBackend generate smarter nops instead of a bunch of 0x90 for code alignment for CPUs which don't support long nop instructions.
Differential Revision: http://reviews.llvm.org/D14178

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

8 years ago[lit] Fix bug when using Python3 where a failing test would not show
Dan Liew [Thu, 19 Nov 2015 11:35:42 +0000 (11:35 +0000)]
[lit] Fix bug when using Python3 where a failing test would not show
the script when running a ShTest with an external or internal shell.

This bug is caused by use of the ``map`` function in Python 3 which
returns an iterable (rather than a list in Python 2). After the iterable
is exhausted it won't return any more output and consequently when
``_runShTest()`` tries to access the ``script`` which has already been
iterated over it is empty. Converting to a list immediatley after
calling ``map()`` fixes this.

This fixes the ``tests/shtest-format.py`` test when running under
Python3 which was previously failing.

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

8 years agogold-plugin.cpp: Fix diagnosticHandler corresponding to r253540.
NAKAMURA Takumi [Thu, 19 Nov 2015 10:43:44 +0000 (10:43 +0000)]
gold-plugin.cpp: Fix diagnosticHandler corresponding to r253540.

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

8 years ago[FunctionAttrs] Provide a mechanism for adding function attributes from the command...
James Molloy [Thu, 19 Nov 2015 08:49:57 +0000 (08:49 +0000)]
[FunctionAttrs] Provide a mechanism for adding function attributes from the command line

This provides a way to force a function to have certain attributes from the command line. This can be useful when debugging or doing workload exploration, where manually editing IR is tedious or not possible (due to build systems etc).

The syntax is -force-attribute=function_name:attribute_name

All function attributes are parsed except alignstack as it requires an argument.

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

8 years agoAVX512: Implemented encoding, intrinsics and DAG lowering for VMOVDDUP instructions.
Igor Breger [Thu, 19 Nov 2015 08:26:56 +0000 (08:26 +0000)]
AVX512: Implemented encoding, intrinsics and DAG lowering for VMOVDDUP instructions.

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

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

8 years agoAVX512: Implemented encoding for the vmovss.s and vmovsd.s instructions.
Igor Breger [Thu, 19 Nov 2015 07:58:33 +0000 (07:58 +0000)]
AVX512: Implemented encoding for the vmovss.s and vmovsd.s instructions.

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

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

8 years agoAVX512: Implemented encoding for the follow instructions.
Igor Breger [Thu, 19 Nov 2015 07:43:43 +0000 (07:43 +0000)]
AVX512: Implemented encoding for the follow instructions.
    vmovapd.s, vmovaps.s, vmovdqa32.s, vmovdqa64.s, vmovdqu16.s, vmovdqu32.s, vmovdqu64.s, vmovdqu8.s, vmovupd.s, vmovups.s

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

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

8 years agoPointers in Masked Load, Store, Gather, Scatter intrinsics
Elena Demikhovsky [Thu, 19 Nov 2015 07:17:16 +0000 (07:17 +0000)]
Pointers in Masked Load, Store, Gather, Scatter intrinsics

The masked intrinsics support all integer and floating point data types. I added the pointer type to this list.
Added tests for CodeGen and for Loop Vectorizer.
Updated the Language Reference.

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

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

8 years agoRevert "Change memcpy/memset/memmove to have dest and source alignments."
Pete Cooper [Thu, 19 Nov 2015 05:56:52 +0000 (05:56 +0000)]
Revert "Change memcpy/memset/memmove to have dest and source alignments."

This reverts commit r253511.

This likely broke the bots in
http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202
http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787

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

8 years agoDo not require a Context to extract the FunctionIndex from Bitcode (NFC)
Mehdi Amini [Thu, 19 Nov 2015 05:52:29 +0000 (05:52 +0000)]
Do not require a Context to extract the FunctionIndex from Bitcode (NFC)

The LLVMContext was only used for Diagnostic. Pass a DiagnosticHandler
instead.

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years ago[Support] Disable SaturatingMultiply() unit test while investigating
Nathan Slingerland [Thu, 19 Nov 2015 05:20:17 +0000 (05:20 +0000)]
[Support] Disable SaturatingMultiply() unit test while investigating

Ubsan detected undefined behavior in the MathExtras SaturatingMultiply test.

This change disables the test while it is being investigated.

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

8 years agoFix bug 25440: GVN assertion after coercing loads
Weiming Zhao [Thu, 19 Nov 2015 02:45:18 +0000 (02:45 +0000)]
Fix bug 25440: GVN assertion after coercing loads

Optimizations like LoadPRE in GVN will insert new instructions.
If the insertion point is in a already processed BB, they should
get a value number explicitly. If the insertion point is after
current instruction, then just leave it. However, current GVN framework
has no support for it.
In this patch, we just bail out if a VN can't be found.

Dfferential Revision: http://reviews.llvm.org/D14670

A    test/Transforms/GVN/pr25440.ll
M    lib/Transforms/Scalar/GVN.cpp

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

8 years agoFix UMR in llvm-nm on IR object files in printDarwinSymbol
Reid Kleckner [Thu, 19 Nov 2015 00:51:50 +0000 (00:51 +0000)]
Fix UMR in llvm-nm on IR object files in printDarwinSymbol

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

8 years ago[X86] Enable shrink-wrapping by default.
Quentin Colombet [Thu, 19 Nov 2015 00:38:00 +0000 (00:38 +0000)]
[X86] Enable shrink-wrapping by default.

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

rdar://problem/21118279

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

8 years agoFix several long lines (>80) in LoopVectorize.cpp. NFC.
Cong Hou [Thu, 19 Nov 2015 00:32:30 +0000 (00:32 +0000)]
Fix several long lines (>80) in LoopVectorize.cpp. NFC.

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

8 years agoDon't search for third party libraries while using MSan
Reid Kleckner [Thu, 19 Nov 2015 00:05:21 +0000 (00:05 +0000)]
Don't search for third party libraries while using MSan

On the average user's system, those libraries will not be compiled with
MSan. Prior to this change, the LLVM test suite was full of false
positives from calls from third party libraries to MSan interceptors
like strlen.

We can remove this check if MSan ever grows a suppression mechanism
similar to TSan's.

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

8 years agoDisable Go bindings test with MSan, it has tons of linker errors
Reid Kleckner [Thu, 19 Nov 2015 00:05:20 +0000 (00:05 +0000)]
Disable Go bindings test with MSan, it has tons of linker errors

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

8 years agoInitialize PersistentId for HandleSDNode, as these will never be inserted into the DAG
Reid Kleckner [Thu, 19 Nov 2015 00:05:09 +0000 (00:05 +0000)]
Initialize PersistentId for HandleSDNode, as these will never be inserted into the DAG

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

8 years ago[SimplifyLibCalls] New trick: pow(x, 0.5) -> sqrt(x) under -ffast-math.
Davide Italiano [Wed, 18 Nov 2015 23:21:32 +0000 (23:21 +0000)]
[SimplifyLibCalls] New trick: pow(x, 0.5) -> sqrt(x) under -ffast-math.

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

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

8 years ago[AArch64] Enable shrink-wrapping by default.
Quentin Colombet [Wed, 18 Nov 2015 23:12:20 +0000 (23:12 +0000)]
[AArch64] Enable shrink-wrapping by default.

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

rdar://problem/20820748

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

8 years agoFix returned value for GVN: could return "false" even after modifying the IR
Mehdi Amini [Wed, 18 Nov 2015 22:49:49 +0000 (22:49 +0000)]
Fix returned value for GVN: could return "false" even after modifying the IR

This bug would manifest in some very specific cases where all the following
conditions are fullfilled:

- GVN didn't remove block
- The regular GVN iteration didn't change the IR
- PRE is enabled
- PRE will not split critical edge
- The last instruction processed by PRE didn't change the IR

Because the CallGraph PassManager relies on this returned value to decide
if it needs to recompute a node after the execution of Function passes,
not returning the right value can lead to unexpected results.

Fix for: https://llvm.org/bugs/show_bug.cgi?id=24715

Patch by Wenxiang Qiu <vincentqiuuu@gmail.com>

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years ago[CMake] Support -fvisibility-inlines-hidden when LLVM_ENABLE_PIC=Off
Chris Bieneman [Wed, 18 Nov 2015 22:49:26 +0000 (22:49 +0000)]
[CMake] Support -fvisibility-inlines-hidden when LLVM_ENABLE_PIC=Off

I'm unaware of any reasons why -fvisibility-inlines-hidden would depend on PIC, and since autoconf supports this flag without PIC, we should support it in CMake too.

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

8 years agoMinor cleanups (from review feedback)
Xinliang David Li [Wed, 18 Nov 2015 22:42:27 +0000 (22:42 +0000)]
Minor cleanups (from review feedback)

1. remove uneeded header inclusion
2. use reinterpret_cast instead of c ctyle
3. other format change

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

8 years ago[BuildLibCalls] EmitStrNLen() is dead code. Garbage collect.
Davide Italiano [Wed, 18 Nov 2015 22:29:38 +0000 (22:29 +0000)]
[BuildLibCalls] EmitStrNLen() is dead code. Garbage collect.

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

8 years agoChange memcpy/memset/memmove to have dest and source alignments.
Pete Cooper [Wed, 18 Nov 2015 22:17:24 +0000 (22:17 +0000)]
Change memcpy/memset/memmove to have dest and source alignments.

Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

These intrinsics currently have an explicit alignment argument which is
required to be a constant integer.  It represents the alignment of the
source and dest, and so must be the minimum of those.

This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments.  The alignment
argument itself is removed.

There are a few places in the code for which the code needs to be
checked by an expert as to whether using only src/dest alignment is
safe.  For those places, they currently take the minimum of src/dest
alignments which matches the current behaviour.

For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
will now read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)

For out of tree owners, I was able to strip alignment from calls using sed by replacing:
  (call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\)
with:
  $1i1 false)

and similarly for memmove and memcpy.

I then added back in alignment to test cases which needed it.

A similar commit will be made to clang which actually has many differences in alignment as now
IRBuilder can generate different source/dest alignments on calls.

In IRBuilder itself, a new argument was added.  Instead of calling:
  CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false)
you now call
  CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false)

There is a temporary class (IntegerAlignment) which takes the source alignment and rejects
implicit conversion from bool.  This is to prevent isVolatile here from passing its default
parameter to the source alignment.

Note, changes in future can now be made to codegen.  I didn't change anything here, but this
change should enable better memcpy code sequences.

Reviewed by Hal Finkel.

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

8 years ago[doc] fix a wrong link
Jingyue Wu [Wed, 18 Nov 2015 22:01:44 +0000 (22:01 +0000)]
[doc] fix a wrong link

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

8 years ago[DAGCombiner] Vector constant folding for comparisons
Simon Pilgrim [Wed, 18 Nov 2015 21:17:19 +0000 (21:17 +0000)]
[DAGCombiner] Vector constant folding for comparisons

This patch adds support for vector constant folding of integer/float comparisons.

This requires FoldConstantVectorArithmetic to support scalar constant operands (in this case ISD::CONDCASE). In future we should be able to support other scalar constant types as necessary (and possibly start calling FoldConstantVectorArithmetic for all node creations)

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

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

8 years agoARM: make sure backend is consistent about exception handling method.
Tim Northover [Wed, 18 Nov 2015 21:10:39 +0000 (21:10 +0000)]
ARM: make sure backend is consistent about exception handling method.

It turns out we decide whether to use SjLj exceptions or some alternative in
two separate places in the backend, and they disagreed with each other. This
led to inconsistent code and is generally a terrible idea.

So make them consistent and add an assert that they *do* match (unfortunately
MCAsmInfo isn't available in opt, so it can't be used to initialise the CodeGen
version directly).

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

8 years agoDisable gvn non-local speculative loads under asan.
Mike Aizatsky [Wed, 18 Nov 2015 20:43:00 +0000 (20:43 +0000)]
Disable gvn non-local speculative loads under asan.

Summary: Fix for https://llvm.org/bugs/show_bug.cgi?id=25550

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

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

8 years ago[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions (2nd try)
Nathan Slingerland [Wed, 18 Nov 2015 20:40:41 +0000 (20:40 +0000)]
[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions (2nd try)

Summary:
This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them.

Reviewers: dnovillo, bogner, davidxl

Subscribers: davidxl, llvm-commits

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

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

8 years ago[OperandBundles] Address review on r253446; NFC
Sanjoy Das [Wed, 18 Nov 2015 19:44:59 +0000 (19:44 +0000)]
[OperandBundles] Address review on r253446; NFC

Post-commit review by David Blaikie, thanks David!

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

8 years ago[PGO] Value profiling support
Betul Buyukkurt [Wed, 18 Nov 2015 18:14:55 +0000 (18:14 +0000)]
[PGO] Value profiling support

This change introduces an instrumentation intrinsic instruction for
value profiling purposes, the lowering of the instrumentation intrinsic
and raw reader updates. The raw profile data files for llvm-profdata
testing are updated.

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

8 years ago[Aarch64] Add cost for missing extensions.
Matthew Simpson [Wed, 18 Nov 2015 18:03:06 +0000 (18:03 +0000)]
[Aarch64] Add cost for missing extensions.

This patch adds a cost estimate for some missing sign and zero extensions. The
costs were determined by counting the number of shift instructions generated
without context for each new extension.

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

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

8 years agoRemoving specific target from the generic test
Artyom Skrobov [Wed, 18 Nov 2015 17:50:47 +0000 (17:50 +0000)]
Removing specific target from the generic test

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

8 years ago[llvm-profdata] Use SmallSet rather that std::set for keeping track of profdata merge...
Nathan Slingerland [Wed, 18 Nov 2015 17:10:24 +0000 (17:10 +0000)]
[llvm-profdata] Use SmallSet rather that std::set for keeping track of profdata merge errors

Missed bit of feedback from D14720.

Use SmallSet<std::error_code> rather than std::set<...> in order to be more efficient.

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

8 years ago[WebAssembly] Add more whitespace characters to prettify the assembly output.
Dan Gohman [Wed, 18 Nov 2015 17:05:35 +0000 (17:05 +0000)]
[WebAssembly] Add more whitespace characters to prettify the assembly output.

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

8 years ago[ARM] Add +feature names to TargetParser extensions table
Bradley Smith [Wed, 18 Nov 2015 16:32:12 +0000 (16:32 +0000)]
[ARM] Add +feature names to TargetParser extensions table

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

8 years ago[WebAssembly] Make bogus inline asm strings in tests be comments.
Dan Gohman [Wed, 18 Nov 2015 16:28:58 +0000 (16:28 +0000)]
[WebAssembly] Make bogus inline asm strings in tests be comments.

These tests aren't testing that the result is valid syntax; they're testing
that the compiler emits the inline asm operands correctly.

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

8 years ago[WebAssembly] Add some spaces to the assembly output to vertically align operands.
Dan Gohman [Wed, 18 Nov 2015 16:25:38 +0000 (16:25 +0000)]
[WebAssembly] Add some spaces to the assembly output to vertically align operands.

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

8 years ago[WebAssembly] Enable register coloring and register stackifying.
Dan Gohman [Wed, 18 Nov 2015 16:12:01 +0000 (16:12 +0000)]
[WebAssembly] Enable register coloring and register stackifying.

This also takes the push/pop syntax another step forward, introducing stack
slot numbers to make it easier to see how expressions are connected. For
example, the value pushed in $push7 is popped in $pop7.

And, this begins an experiment with making get_local and set_local implicit
when an operation directly uses or defines a register. This greatly reduces
clutter. If this experiment succeeds, it may make sense to do this for
const instructions as well.

And, this introduces more special code for ARGUMENTS; hopefully this code
will soon be obviated by proper support for live-in virtual registers.

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

8 years agoFix bug where WinCOFFObjectWriter would assume starting from an empty output.
Manuel Klimek [Wed, 18 Nov 2015 15:24:17 +0000 (15:24 +0000)]
Fix bug where WinCOFFObjectWriter would assume starting from an empty output.

Starting on an input stream that is not at offset 0 would trigger the
assert in WinCOFFObjectWriter.cpp:1065:

  assert(getStream().tell() <= (*i)->Header.PointerToRawData &&
               "Section::PointerToRawData is insane!");

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

8 years agoFix typo in comment. NFC.
Fraser Cormack [Wed, 18 Nov 2015 15:02:59 +0000 (15:02 +0000)]
Fix typo in comment. NFC.

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

8 years ago[SelectionDAGBuilder] Make sure DemoteReg ends up in right reg-class.
Jonas Paulsson [Wed, 18 Nov 2015 14:59:00 +0000 (14:59 +0000)]
[SelectionDAGBuilder] Make sure DemoteReg ends up in right reg-class.

The virtual register containing the address for returned value on
stack should in the DAG be represented with a CopyFromReg node and not
a Register node. Otherwise, InstrEmitter will not make sure that it
ends up in the right register class for the target instruction.

SystemZ needs this, becuause the reg class for address registers is a
subset of the general 64 bit register class.

test/SystemZ/CodeGen/args-07.ll and args-04.ll updated to run with
-verify-machineinstrs.

Reviewed by Hal Finkel.

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

8 years agoRevert "Revert "Strip metadata when speculatively hoisting instructions (r252604)"
Igor Laevsky [Wed, 18 Nov 2015 14:50:18 +0000 (14:50 +0000)]
Revert "Revert "Strip metadata when speculatively hoisting instructions (r252604)"

Failing clang test is now fixed by the r253458.

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

8 years ago[LTO] Appease buildbots take 3
James Molloy [Wed, 18 Nov 2015 12:08:24 +0000 (12:08 +0000)]
[LTO] Appease buildbots take 3

This time I've found a linux box and checked it there. This test now passes.

Because I'd introduced an undefined reference in @bar, gold now returns an error. This doesn't matter for the test itself, because it also emits the remarks the test is checking for. But it does cause LIT to notice a nonzero return code which it faults on.

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

8 years ago[LTO] Buildbot appeasing take 2
James Molloy [Wed, 18 Nov 2015 11:37:32 +0000 (11:37 +0000)]
[LTO] Buildbot appeasing take 2

Let's try again. This time using the right function signature. It's a real pity I can't run this on a darwin machine...

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

8 years ago[LTO] Fix up test/tools/gold/X86/remarks.ll
James Molloy [Wed, 18 Nov 2015 11:32:14 +0000 (11:32 +0000)]
[LTO] Fix up test/tools/gold/X86/remarks.ll

It needs the same fixes as in test/LTO/X86/remarks.ll, but this test appears not to get run on my system (but does on the buildbot). Strange.

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

8 years ago[LTO] Add an early run of functionattrs
James Molloy [Wed, 18 Nov 2015 11:24:42 +0000 (11:24 +0000)]
[LTO] Add an early run of functionattrs

Because we internalize early, we can potentially mark a bunch of functions as norecurse. Do this before globalopt.

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

8 years ago[X86][AVX512CD] add mask broadcast intrinsics
Asaf Badouh [Wed, 18 Nov 2015 09:42:45 +0000 (09:42 +0000)]
[X86][AVX512CD] add mask broadcast intrinsics

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

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

8 years ago[X86][AVX] Added 256-bit shuffle splat tests.
Simon Pilgrim [Wed, 18 Nov 2015 09:39:38 +0000 (09:39 +0000)]
[X86][AVX] Added 256-bit shuffle splat tests.

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

8 years agoAVX512: Implemented encoding for vpextrw.s instruction.
Igor Breger [Wed, 18 Nov 2015 08:46:16 +0000 (08:46 +0000)]
AVX512: Implemented encoding for vpextrw.s instruction.

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

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

8 years ago[OperandBundles] Tighten OperandBundleDef's interface; NFC
Sanjoy Das [Wed, 18 Nov 2015 08:30:07 +0000 (08:30 +0000)]
[OperandBundles] Tighten OperandBundleDef's interface; NFC

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

8 years ago[mips][microMIPS] Implement DPS.W.PH, DPSQ_S.W.PH, DPSQ_SA.L.W, DPSQX_S.W.PH, DPSQX_S...
Hrvoje Varga [Wed, 18 Nov 2015 07:41:35 +0000 (07:41 +0000)]
[mips][microMIPS] Implement DPS.W.PH, DPSQ_S.W.PH, DPSQ_SA.L.W, DPSQX_S.W.PH, DPSQX_SA.W.PH, DPSU.H.QBL, DPSU.H.QBR and DPSX.W.PH instructions
Differential Revision: http://reviews.llvm.org/D14058

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

8 years agoReplace dyn_cast with isa in places that weren't using the returned value for more...
Craig Topper [Wed, 18 Nov 2015 07:07:59 +0000 (07:07 +0000)]
Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC.

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

8 years agoDefault SetVector to use a DenseSet.
Rafael Espindola [Wed, 18 Nov 2015 06:52:18 +0000 (06:52 +0000)]
Default SetVector to use a DenseSet.

We use to have an odd difference among MapVector and SetVector. The map
used a DenseMop, but the set used a SmallSet, which in turn uses a
std::set.

I have changed SetVector to use a DenseSet. If you were depending on the
old behaviour you can pass an explicit set type or use SmallSetVector.
The common cases for needing to do it are:

* Optimizing for small sets.
* Sets for types not supported by DenseSet.

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

8 years agoTeach the inliner to track deoptimization state
Sanjoy Das [Wed, 18 Nov 2015 06:23:38 +0000 (06:23 +0000)]
Teach the inliner to track deoptimization state

Summary:
This change teaches LLVM's inliner to track and suitably adjust
deoptimization state (tracked via deoptimization operand bundles) as it
inlines through call sites.  The operation is described in more detail
in the LangRef changes.

Reviewers: reames, majnemer, chandlerc, dexonsmith

Subscribers: llvm-commits

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

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

8 years agoStop producing .data.rel sections.
Rafael Espindola [Wed, 18 Nov 2015 06:02:15 +0000 (06:02 +0000)]
Stop producing .data.rel sections.

If a section is rw, it is irrelevant if the dynamic linker will write to
it or not.

It looks like llvm implemented this because gcc was doing it. It looks
like gcc implemented this in the hope that it would put all the
relocated items close together and speed up the dynamic linker.

There are two problem with this:
* It doesn't work. Both bfd and gold will map .data.rel to .data and
  concatenate the input sections in the order they are seen.
* If we want a feature like that, it can be implemented directly in the
  linker since it knowns where the dynamic relocations are.

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

8 years agoFix LLD testsuite fallout from r253429
David Majnemer [Wed, 18 Nov 2015 04:35:32 +0000 (04:35 +0000)]
Fix LLD testsuite fallout from r253429

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

8 years agoAdd a test for r253323
David Majnemer [Wed, 18 Nov 2015 02:50:39 +0000 (02:50 +0000)]
Add a test for r253323

Forgot to do this simultaneously with committing the fix.

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

8 years ago[llvm-objdump] Use the COFF export table for additional symbols
David Majnemer [Wed, 18 Nov 2015 02:49:19 +0000 (02:49 +0000)]
[llvm-objdump] Use the COFF export table for additional symbols

Most linked executables do not have a symbol table in COFF.
However, it is pretty typical to have some export entries.  Use those
entries to inform the disassembler about potential function definitions
and call targets.

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

8 years ago[doc] simplify the doc on compiling CUDA
Jingyue Wu [Wed, 18 Nov 2015 01:59:05 +0000 (01:59 +0000)]
[doc] simplify the doc on compiling CUDA

CUDA support doesn't reply on temporary patches any more. Thanks Artem!

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

8 years agoRemove a redundant assertion in MachineBasicBlock.cpp. NFC.
Cong Hou [Wed, 18 Nov 2015 01:55:56 +0000 (01:55 +0000)]
Remove a redundant assertion in MachineBasicBlock.cpp. NFC.

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

8 years agoRemove redundant code in MachineBasicBlock.cpp. NFC.
Cong Hou [Wed, 18 Nov 2015 01:45:10 +0000 (01:45 +0000)]
Remove redundant code in MachineBasicBlock.cpp. NFC.

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

8 years agoAttempt to fix uninitialized SDAG persistent ids detected by MSan
Reid Kleckner [Wed, 18 Nov 2015 01:21:06 +0000 (01:21 +0000)]
Attempt to fix uninitialized SDAG persistent ids detected by MSan

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

8 years agoLet += and -= operators in BranchProbability have saturation behaviors.
Cong Hou [Wed, 18 Nov 2015 01:20:37 +0000 (01:20 +0000)]
Let += and -= operators in BranchProbability have saturation behaviors.

This commit is for a later patch that is depend on it. The sum of two
branch probabilities can be greater than 1 due to rounding. It is safer
to saturate the results of sum and subtraction.

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

8 years ago[libFuzzer] remove default initializer as a workaround for https://gcc.gnu.org/bugzil...
Kostya Serebryany [Wed, 18 Nov 2015 01:08:30 +0000 (01:08 +0000)]
[libFuzzer] remove default initializer as a workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68399. Don't need it anyway.

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

8 years agoModify the interface BranchProbability::normalizeProbabilities to let it accept a...
Cong Hou [Wed, 18 Nov 2015 01:03:19 +0000 (01:03 +0000)]
Modify the interface BranchProbability::normalizeProbabilities to let it accept a pair of iterators. NFC.

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

8 years agoRevert "[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions"
Nathan Slingerland [Wed, 18 Nov 2015 00:55:15 +0000 (00:55 +0000)]
Revert "[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions"

Not ready for merge.

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

8 years agoImproving edge probabilities computation when choosing the best successor in machine...
Cong Hou [Wed, 18 Nov 2015 00:52:52 +0000 (00:52 +0000)]
Improving edge probabilities computation when choosing the best successor in machine block placement.

When looking for the best successor from the outer loop for a block
belonging to an inner loop, the edge probability computation can be
improved so that edges in the inner loop are ignored. For example,
suppose we are building chains for the non-loop part of the following
code, and looking for B1's best successor. Assume the true body is very
hot, then B3 should be the best candidate. However, because of the
existence of the back edge from B1 to B0, the probability from B1 to B3
can be very small, preventing B3 to be its successor. In this patch, when
computing the probability of the edge from B1 to B3, the weight on the
back edge B1->B0 is ignored, so that B1->B3 will have 100% probability.

if (...)
  do {
    B0;
    ... // some branches
    B1;
  } while(...);
else
  B2;
B3;

Differential revision: http://reviews.llvm.org/D10825

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

8 years ago[llvm-profdata] Fix unhandled enumeration values warning
Nathan Slingerland [Wed, 18 Nov 2015 00:52:45 +0000 (00:52 +0000)]
[llvm-profdata] Fix unhandled enumeration values warning

Fix this:

llvm/tools/llvm-profdata/llvm-profdata.cpp:78:15: warning: 12 enumeration values not handled in switch: 'success', 'eof', 'unrecognized_format'... [-Wswitch]
      switch (instrError) {
                    ^

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

8 years ago[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions
Nathan Slingerland [Wed, 18 Nov 2015 00:52:43 +0000 (00:52 +0000)]
[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions

Summary:
This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them.

No functional changes.

Reviewers: dnovillo, bogner, davidxl

Subscribers: davidxl, llvm-commits

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

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

8 years ago[ARM] Enable shrink-wrapping by default.
Quentin Colombet [Wed, 18 Nov 2015 00:40:54 +0000 (00:40 +0000)]
[ARM] Enable shrink-wrapping by default.

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

rdar://problem/21942589

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

8 years agoGeneralize ownership/passing semantics to allow dsymutil to own abbreviations via...
David Blaikie [Wed, 18 Nov 2015 00:34:10 +0000 (00:34 +0000)]
Generalize ownership/passing semantics to allow dsymutil to own abbreviations via unique_ptr

While still allowing CodeGen/AsmPrinter in llvm to own them using a bump
ptr allocator. (might be nice to replace the pointers there with
something that at least automatically calls their dtors, if that's
necessary/useful, rather than having it done explicitly (I think a typed
BumpPtrAllocator already does this, or maybe a unique_ptr with a custom
deleter, etc))

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

8 years agoRemove excess white space
Rafael Espindola [Wed, 18 Nov 2015 00:31:34 +0000 (00:31 +0000)]
Remove excess white space

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

8 years ago[InstCombine] refactor optimizeIntToFloatBitCast() ; NFCI
Sanjay Patel [Wed, 18 Nov 2015 00:00:04 +0000 (00:00 +0000)]
[InstCombine] refactor optimizeIntToFloatBitCast() ; NFCI

The logic for handling the pattern without a shift is identical
to the logic for handling the pattern with a shift if you set
the shift amount to zero for the former.

This should make it easier to see that we probably don't even need
optimizeIntToFloatBitCast().

If we call something like foldVecTruncToExtElt() from visitTrunc(),
we'll solve PR25543:
https://llvm.org/bugs/show_bug.cgi?id=25543

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

8 years ago[llvm-profdata] Show hint for other mismatch errors when merging instr profdata
Nathan Slingerland [Tue, 17 Nov 2015 23:37:09 +0000 (23:37 +0000)]
[llvm-profdata] Show hint for other mismatch errors when merging instr profdata

Missed bit of feedback from D14720.

Show the same "Make sure that all profile
data to be merged is generated from the same binary." hint for hash mismatch
and value site count mismatch as we now do for counter mismatch when merging
incompatible instrumentation profile data.

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

8 years ago[X86][AVX512] Added AVX512 SHUFP*/VPERMILP* shuffle decode comments.
Simon Pilgrim [Tue, 17 Nov 2015 23:29:49 +0000 (23:29 +0000)]
[X86][AVX512] Added AVX512 SHUFP*/VPERMILP* shuffle decode comments.

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

8 years agoFix read-of-uninitialized introduced in r253277 exposed on some buildbots
David Blaikie [Tue, 17 Nov 2015 23:26:06 +0000 (23:26 +0000)]
Fix read-of-uninitialized introduced in r253277 exposed on some buildbots

Verified that this was at least /an/ issue, if not the only one, by
initializing NumBuckets to 1 (previously it was uninitialized, so if
this change made a difference, which it did (causing a bunch of tests to
crash) it demonstrates use-of-uninitialized memory). Initializing then
removes the crashes.

Thanks Reid for the debugging assistance

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

8 years ago[PGO] Move value profile data definitions out of IndexedInstrProf
Xinliang David Li [Tue, 17 Nov 2015 23:00:40 +0000 (23:00 +0000)]
[PGO] Move value profile data definitions out of IndexedInstrProf

Move the data structure defintions out of the namespace. The defs will
be shared by raw format. [NFC]

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

8 years agoFix null dereference committed in r253277
David Blaikie [Tue, 17 Nov 2015 22:39:26 +0000 (22:39 +0000)]
Fix null dereference committed in r253277

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

8 years agodwarfdump: support indexed string dumping in dwp based on the STR_OFFSETS component...
David Blaikie [Tue, 17 Nov 2015 22:39:23 +0000 (22:39 +0000)]
dwarfdump: support indexed string dumping in dwp based on the STR_OFFSETS component of the index

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

8 years ago[X86][AVX512] Added support for AVX512 UNPCK shuffle decode comments.
Simon Pilgrim [Tue, 17 Nov 2015 22:35:45 +0000 (22:35 +0000)]
[X86][AVX512] Added support for AVX512 UNPCK shuffle decode comments.

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

8 years ago[llvm-profdata] Improve error messaging when merging mismatched profile data
Nathan Slingerland [Tue, 17 Nov 2015 22:08:53 +0000 (22:08 +0000)]
[llvm-profdata] Improve error messaging when merging mismatched profile data

Summary:
This change tries to make the root cause of instrumented profile data merge failures clearer.

Previous:

$ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata
test_1.profraw: foo: Function count mismatch
test_1.profraw: bar: Function count mismatch
test_1.profraw: baz: Function count mismatch
...

Changed:

$ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata
test_1.profraw: foo: Function basic block count change detected (counter mismatch)
Make sure that all profile data to be merged is generated from the same binary.
test_1.profraw: bar: Function basic block count change detected (counter mismatch)
test_1.profraw: baz: Function basic block count change detected (counter mismatch)
...

Reviewers: dnovillo, davidxl, bogner

Subscribers: llvm-commits

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

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

8 years ago[X86][SSE] Share AVX1/AVX2 shuffle tests with AVX512 where possible
Simon Pilgrim [Tue, 17 Nov 2015 21:19:45 +0000 (21:19 +0000)]
[X86][SSE] Share AVX1/AVX2 shuffle tests with AVX512 where possible

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

8 years ago[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction
Reid Kleckner [Tue, 17 Nov 2015 21:10:25 +0000 (21:10 +0000)]
[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction

Summary:
Now that there is a one-to-one mapping from MachineFunction to
WinEHFuncInfo, we don't need to use a DenseMap to select the right
WinEHFuncInfo for the current funclet.

The main challenge here is that X86WinEHStatePass is an IR pass that
doesn't have access to the MachineFunction. I gave it its own
WinEHFuncInfo object that it uses to calculate state numbers, which it
then throws away. As long as nobody creates or removes EH pads between
this pass and SDAG construction, we will get the same state numbers.

The other thing X86WinEHStatePass does is to mark the EH registration
node. Instead of communicating which alloca was the registration through
WinEHFuncInfo, I added the llvm.x86.seh.ehregnode intrinsic.  This
intrinsic generates no code and simply marks the alloca in use.

Reviewers: JCTremoulet

Subscribers: llvm-commits

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

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

8 years agodwarfdump: Reference the appropriate line table segment when dumping dwp files
David Blaikie [Tue, 17 Nov 2015 21:08:05 +0000 (21:08 +0000)]
dwarfdump: Reference the appropriate line table segment when dumping dwp files

Also improves .dwo type unit dumping which didn't handle this either.

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

8 years agoFix -Wunused-function in a non-Win32 build
David Blaikie [Tue, 17 Nov 2015 20:38:54 +0000 (20:38 +0000)]
Fix -Wunused-function in a non-Win32 build

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

8 years ago[EH] Keep filter clauses for types that have been caught.
Andrew Kaylor [Tue, 17 Nov 2015 20:13:04 +0000 (20:13 +0000)]
[EH] Keep filter clauses for types that have been caught.

The instruction combiner previously removed types from filter clauses in Landing Pad instructions if the type had previously been seen in a catch clause.  This is incorrect and prevents unexpected exception handlers from rethrowing the caught type.

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

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

8 years ago[RuntimeDyld] Fix resolving R_PPC64_REL24 relocations
Ulrich Weigand [Tue, 17 Nov 2015 20:08:31 +0000 (20:08 +0000)]
[RuntimeDyld] Fix resolving R_PPC64_REL24 relocations

When resolving R_PPC64_REL24, code used to check for an address delta
that fits in 24 bits, while the instructions that take this relocation
actually can process address deltas that fit into *26* bits (as those
instructions have a 24 bit field, but implicitly append two zero bits
at the end since all instruction addresses are a multiple of 4).

This means that code would signal overflow once a single object's text
section exceeds 8 MB, while we can actually support up to 32 MB.

Partially fixes PR25540.

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