OSDN Git Service

android-x86/external-llvm.git
7 years agoNewGVN: Dead argument cleanup
Daniel Berlin [Tue, 31 Jan 2017 22:32:03 +0000 (22:32 +0000)]
NewGVN: Dead argument cleanup

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

7 years agoNewGVN: Cleanup conditions to match reality
Daniel Berlin [Tue, 31 Jan 2017 22:32:01 +0000 (22:32 +0000)]
NewGVN: Cleanup conditions to match reality

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

7 years agoNewGVN: Add basic support for symbolic comparison evaluation
Daniel Berlin [Tue, 31 Jan 2017 22:31:58 +0000 (22:31 +0000)]
NewGVN: Add basic support for symbolic comparison evaluation

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

7 years agoNewGVN: Formatting cleanup after lookupOperandLeader change
Daniel Berlin [Tue, 31 Jan 2017 22:31:56 +0000 (22:31 +0000)]
NewGVN: Formatting cleanup after lookupOperandLeader change

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

7 years agoNewGVN: Remove the unsued two arguments from lookupOperandLeader.
Daniel Berlin [Tue, 31 Jan 2017 22:31:53 +0000 (22:31 +0000)]
NewGVN: Remove the unsued two arguments from lookupOperandLeader.

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

7 years agoNewGVN: Cleanup header files we are using.
Daniel Berlin [Tue, 31 Jan 2017 22:31:50 +0000 (22:31 +0000)]
NewGVN: Cleanup header files we are using.

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

7 years agoAdd a verbose/human readable mode to llvm-symbolizer to investigate discriminators...
David Blaikie [Tue, 31 Jan 2017 22:19:38 +0000 (22:19 +0000)]
Add a verbose/human readable mode to llvm-symbolizer to investigate discriminators and other line table/backtrace features

Patch by Simon Que!

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

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

7 years agoScopedHashTable lookup should be const
Daniel Berlin [Tue, 31 Jan 2017 22:01:08 +0000 (22:01 +0000)]
ScopedHashTable lookup should be const

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

7 years ago[NewGVN] Preserve TargetLibraryInfo analysis.
Davide Italiano [Tue, 31 Jan 2017 21:53:18 +0000 (21:53 +0000)]
[NewGVN] Preserve TargetLibraryInfo analysis.

We can maybe preserve more but this is a first step.
Ack'ed by Danny on IRC.

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

7 years ago[Utils] Update comment in vimrc
Dan Gohman [Tue, 31 Jan 2017 21:33:21 +0000 (21:33 +0000)]
[Utils] Update comment in vimrc

Fixed wrong paths in comments for *.vim files.

Patch By: Bruno Rosa (brunoalr)

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

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

7 years ago[Support] Add newline when dumping an APInt.
Davide Italiano [Tue, 31 Jan 2017 21:26:18 +0000 (21:26 +0000)]
[Support] Add newline when dumping an APInt.

This annoyed me a few times but was lazy so I haven't fixed it
until today, when the output of my debugger was too confusing.

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

7 years agoMake this file clang-format friendly and clang-format it.
Rafael Espindola [Tue, 31 Jan 2017 21:11:12 +0000 (21:11 +0000)]
Make this file clang-format friendly and clang-format it.

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

7 years agoDo not propagate DebugLoc across basic blocks
Taewook Oh [Tue, 31 Jan 2017 20:57:13 +0000 (20:57 +0000)]
Do not propagate DebugLoc across basic blocks

Summary:
DebugLoc shouldn't be propagated across basic blocks to prevent incorrect stepping and imprecise sample profile result. rL288903 addressed the wrong DebugLoc propagation issue by limiting the copy of DebugLoc when GVN removes a fully redundant load that is dominated by some other load. However, DebugLoc is still incorrectly propagated in the following example:

```
1:  extern int g;
2:
3:  void foo(int x, int y, int z) {
4:    if (x)
5:      g = 0;
6:    else
7:      g = 1;
8:
9:    int i = 0;
10:   for ( ; i < y ; i++)
11:     if (i > z)
12:       g++;
13: }

```
Below is LLVM IR representation of the program before GVN:

```
@g = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define void @foo(i32 %x, i32 %y, i32 %z) local_unnamed_addr #0 !dbg !4 {
entry:
  %not.tobool = icmp eq i32 %x, 0, !dbg !8
  %.sink = zext i1 %not.tobool to i32, !dbg !8
  store i32 %.sink, i32* @g, align 4, !tbaa !9
  %cmp8 = icmp sgt i32 %y, 0, !dbg !13
  br i1 %cmp8, label %for.body.preheader, label %for.end, !dbg !17

for.body.preheader:                               ; preds = %entry
  br label %for.body, !dbg !19

for.body:                                         ; preds = %for.body.preheader, %for.inc
  %i.09 = phi i32 [ %inc4, %for.inc ], [ 0, %for.body.preheader ]
  %cmp1 = icmp sgt i32 %i.09, %z, !dbg !19
  br i1 %cmp1, label %if.then2, label %for.inc, !dbg !21

if.then2:                                         ; preds = %for.body
  %0 = load i32, i32* @g, align 4, !dbg !22, !tbaa !9
  %inc = add nsw i32 %0, 1, !dbg !22
  store i32 %inc, i32* @g, align 4, !dbg !22, !tbaa !9
  br label %for.inc, !dbg !23

for.inc:                                          ; preds = %for.body, %if.then2
  %inc4 = add nuw nsw i32 %i.09, 1, !dbg !24
  %exitcond = icmp ne i32 %inc4, %y, !dbg !13
  br i1 %exitcond, label %for.body, label %for.end.loopexit, !dbg !17

for.end.loopexit:                                 ; preds = %for.inc
  br label %for.end, !dbg !26

for.end:                                          ; preds = %for.end.loopexit, %entry
  ret void, !dbg !26
}

```
where

```
!21 = !DILocation(line: 11, column: 9, scope: !15)
!22 = !DILocation(line: 12, column: 8, scope: !20)
!23 = !DILocation(line: 12, column: 7, scope: !20)
!24 = !DILocation(line: 10, column: 20, scope: !25)
```

And below is after GVN:

```
@g = external local_unnamed_addr global i32, align 4

define void @foo(i32 %x, i32 %y, i32 %z) local_unnamed_addr !dbg !4 {
entry:
  %not.tobool = icmp eq i32 %x, 0, !dbg !8
  %.sink = zext i1 %not.tobool to i32, !dbg !8
  store i32 %.sink, i32* @g, align 4, !tbaa !9
  %cmp8 = icmp sgt i32 %y, 0, !dbg !13
  br i1 %cmp8, label %for.body.preheader, label %for.end, !dbg !17

for.body.preheader:                               ; preds = %entry
  br label %for.body, !dbg !19

for.body:                                         ; preds = %for.inc, %for.body.preheader
  %0 = phi i32 [ %1, %for.inc ], [ %.sink, %for.body.preheader ], !dbg !21
  %i.09 = phi i32 [ %inc4, %for.inc ], [ 0, %for.body.preheader ]
  %cmp1 = icmp sgt i32 %i.09, %z, !dbg !19
  br i1 %cmp1, label %if.then2, label %for.inc, !dbg !22

if.then2:                                         ; preds = %for.body
  %inc = add nsw i32 %0, 1, !dbg !21
  store i32 %inc, i32* @g, align 4, !dbg !21, !tbaa !9
  br label %for.inc, !dbg !23

for.inc:                                          ; preds = %if.then2, %for.body
  %1 = phi i32 [ %inc, %if.then2 ], [ %0, %for.body ]
  %inc4 = add nuw nsw i32 %i.09, 1, !dbg !24
  %exitcond = icmp ne i32 %inc4, %y, !dbg !13
  br i1 %exitcond, label %for.body, label %for.end.loopexit, !dbg !17

for.end.loopexit:                                 ; preds = %for.inc
  br label %for.end, !dbg !26

for.end:                                          ; preds = %for.end.loopexit, %entry
  ret void, !dbg !26
}

```
As you see, GVN removes the load in if.then2 block and creates a phi instruction in for.body for it. The problem is that DebugLoc of remove load instruction is propagated to the newly created phi instruction, which is wrong. rL288903 cannot handle this case because ValuesPerBlock.size() is not 1 in this example when the load is removed.

Reviewers: aprantl, andreadb, wolfgangp

Reviewed By: andreadb

Subscribers: davide, llvm-commits

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

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

7 years agoFix VectorUtils include guard name (NFC)
Matthew Simpson [Tue, 31 Jan 2017 20:29:10 +0000 (20:29 +0000)]
Fix VectorUtils include guard name (NFC)

VectorUtils was moved to Analysis from Transforms/Utils, but some comments and
the include guard name still reflect its old location.

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

7 years agoGlobalISel: the translation of an invoke must branch to the good block.
Tim Northover [Tue, 31 Jan 2017 20:12:18 +0000 (20:12 +0000)]
GlobalISel: the translation of an invoke must branch to the good block.

Otherwise bad things happen if the basic block order isn't trivial after an
invoke.

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

7 years agoInterleaveAccessPass: Avoid constructing invalid shuffle masks
Matthias Braun [Tue, 31 Jan 2017 18:37:53 +0000 (18:37 +0000)]
InterleaveAccessPass: Avoid constructing invalid shuffle masks

Fix a bug where we would construct shufflevector instructions addressing
invalid elements.

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

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

7 years agoGlobalISel: merge invoke and call translation paths.
Tim Northover [Tue, 31 Jan 2017 18:36:11 +0000 (18:36 +0000)]
GlobalISel: merge invoke and call translation paths.

Well, sort of. But the lower-level code that invoke used to be using completely
botched the handling of varargs functions, which hopefully won't be possible if
they're using the same code.

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

7 years agoMC: Introduce the ABS8 symbol modifier.
Peter Collingbourne [Tue, 31 Jan 2017 18:28:44 +0000 (18:28 +0000)]
MC: Introduce the ABS8 symbol modifier.

@ABS8 can be applied to symbols which appear as immediate operands to
instructions that have a 8-bit immediate form for that operand. It causes
the assembler to use the 8-bit form and an 8-bit relocation (e.g. R_386_8
or R_X86_64_8) for the symbol.

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

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

7 years ago[X86][XOP] Add test showing failure to combine build vector to vpermil2ps shuffle
Simon Pilgrim [Tue, 31 Jan 2017 18:10:34 +0000 (18:10 +0000)]
[X86][XOP] Add test showing failure to combine build vector to vpermil2ps shuffle

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

7 years agoFix a bug in llvm-obdump(1) with the -macho flag disassembling an object
Kevin Enderby [Tue, 31 Jan 2017 18:09:10 +0000 (18:09 +0000)]
Fix a bug in llvm-obdump(1) with the -macho flag disassembling an object
without symbols that makes calls through a symbol stub which were not
correctly being annotated with “## symbol stub for: _foo”.

Just adds the same parameters for getting the annotations from
DisAsm->getInstruction() and passing them to IP->printInst() from the
code above when boolean variable symbolTableWorked was true.

rdar://29791952

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

7 years ago[Instcombine] Combine consecutive identical fences
Davide Italiano [Tue, 31 Jan 2017 18:09:05 +0000 (18:09 +0000)]
[Instcombine] Combine consecutive identical fences

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

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

7 years agoDon't combine stores to a swifterror pointer operand to a different type
Arnold Schwaighofer [Tue, 31 Jan 2017 17:53:49 +0000 (17:53 +0000)]
Don't combine stores to a swifterror pointer operand to a different type

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

7 years agoExplicitly promote indirect calls before sample profile annotation.
Dehao Chen [Tue, 31 Jan 2017 17:49:37 +0000 (17:49 +0000)]
Explicitly promote indirect calls before sample profile annotation.

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

Reviewers: xur, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

7 years ago[InstCombine] add test for possible zext-phi transform; NFC
Sanjay Patel [Tue, 31 Jan 2017 17:43:00 +0000 (17:43 +0000)]
[InstCombine] add test for possible zext-phi transform; NFC

The datalayout doesn't include i1, so we don't do a potential shrink and sink transform.

Example based on discussion here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/109631.html

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

7 years agoAMDGPU: Use source mods with fcanonicalize
Matt Arsenault [Tue, 31 Jan 2017 17:28:40 +0000 (17:28 +0000)]
AMDGPU: Use source mods with fcanonicalize

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

7 years agofix formatting; NFC
Sanjay Patel [Tue, 31 Jan 2017 17:25:42 +0000 (17:25 +0000)]
fix formatting; NFC

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

7 years ago[X86] Implement -mfentry
Nirav Dave [Tue, 31 Jan 2017 17:00:27 +0000 (17:00 +0000)]
[X86] Implement -mfentry

Summary: Insert calls to __fentry__ at function entry.

Reviewers: hfinkel, craig.topper

Subscribers: mgorny, llvm-commits

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

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

7 years agoAdd support for demangling C++11 thread_local variables.
David Bozier [Tue, 31 Jan 2017 15:56:36 +0000 (15:56 +0000)]
Add support for demangling C++11 thread_local variables.

In clang, the grammar for mangling for these names are "<special-name> ::= TW <object name>" for wrapper variables or "<special-name> ::= TH <object name>" for initialization variables.

Initial change was made in libccxxabi r293638

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

7 years ago[AMDGPU][mc][tests][NFC] Revert coverage/smoke Gfx7 asm test
Artem Tamazov [Tue, 31 Jan 2017 15:50:11 +0000 (15:50 +0000)]
[AMDGPU][mc][tests][NFC] Revert coverage/smoke Gfx7 asm test

Reason: http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/2916/testReport/junit/LLVM/MC_AMDGPU/gfx7_asm_all_s/

This seems to reveal an AMDGPU/mc issue which needs to be triaged & fixed prior re-committing the test.

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

7 years agoAMDGPU/SI: Fix inst-select-load-smrd.mir on some builds
Tom Stellard [Tue, 31 Jan 2017 15:24:11 +0000 (15:24 +0000)]
AMDGPU/SI: Fix inst-select-load-smrd.mir on some builds

Summary:
For some reason instructions are being inserted in the wrong order with some
builds.  I'm not sure why this is happening.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, tpr, llvm-commits

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

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

7 years ago[X86][SSE] Add support for combining PINSRB into a target shuffle.
Simon Pilgrim [Tue, 31 Jan 2017 14:59:44 +0000 (14:59 +0000)]
[X86][SSE] Add support for combining PINSRB into a target shuffle.

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

7 years ago[DAGCombine] require UnsafeFPMath for re-association of addition
Nicolai Haehnle [Tue, 31 Jan 2017 14:35:37 +0000 (14:35 +0000)]
[DAGCombine] require UnsafeFPMath for re-association of addition

Summary:
The affected transforms all implicitly use associativity of addition,
for which we usually require unsafe math to be enabled.

The "Aggressive" flag is only meant to convey information about the
performance of the fused ops relative to a fmul+fadd sequence.

Fixes Bug 31626.

Reviewers: spatel, hfinkel, mehdi_amini, arsenm, tstellarAMD

Subscribers: jholewinski, nemanjai, wdng, llvm-commits

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

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

7 years ago[ARM] Avoid using ARM instructions in Thumb mode
Sam Parker [Tue, 31 Jan 2017 14:35:01 +0000 (14:35 +0000)]
[ARM] Avoid using ARM instructions in Thumb mode

The Requires class overrides the target requirements of an instruction,
rather than adding to them, so all ARM instructions need to include the
IsARM predicate when they have overwitten requirements.

This caused the swp and swpb instructions to be allowed in thumb mode
assembly, and the ARM encoding of CDP to be selected in codegen (which
is different for conditional instructions).

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

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

7 years ago[X86] Silence unused variable warning in Release builds.
Benjamin Kramer [Tue, 31 Jan 2017 14:13:53 +0000 (14:13 +0000)]
[X86] Silence unused variable warning in Release builds.

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

7 years ago[InstCombine] Make sure that LHS and RHS have the same type in
Silviu Baranga [Tue, 31 Jan 2017 14:04:15 +0000 (14:04 +0000)]
[InstCombine] Make sure that LHS and RHS have the same type in
transformToIndexedCompare

If they don't have the same type, the size of the constant
index would need to be adjusted (and this wouldn't be always
possible).

Alternatively we could try the analysis with the initial
RHS value, which would guarantee that the two sides have
the same type. However it is unlikely that in practice this
would pass our transformation requirements.

Fixes PR31808 (https://llvm.org/bugs/show_bug.cgi?id=31808).

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

7 years ago[X86][SSE] Detect unary PBLEND shuffles.
Simon Pilgrim [Tue, 31 Jan 2017 13:58:01 +0000 (13:58 +0000)]
[X86][SSE] Detect unary PBLEND shuffles.

These can appear during shuffle combining.

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

7 years ago[X86][SSE] Add support for combining PINSRW into a target shuffle.
Simon Pilgrim [Tue, 31 Jan 2017 13:51:10 +0000 (13:51 +0000)]
[X86][SSE] Add support for combining PINSRW into a target shuffle.

Also add the ability to recognise PINSR(Vex, 0, Idx).

Targets shuffle combines won't replace multiple insertions with a bit mask until a depth of 3 or more, so we avoid codesize bloat.

The unnecessary vpblendw in clearupper8xi16a will be fixed in an upcoming patch.

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

7 years ago[PowerPC][Altivec] Add vmr extended mnemonic
Nemanja Ivanovic [Tue, 31 Jan 2017 13:43:11 +0000 (13:43 +0000)]
[PowerPC][Altivec] Add vmr extended mnemonic

Just adds the vmr (Vector Move Register) mnemonic for the VOR instruction in
the PPC back end.

Committing on behalf of brunoalr (Bruno Rosa).

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

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

7 years ago[LoopUnroll] Use addClonedBlockToLoopInfo to clone the top level loop (NFC)
Florian Hahn [Tue, 31 Jan 2017 11:13:44 +0000 (11:13 +0000)]
[LoopUnroll] Use addClonedBlockToLoopInfo to clone the top level loop (NFC)

Summary:
rL293124 added the necessary infrastructure to properly add the cloned
top level loop to LoopInfo, which means we do not have to do it manually
in CloneLoopBlocks.

@mkuper sorry for not pointing this out during my review of D29156, I just
realized that today.

Reviewers: mzolotukhin, chandlerc, mkuper

Reviewed By: mkuper

Subscribers: llvm-commits, mkuper

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

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

7 years ago[mips] Addition of the immediate cases for the instructions [d]div, [d]divu
Simon Dardis [Tue, 31 Jan 2017 10:49:24 +0000 (10:49 +0000)]
[mips] Addition of the immediate cases for the instructions [d]div, [d]divu

Related to http://reviews.llvm.org/D15772

Depends on http://reviews.llvm.org/D16888

Adds support for immediate operand for [D]DIV[U] instructions.

Patch By: Srdjan Obucina

Reviewers: zoran.jovanovic, vkalintiris, dsanders, obucina

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

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

7 years ago[AVX-512] Don't both looking into the AVX512DQ execution domain fixing tables if...
Craig Topper [Tue, 31 Jan 2017 06:49:55 +0000 (06:49 +0000)]
[AVX-512] Don't both looking into the AVX512DQ execution domain fixing tables if AVX512DQ isn't supported since we can't do any conversion anyway.

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

7 years ago[X86] Add AVX and SSE2 version of MOVSDmr to execution domain fixing table. AVX-512...
Craig Topper [Tue, 31 Jan 2017 06:49:53 +0000 (06:49 +0000)]
[X86] Add AVX and SSE2 version of MOVSDmr to execution domain fixing table. AVX-512 already did this for the EVEX version.

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

7 years ago[AVX-512] Fix copy and paste bug in execution domain fixing tables so that we can...
Craig Topper [Tue, 31 Jan 2017 06:49:50 +0000 (06:49 +0000)]
[AVX-512] Fix copy and paste bug in execution domain fixing tables so that we can convert 256-bit movnt instructions.

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

7 years ago[NVPTX] Implement NVPTXTargetLowering::getSqrtEstimate.
Justin Lebar [Tue, 31 Jan 2017 05:58:22 +0000 (05:58 +0000)]
[NVPTX] Implement NVPTXTargetLowering::getSqrtEstimate.

Summary:

This lets us lower to sqrt.approx and rsqrt.approx under more
circumstances.

* Now we emit sqrt.approx and rsqrt.approx for calls to @llvm.sqrt.f32,
  when fast-math is enabled.  Previously, we only would emit it for
  calls to @llvm.nvvm.sqrt.f.  (With this patch we no longer emit
  sqrt.approx for calls to @llvm.nvvm.sqrt.f; we rely on intcombine to
  simplify llvm.nvvm.sqrt.f into llvm.sqrt.f32.)

* Now we emit the ftz version of rsqrt.approx when ftz is enabled.
  Previously, we only emitted rsqrt.approx when ftz was disabled.

Reviewers: hfinkel

Subscribers: llvm-commits, tra, jholewinski

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

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

7 years ago[X86] Update the broadcast fallback patterns to use shuffle instructions from the...
Craig Topper [Tue, 31 Jan 2017 05:18:29 +0000 (05:18 +0000)]
[X86] Update the broadcast fallback patterns to use shuffle instructions from the appropriate execution domain.

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

7 years ago[X86] Add test cases for AVX1 broadcast fallback patterns when load can't be folded.
Craig Topper [Tue, 31 Jan 2017 05:18:27 +0000 (05:18 +0000)]
[X86] Add test cases for AVX1 broadcast fallback patterns when load can't be folded.

Also add test cases that do an insertelement to all elements for the 8 element vector tests.

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

7 years ago[AVX-512] Fix the ExeDomain for VMOVDDUP, VMOVSLDUP, and VMOVSHDUP.
Craig Topper [Tue, 31 Jan 2017 05:18:24 +0000 (05:18 +0000)]
[AVX-512] Fix the ExeDomain for VMOVDDUP, VMOVSLDUP, and VMOVSHDUP.

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

7 years agoAMDGPU: Generalize matching of v_med3_f32
Matt Arsenault [Tue, 31 Jan 2017 03:07:46 +0000 (03:07 +0000)]
AMDGPU: Generalize matching of v_med3_f32

I think this is safe as long as no inputs are known to ever
be nans.

Also add an intrinsic for fmed3 to be able to handle all safe
math cases.

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

7 years agoInferAddressSpaces: Rename constant
Matt Arsenault [Tue, 31 Jan 2017 02:17:41 +0000 (02:17 +0000)]
InferAddressSpaces: Rename constant

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

7 years agoInferAddressSpaces: Handle icmp
Matt Arsenault [Tue, 31 Jan 2017 02:17:32 +0000 (02:17 +0000)]
InferAddressSpaces: Handle icmp

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

7 years ago[X86] Remove patterns for X86VPermilpi with integer types. I don't think we've formed...
Craig Topper [Tue, 31 Jan 2017 02:09:53 +0000 (02:09 +0000)]
[X86] Remove patterns for X86VPermilpi with integer types. I don't think we've formed these since the shuffle lowering rewrite.

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

7 years ago[X86] Remove duplicate patterns for X86VPermilpv that already exist in the instructio...
Craig Topper [Tue, 31 Jan 2017 02:09:51 +0000 (02:09 +0000)]
[X86] Remove duplicate patterns for X86VPermilpv that already exist in the instructions themselves.

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

7 years ago[X86] Remove patterns for selecting PSHUFD with FP types. We don't seem to do this...
Craig Topper [Tue, 31 Jan 2017 02:09:49 +0000 (02:09 +0000)]
[X86] Remove patterns for selecting PSHUFD with FP types. We don't seem to do this anymore and the AVX case definitely should be using VPERMILPS anyway.

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

7 years ago[X86] Remove 'else' after 'return'. NFC
Craig Topper [Tue, 31 Jan 2017 02:09:46 +0000 (02:09 +0000)]
[X86] Remove 'else' after 'return'. NFC

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

7 years ago[X86] Use integer broadcast instructions for integer broadcast patterns.
Craig Topper [Tue, 31 Jan 2017 02:09:43 +0000 (02:09 +0000)]
[X86] Use integer broadcast instructions for integer broadcast patterns.

I'm not sure why we were using an FP instruction before and had to have a comment calling attention to it, but not justifying it.

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

7 years agoInferAddressSpaces: Support memory intrinsics
Matt Arsenault [Tue, 31 Jan 2017 01:56:57 +0000 (01:56 +0000)]
InferAddressSpaces: Support memory intrinsics

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

7 years agoInferAddressSpaces: Support atomics
Matt Arsenault [Tue, 31 Jan 2017 01:40:38 +0000 (01:40 +0000)]
InferAddressSpaces: Support atomics

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

7 years agoInferAddressSpaces: Don't replace volatile users
Matt Arsenault [Tue, 31 Jan 2017 01:30:16 +0000 (01:30 +0000)]
InferAddressSpaces: Don't replace volatile users

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

7 years agoAMDGPU: Implement hook for InferAddressSpaces
Matt Arsenault [Tue, 31 Jan 2017 01:20:54 +0000 (01:20 +0000)]
AMDGPU: Implement hook for InferAddressSpaces

For now just port some of the existing NVPTX tests
and from an old HSAIL optimization pass which
approximately did the same thing.

Don't enable the pass yet until more testing is done.

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

7 years agoNVPTX: Move InferAddressSpaces to generic code
Matt Arsenault [Tue, 31 Jan 2017 01:10:58 +0000 (01:10 +0000)]
NVPTX: Move InferAddressSpaces to generic code

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

7 years ago[ARM] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Tue, 31 Jan 2017 00:56:17 +0000 (00:56 +0000)]
[ARM] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoTableGen: use fully qualified name for StringLiteral
Saleem Abdulrasool [Tue, 31 Jan 2017 00:45:01 +0000 (00:45 +0000)]
TableGen: use fully qualified name for StringLiteral

Use the qualified name for StringLiteral (llvm::StringLiteral) when
generating the sources.  This is needed as the generated files may be
used out-of-tree (e.g. swift) where you may not have a
`using namespace llvm;` resulting in an undefined lookup.

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

7 years ago[SCEV] Simplify/generalize howFarToZero solving.
Eli Friedman [Tue, 31 Jan 2017 00:42:42 +0000 (00:42 +0000)]
[SCEV] Simplify/generalize howFarToZero solving.

Make SolveLinEquationWithOverflow take the start as a SCEV, so we can
solve more cases. With that implemented, get rid of the special case
for powers of two.

The additional functionality probably isn't particularly useful,
but it might help a little for certain cases involving pointer
arithmetic.

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

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

7 years agoRemove LLVM_CONFIG from config headers
Reid Kleckner [Tue, 31 Jan 2017 00:34:23 +0000 (00:34 +0000)]
Remove LLVM_CONFIG from config headers

It appears to be dead, and it needlessly caused me to rebuild all of
LLVM when I changed CMAKE_INSTALL_PREFIX.

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

7 years agoFix llvm-readobj build error after r293569
Vedant Kumar [Mon, 30 Jan 2017 23:58:51 +0000 (23:58 +0000)]
Fix llvm-readobj build error after r293569

Clang complains about an ambiguous call to printNumber() because it
can't work out what size_t should convert to. I picked uint64_t.

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

7 years ago[ExecutionDepsFix] Improve clearance calculation for loops
Keno Fischer [Mon, 30 Jan 2017 23:37:03 +0000 (23:37 +0000)]
[ExecutionDepsFix] Improve clearance calculation for loops

Summary:
In revision rL278321, ExecutionDepsFix learned how to pick a better
register for undef register reads, e.g. for instructions such as
`vcvtsi2sdq`. While this revision improved performance on a good number
of our benchmarks, it unfortunately also caused significant regressions
(up to 3x) on others. This regression turned out to be caused by loops
such as:

PH -> A -> B (xmm<Undef> -> xmm<Def>) -> C -> D -> EXIT
      ^                                  |
      +----------------------------------+

In the previous version of the clearance calculation, we would visit
the blocks in order, remembering for each whether there were any
incoming backedges from blocks that we hadn't processed yet and if
so queuing up the block to be re-processed. However, for loop structures
such as the above, this is clearly insufficient, since the block B
does not have any unknown backedges, so we do not see the false
dependency from the previous interation's Def of xmm registers in B.

To fix this, we need to consider all blocks that are part of the loop
and reprocess them one the correct clearance values are known. As
an optimization, we also want to avoid reprocessing any later blocks
that are not part of the loop.

In summary, the iteration order is as follows:
Before: PH A B C D A'
Corrected (Naive): PH A B C D A' B' C' D'
Corrected (w/ optimization): PH A B C A' B' C' D

To facilitate this optimization we introduce two new counters for each
basic block. The first counts how many of it's predecssors have
completed primary processing. The second counts how many of its
predecessors have completed all processing (we will call such a block
*done*. Now, the criteria to reprocess a block is as follows:
    - All Predecessors have completed primary processing
    - For x the number of predecessors that have completed primary
      processing *at the time of primary processing of this block*,
      the number of predecessors that are done has reached x.

The intuition behind this criterion is as follows:
We need to perform primary processing on all predecessors in order to
find out any direct defs in those predecessors. When predecessors are
done, we also know that we have information about indirect defs (e.g.
in block B though that were inherited through B->C->A->B). However,
we can't wait for all predecessors to be done, since that would
cause cyclic dependencies. However, it is guaranteed that all those
predecessors that are prior to us in reverse postorder will be done
before us. Since we iterate of the basic blocks in reverse postorder,
the number x above, is precisely the count of the number of predecessors
prior to us in reverse postorder.

Reviewers: myatsina
Differential Revision: https://reviews.llvm.org/D28759

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

7 years ago[InstCombine] enable (X <<nsw C1) >>s C2 --> X <<nsw (C1 - C2) for vectors with splat...
Sanjay Patel [Mon, 30 Jan 2017 23:35:52 +0000 (23:35 +0000)]
[InstCombine] enable (X <<nsw C1) >>s C2 --> X <<nsw (C1 - C2) for vectors with splat constants

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

7 years ago[WebAssembly] Add wasm support for llvm-readobj
Derek Schuff [Mon, 30 Jan 2017 23:30:52 +0000 (23:30 +0000)]
[WebAssembly] Add wasm support for llvm-readobj

Create a WasmDumper subclass of ObjDumper to support Webassembly binary
files.

Patch by Sam Clegg

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

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

7 years agoNVPTX: Trivial cleanups of NVPTXInferAddressSpaces
Matt Arsenault [Mon, 30 Jan 2017 23:27:11 +0000 (23:27 +0000)]
NVPTX: Trivial cleanups of NVPTXInferAddressSpaces

- Move DEBUG_TYPE below includes
- Change unknown address space constant to be consistent with other
  passes
- Grammar fixes in debug output

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

7 years ago[InstCombine] add vector test for (X <<nsw C1) >>s C2 --> X <<nsw (C1 - C2); NFC
Sanjay Patel [Mon, 30 Jan 2017 23:26:17 +0000 (23:26 +0000)]
[InstCombine] add vector test for (X <<nsw C1) >>s C2 --> X <<nsw (C1 - C2); NFC

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

7 years ago[Mips] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Mon, 30 Jan 2017 23:21:32 +0000 (23:21 +0000)]
[Mips] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[ICP] Fix bool conversion warning and actually write out the reason instead of droppi...
Benjamin Kramer [Mon, 30 Jan 2017 23:11:29 +0000 (23:11 +0000)]
[ICP] Fix bool conversion warning and actually write out the reason instead of dropping it.

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

7 years agoNVPTX: Refactor NVPTXInferAddressSpaces to check TTI
Matt Arsenault [Mon, 30 Jan 2017 23:02:12 +0000 (23:02 +0000)]
NVPTX: Refactor NVPTXInferAddressSpaces to check TTI

Add a new TTI hook for getting the generic address space value.

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

7 years ago[InstCombine] enable more lshr(shl X, C1), C2 folds for vectors with splat constants
Sanjay Patel [Mon, 30 Jan 2017 23:01:05 +0000 (23:01 +0000)]
[InstCombine] enable more lshr(shl X, C1), C2 folds for vectors with splat constants

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

7 years ago[X86][SSE] Fix unsigned <= 0 warning in assert. NFCI.
Simon Pilgrim [Mon, 30 Jan 2017 22:58:44 +0000 (22:58 +0000)]
[X86][SSE] Fix unsigned <= 0 warning in assert. NFCI.

Thanks to @mkuper

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

7 years ago[X86][SSE] Generalize the number of decoded shuffle inputs. NFCI.
Simon Pilgrim [Mon, 30 Jan 2017 22:48:49 +0000 (22:48 +0000)]
[X86][SSE] Generalize the number of decoded shuffle inputs. NFCI.

combineX86ShufflesRecursively can still only handle a maximum of 2 shuffle inputs but everything before it now supports any number of shuffle inputs.

This will be necessary for combining OR(SHUFFLE, SHUFFLE) patterns.

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

7 years agoExpose isLegalToPromot as a global helper function so that SamplePGO pass can call...
Dehao Chen [Mon, 30 Jan 2017 22:46:37 +0000 (22:46 +0000)]
Expose isLegalToPromot as a global helper function so that SamplePGO pass can call it for legality check.

Summary: SamplePGO needs to check if it is legal to promote a target before it actually promotes it.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

7 years agoRevert r292979 which causes compile time failure.
Dehao Chen [Mon, 30 Jan 2017 22:26:05 +0000 (22:26 +0000)]
Revert r292979 which causes compile time failure.

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

7 years ago[InstCombine] add tests for more shift-shift patterns; NFC
Sanjay Patel [Mon, 30 Jan 2017 22:24:36 +0000 (22:24 +0000)]
[InstCombine] add tests for more shift-shift patterns; NFC

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

7 years agoFix line endings.
Eli Friedman [Mon, 30 Jan 2017 22:04:23 +0000 (22:04 +0000)]
Fix line endings.

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

7 years agoAMDGPU: Fix release build broken by r293551
Tom Stellard [Mon, 30 Jan 2017 22:02:58 +0000 (22:02 +0000)]
AMDGPU: Fix release build broken by r293551

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

7 years agoReapply [AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.
Artem Tamazov [Mon, 30 Jan 2017 21:59:21 +0000 (21:59 +0000)]
Reapply [AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.

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

7 years agoRe-commit AMDGPU/GlobalISel: Add support for simple shaders
Tom Stellard [Mon, 30 Jan 2017 21:56:46 +0000 (21:56 +0000)]
Re-commit AMDGPU/GlobalISel: Add support for simple shaders

Fix build when global-isel is disabled and fix a warning.

Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.

Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm

Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris

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

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

7 years agoGlobalISel: correctly translate invoke when callee is a register.
Tim Northover [Mon, 30 Jan 2017 21:45:21 +0000 (21:45 +0000)]
GlobalISel: correctly translate invoke when callee is a register.

This should fix the GlobalISel verifier.

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

7 years ago[AMDGPU] Internalize non-kernel symbols
Stanislav Mekhanoshin [Mon, 30 Jan 2017 21:05:18 +0000 (21:05 +0000)]
[AMDGPU] Internalize non-kernel symbols

Since we have no call support and late linking we can produce code
only for used symbols. This saves compilation time, size of the final
executable, and size of any intermediate dumps.

Run Internalize pass early in the opt pipeline followed by global
DCE pass. To enable it RT can pass -amdgpu-internalize-symbols option.

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

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

7 years agoChange the llvm-obdump(1) behavior with the -macho flag and inappropriate file types.
Kevin Enderby [Mon, 30 Jan 2017 20:53:17 +0000 (20:53 +0000)]
Change the llvm-obdump(1) behavior with the -macho flag and inappropriate file types.

To better match the old darwin otool(1) behavior, when llvm-obdump(1) is used
with the -macho option and the input file is not an object file simply print
the file name and this message:

foo: is not an object file

and continue on to process other input files.  Also in this case don’t exit
non-zero.  This should help in some OSS projects' with autoconf scripts
that are expecting the old darwin otool(1) behavior.

rdar://26828015

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

7 years agoGlobalISel: account for differing exception selector sizes.
Tim Northover [Mon, 30 Jan 2017 20:52:42 +0000 (20:52 +0000)]
GlobalISel: account for differing exception selector sizes.

For some reason the exception selector register must be a pointer (that's
assumed by SDag); on the other hand, it gets moved into an IR-level type which
might be entirely different (i32 on AArch64). IRTranslator needs to be aware of
this.

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

7 years agoGlobalISel: tidy up def/use test. NFC.
Tim Northover [Mon, 30 Jan 2017 20:52:37 +0000 (20:52 +0000)]
GlobalISel: tidy up def/use test. NFC.

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

7 years agoLSR: Don't drop address space when type doesn't match
Matt Arsenault [Mon, 30 Jan 2017 19:50:17 +0000 (19:50 +0000)]
LSR: Don't drop address space when type doesn't match

For targets with different addressing modes in each address space,
if this is dropped querying isLegalAddressingMode later with this
will give a nonsense result, breaking the isLegalUse assertions.

This is a candidate for the 4.0 release branch.

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

7 years agoGlobalISel: translate memset & memmove.
Tim Northover [Mon, 30 Jan 2017 19:33:07 +0000 (19:33 +0000)]
GlobalISel: translate memset & memmove.

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

7 years agoAMDGPU: Undo sub x, c -> add x, -c canonicalization
Matt Arsenault [Mon, 30 Jan 2017 19:30:24 +0000 (19:30 +0000)]
AMDGPU: Undo sub x, c -> add x, -c canonicalization

This is worse if the original constant is an inline immediate.

This should also be done for 64-bit adds, but requires fixing
operand folding bugs first.

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

7 years ago[RDF] Add support for regmasks
Krzysztof Parzyszek [Mon, 30 Jan 2017 19:16:30 +0000 (19:16 +0000)]
[RDF] Add support for regmasks

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

7 years agoGlobalISel: permit unused vregs without a register-class after ISel.
Tim Northover [Mon, 30 Jan 2017 19:12:50 +0000 (19:12 +0000)]
GlobalISel: permit unused vregs without a register-class after ISel.

This can happen if earlier combining has removed all uses of some VReg, which
is fine and shouldn't flag an error.

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

7 years agoFix the GCC build.
Benjamin Kramer [Mon, 30 Jan 2017 19:05:09 +0000 (19:05 +0000)]
Fix the GCC build.

This is fairly ugly, but apparently GCC still doesn't understand C++11.

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

7 years agoTurn a TableGen FastISelEmitter warning into an error.
Michael Kuperstein [Mon, 30 Jan 2017 19:03:26 +0000 (19:03 +0000)]
Turn a TableGen FastISelEmitter warning into an error.

Tablegen emitted a warning when the fast isel emitter created dead
code by emitting a pattern that has no predicate before a pattern
that has one.

This should be an error but was originally only a warning because the X86
backend had a buggy definition that unintentionally caused this to be hit
(PR21575). That has been fixed a while ago (r222094), so it's safe to
upgrade the warning to an error.

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

7 years ago[X86][XOP] Fix test name
Simon Pilgrim [Mon, 30 Jan 2017 18:59:25 +0000 (18:59 +0000)]
[X86][XOP] Fix test name

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

7 years agoUse SelectionDAG::getBuildVector helper function where possible. NFCI.
Simon Pilgrim [Mon, 30 Jan 2017 18:53:45 +0000 (18:53 +0000)]
Use SelectionDAG::getBuildVector helper function where possible. NFCI.

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

7 years ago[IR] Remove global constructor from Function.cpp
Benjamin Kramer [Mon, 30 Jan 2017 18:49:24 +0000 (18:49 +0000)]
[IR] Remove global constructor from Function.cpp

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

7 years ago[MC] Remove global constructors from MCSectionMachO.cpp.
Benjamin Kramer [Mon, 30 Jan 2017 18:46:26 +0000 (18:46 +0000)]
[MC] Remove global constructors from MCSectionMachO.cpp.

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

7 years agoAMDGPU: Run AMDGPUCodeGenPrepare after inlining
Matt Arsenault [Mon, 30 Jan 2017 18:40:29 +0000 (18:40 +0000)]
AMDGPU: Run AMDGPUCodeGenPrepare after inlining

With leaf functions, this makes nonsensical decisions
based on the uniformity of the arguments.

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