OSDN Git Service

android-x86/external-llvm.git
5 years ago[AMDGPU] Divergence driven ISel. Assign register class for cross block values accordi...
Alexander Timofeev [Fri, 24 May 2019 15:32:18 +0000 (15:32 +0000)]
[AMDGPU] Divergence driven ISel. Assign register class for cross block values according to the divergence.

Details: To make instruction selection really divergence driven it is necessary to assign
         the correct register classes to the cross block values beforehand. For the divergent targets
         same value type requires different register classes dependent on the value divergence.

Reviewers: rampitec, nhaehnle

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

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

5 years ago[llvm-objcopy] - Strip undefined symbols if they are no longer referenced following...
George Rimar [Fri, 24 May 2019 15:04:50 +0000 (15:04 +0000)]
[llvm-objcopy] - Strip undefined symbols if they are no longer referenced following --only-section

This is https://bugs.llvm.org/show_bug.cgi?id=40004.

In this patch I teach llvm-objcopy to remove undefined symbols if
them are not used anymore after applying -j/--only-section option.

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

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

5 years agogn build: Merge r361607
Nico Weber [Fri, 24 May 2019 14:24:25 +0000 (14:24 +0000)]
gn build: Merge r361607

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

5 years ago[MCA] Zero-initialize field CRD in InstructionBase. Also run clang-format on a couple...
Andrea Di Biagio [Fri, 24 May 2019 13:56:01 +0000 (13:56 +0000)]
[MCA] Zero-initialize field CRD in InstructionBase. Also run clang-format on a couple of files. NFC

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

5 years ago[llvm-readobj] Implement GNU-style output for dynamic table
Simon Atanasyan [Fri, 24 May 2019 12:22:53 +0000 (12:22 +0000)]
[llvm-readobj] Implement GNU-style output for dynamic table

GNU readelf tool prints slightly different dynamic table "header" and
surrounds dynamic tag names by brackets. This patch implements the same
formatting for GNU-style output of the `llvm-readobj`.

LLVM
```
DynamicSection [ (13 entries)
  Tag        Type                 Name/Value
  0x00000006 SYMTAB               0x168
  ...
]
```

GNU
```
Dynamic section at offset 0x1d0 contains 13 entries:
  Tag        Type                 Name/Value
  0x00000006 (SYMTAB)             0x168
  ...
```

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

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

5 years ago[PowerPC] Remove CRBits Copy Of Unset/set CBit
Stefan Pintilie [Fri, 24 May 2019 12:05:37 +0000 (12:05 +0000)]
[PowerPC] Remove CRBits Copy Of Unset/set CBit

For the situation, where we generate the following code:

       crxor 8, 8, 8
       < Some instructions>
.LBB0_1:
       < Some instructions>
       cror 1, 8, 8

cror (COPY of CRbit) depends on the result of the crxor instruction.
CR8 is known to be zero as crxor is equivalent to CRUNSET. We can simply use
crxor 1, 1, 1 instead to zero out CR1, which does not have any dependency on
any previous instruction.

This patch will optimize it to:

        < Some instructions>
.LBB0_1:
        < Some instructions>
        cror 1, 1, 1

Patch By: Victor Huang (NeHuang)

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

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

5 years agoRevert r361630 "[llvm-readelf] - Allow dumping of the .dynamic section even if there...
George Rimar [Fri, 24 May 2019 11:24:42 +0000 (11:24 +0000)]
Revert r361630 "[llvm-readelf] - Allow dumping of the .dynamic section even if there is no PT_DYNAMIC header."

It broke BB:
http://lab.llvm.org:8011/builders/ppc64le-lld-multistage-test/builds/3748

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

5 years ago[llvm-readelf] - Allow dumping of the .dynamic section even if there is no PT_DYNAMIC...
George Rimar [Fri, 24 May 2019 11:12:50 +0000 (11:12 +0000)]
[llvm-readelf] - Allow dumping of the .dynamic section even if there is no PT_DYNAMIC header.

It is now possible after D61937 was landed and was discussed
in it's review comments. It is not consistent with GNU, which
does not output .dynamic section content in this case for
no visible reason.

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

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

5 years ago[AArch64][SVE2] Asm: support SVE2 String Processing Group
Cullen Rhodes [Fri, 24 May 2019 10:32:01 +0000 (10:32 +0000)]
[AArch64][SVE2] Asm: support SVE2 String Processing Group

Summary:
Patch adds support for the SVE2 character match instructions MATCH and NMATCH.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[llvm-readobj][mips] Align GOT columns headers properly in 64-bit case
Simon Atanasyan [Fri, 24 May 2019 10:26:48 +0000 (10:26 +0000)]
[llvm-readobj][mips] Align GOT columns headers properly in 64-bit case

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

5 years ago[AArch64][SVE2] Asm: support SVE2 Narrowing Group
Cullen Rhodes [Fri, 24 May 2019 10:22:30 +0000 (10:22 +0000)]
[AArch64][SVE2] Asm: support SVE2 Narrowing Group

Summary:
Patch adds support for the following instructions:

SVE2 bitwise shift right narrow:
    * SQSHRUNB, SQSHRUNT, SQRSHRUNB, SQRSHRUNT, SHRNB, SHRNT, RSHRNB, RSHRNT,
      SQSHRNB, SQSHRNT, SQRSHRNB, SQRSHRNT, UQSHRNB, UQSHRNT, UQRSHRNB,
      UQRSHRNT

SVE2 integer add/subtract narrow high part:
    * ADDHNB, ADDHNT, RADDHNB, RADDHNT, SUBHNB, SUBHNT, RSUBHNB, RSUBHNT

SVE2 saturating extract narrow:
    * SQXTNB, SQXTNT, UQXTNB, UQXTNT, SQXTUNB, SQXTUNT

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[AArch64][SVE2] Asm: support SVE2 Accumulate Group
Cullen Rhodes [Fri, 24 May 2019 10:10:34 +0000 (10:10 +0000)]
[AArch64][SVE2] Asm: support SVE2 Accumulate Group

Summary:
Patch adds support for the following instructions:

SVE2 bitwise shift and insert:
    * SRI, SLI

SVE2 bitwise shift right and accumulate:
    * SSRA, USRA, SRSRA, URSRA

SVE2 complex integer add:
    * CADD, SQCADD

SVE2 integer absolute difference and accumulate:
    * SABA, UABA

SVE2 integer absolute difference and accumulate long:
    * SABALB, SABALT, UABALB, UABALT

SVE2 integer add/subtract long with carry:
    * ADCLB, ADCLT, SBCLB, SBCLT

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[llvm-objdump][test] Fix for spurious matches against file paths
James Henderson [Fri, 24 May 2019 10:07:24 +0000 (10:07 +0000)]
[llvm-objdump][test] Fix for spurious matches against file paths

r361479 added tests that did --implicit-check-not=main, but a user found
that they failed on his machine, due to it having 'main' in a file path
printed earlier in the output. This test fixes this issue by making the
check pattern more explicit.

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

5 years ago[SelectionDAG] computeKnownBits - support constant pool values from target
Simon Pilgrim [Fri, 24 May 2019 10:03:11 +0000 (10:03 +0000)]
[SelectionDAG] computeKnownBits - support constant pool values from target

This patch adds the overridable TargetLowering::getTargetConstantFromLoad function which allows targets to return any constant value loaded by a LoadSDNode node - only X86 makes use of this so far but everything should be in place for other targets.

computeKnownBits then uses this function to improve codegen, notably vector code after legalization.

A future commit will do the same for ComputeNumSignBits but computeKnownBits sees the bigger benefit.

This required a couple of fixes:
* SimplifyDemandedBits must early-out for getTargetConstantFromLoad cases to prevent infinite loops of constant regeneration (similar to what we already do for BUILD_VECTOR).
* Fix a DAGCombiner::visitTRUNCATE issue as we had trunc(shl(v8i32),v8i16) <-> shl(trunc(v8i16),v8i32) infinite loops after legalization on AVX512 targets.

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

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

5 years ago[AArch64][SVE2] Asm: add PMULLB/PMULLT instructions
Cullen Rhodes [Fri, 24 May 2019 09:56:23 +0000 (09:56 +0000)]
[AArch64][SVE2] Asm: add PMULLB/PMULLT instructions

Summary:
This patch adds support for the polynomial multiplication instructions
PMULLB/PMULLT. The 64-bit source and 128-bit destination element
variants are enabled with crypto extensions (+sve2-aes), similar to the
NEON PMULL2 instruction. All other variants are enabled with +sve2.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[AArch64][SVE2] Asm: add integer add/sub long/wide instructions
Cullen Rhodes [Fri, 24 May 2019 09:28:27 +0000 (09:28 +0000)]
[AArch64][SVE2] Asm: add integer add/sub long/wide instructions

Summary:
Patch adds support for the following instructions:

SVE2 integer add/subtract long:
    * SADDLB, SADDLT, UADDLB, UADDLT, SSUBLB, SSUBLT, USUBLB, USUBLT,
      SABDLB, SABDLT, UABDLB, UABDLT

SVE2 integer add/subtract wide:
    * SADDWB, SADDWT, UADDWB, UADDWT, SSUBWB, SSUBWT, USUBWB, USUBWT

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years agoUse the DataLayout::typeSizeEqualsStoreSize helper. NFC
Bjorn Pettersson [Fri, 24 May 2019 09:20:20 +0000 (09:20 +0000)]
Use the DataLayout::typeSizeEqualsStoreSize helper. NFC

Just a minor refactoring to use the new helper method
DataLayout::typeSizeEqualsStoreSize(). This is done when
checking if getTypeSizeInBits is equal/non-equal to
getTypeStoreSizeInBits.

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

5 years ago[AArch64][SVE2] Asm: add various bitwise shift instructions
Cullen Rhodes [Fri, 24 May 2019 09:17:23 +0000 (09:17 +0000)]
[AArch64][SVE2] Asm: add various bitwise shift instructions

Summary:
This patch adds support for the SVE2 saturating/rounding bitwise shift
left (predicated) group of instructions:

    * SRSHL, URSHL, SRSHLR, URSHLR, SQSHL, UQSHL, SQRSHL, UQRSHL,
      SQSHLR, UQSHLR, SQRSHLR, UQRSHLR

Immediate forms of the SQSHL and UQSHL instructions are also added to
the existing SVE bitwise shift by immediate (predicated) group, as well
as three new instructions SRSHR/URSHR/SQSHLU. The new instructions in
this group are encoded similarly and are implemented using the same
TableGen class with a minimal change (1 bit in encoding).

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[AArch64][SVE2] Asm: add saturating add/sub instructions
Cullen Rhodes [Fri, 24 May 2019 09:06:37 +0000 (09:06 +0000)]
[AArch64][SVE2] Asm: add saturating add/sub instructions

Summary:
Patch adds support for the following instructions:

    * SQADD, UQADD, SUQADD, USQADD
    * SQSUB, UQSUB, SQSUBR, UQSUBR

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: chill

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

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

5 years agoStructurizeCFG: Relax uniformity checks.
Neil Henning [Fri, 24 May 2019 08:59:17 +0000 (08:59 +0000)]
StructurizeCFG: Relax uniformity checks.

This change relaxes the checks for hasOnlyUniformBranches such that our
region is uniform if:

1. All conditional branches that are direct children are uniform.
2. And either:
  a. All sub-regions are uniform.
  b. There is one or less conditional branches among the direct
     children.

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

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

5 years ago[AArch64][SVE2] Asm: fix overlapping bit
Cullen Rhodes [Fri, 24 May 2019 08:45:37 +0000 (08:45 +0000)]
[AArch64][SVE2] Asm: fix overlapping bit

Summary:
Bit 20 in sve2_int_arith_pred TableGen class was overlapping. The
encodings are not affected as bit 20 is defined by the opc bits
and this was overwriting the earlier error of setting bit 20 to 0.

Raised by Momchil: https://reviews.llvm.org/D62130

Reviewed By: chill

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

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

5 years agoGlobalISel: support swifterror attribute on AArch64.
Tim Northover [Fri, 24 May 2019 08:40:13 +0000 (08:40 +0000)]
GlobalISel: support swifterror attribute on AArch64.

swifterror marks an argument as a register pretending to be a pointer, so we
need a guaranteed mem2reg-like analysis of its uses. Fortunately most of the
infrastructure can be reused from the DAG world.

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

5 years agoCodeGen: factor out swifterror value tracking.
Tim Northover [Fri, 24 May 2019 08:39:43 +0000 (08:39 +0000)]
CodeGen: factor out swifterror value tracking.

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

5 years ago[mips] Always check that `shift and add` optimization is efficient.
Simon Atanasyan [Fri, 24 May 2019 08:39:40 +0000 (08:39 +0000)]
[mips] Always check that `shift and add` optimization is efficient.

The D45316 introduced the `shouldTransformMulToShiftsAddsSubs` function
to check that breaking down constant multiplications into a series
of shifts, adds, and subs is efficient. Unfortunately, this function
does not check maximum number of steps on all paths of the algorithm.
This patch fixes this bug.

Fix for PR41929.

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

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

5 years ago[DSE] Bugfix to avoid PartialStoreMerging involving non byte-sized stores
Bjorn Pettersson [Fri, 24 May 2019 08:32:02 +0000 (08:32 +0000)]
[DSE] Bugfix to avoid PartialStoreMerging involving non byte-sized stores

Summary:
The DeadStoreElimination pass now skips doing
PartialStoreMerging when stores overlap according to
OW_PartialEarlierWithFullLater and at least one of
the stores is having a store size that is different
from the size of the type being stored.

This solves problems seen in
  https://bugs.llvm.org/show_bug.cgi?id=41949
for which we in the past could end up with
mis-compiles or assertions.

The content and location of the padding bits is not
formally described (or undefined) in the LangRef
at the moment. So the solution is chosen based on
that we cannot assume anything about the padding bits
when having a store that clobbers more memory than
indicated by the type of the value that is stored
(such as storing an i6 using an 8-bit store instruction).

Fixes: https://bugs.llvm.org/show_bug.cgi?id=41949

Reviewers: spatel, efriedma, fhahn

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[ARM] ARMExpandPseudoInsts: add debug messages
Sjoerd Meijer [Fri, 24 May 2019 08:25:02 +0000 (08:25 +0000)]
[ARM] ARMExpandPseudoInsts: add debug messages

This pass wasn't printing any messages at all, which I find really inconvenient
while debugging/tracing things. It now dumps the before and after of expanded
instructions. It doesn't do this yet for all instructions, but this is a good
start I guess.

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

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

5 years ago[Power9] Add a specific heuristic to schedule the addi before the load
QingShan Zhang [Fri, 24 May 2019 05:30:09 +0000 (05:30 +0000)]
[Power9] Add a specific heuristic to schedule the addi before the load
 When we are scheduling the load and addi, if all other heuristic didn't take effect,
 we will try to schedule the addi before the load, to hide the latency, and avoid the
 true dependency added by RA. And this only take effects for Power9.

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

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

5 years ago[X86] Add test case that was supposed to go with r360102.
Craig Topper [Fri, 24 May 2019 04:46:56 +0000 (04:46 +0000)]
[X86] Add test case that was supposed to go with r360102.

Found in my working area. Guess I forgot 'git add' before committing.

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

5 years ago[NFC] SwitchInst: Introduce wrapper for prof branch_weights handling
Yevgeny Rouban [Fri, 24 May 2019 04:34:23 +0000 (04:34 +0000)]
[NFC] SwitchInst: Introduce wrapper for prof branch_weights handling

This patch introduces a wrapper class that re-implements
several mutator methods of SwitchInst to handle changes
of prof branch_weights metadata along with remove/add
switch case methods.
Subsequent patches will use this wrapper to implement
prof branch_weights metadata handling for SwitchInst.

Reviewers: davidx, eraman, reames, chandlerc
Reviewed By: davidx
Differential Revision: https://reviews.llvm.org/D62122

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

5 years ago[llvm-nm] Fix Bug 41353 - unique symbols printed as D instead of u
Jordan Rupprecht [Fri, 24 May 2019 04:02:05 +0000 (04:02 +0000)]
[llvm-nm] Fix Bug 41353 - unique symbols printed as D instead of u

Summary:
https://bugs.llvm.org/show_bug.cgi?id=41353

I'm new to LLVM and C++ so please do not hesitate to iterate with me on this fix.

Patch by Mike Pozulp!

Reviewers: rupprecht, zbrid, grimar, jhenderson

Reviewed By: rupprecht, jhenderson

Subscribers: jhenderson, chrisjackson, MaskRay, llvm-commits

Tags: #llvm

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

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

5 years agoFix BUILD_SHARED_LIBS builds after r361567
Daniel Sanders [Fri, 24 May 2019 02:15:27 +0000 (02:15 +0000)]
Fix BUILD_SHARED_LIBS builds after r361567

Also fixed a comment I noticed while debugging this build

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

5 years agoClarify how musttail can be used to create forwarding thunks
Reid Kleckner [Fri, 24 May 2019 01:45:47 +0000 (01:45 +0000)]
Clarify how musttail can be used to create forwarding thunks

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

5 years agodwarfdump: Deterministically... determine whether parsing a DWARF32 or DWARF64 str_of...
David Blaikie [Fri, 24 May 2019 01:41:58 +0000 (01:41 +0000)]
dwarfdump: Deterministically... determine whether parsing a DWARF32 or DWARF64 str_offsets header

Rather than trying one and then the other - use the kind of the CU to
select which kind of header to parse.

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

5 years ago[AArch64] Preserve X8 for thunks ending in variadic musttail calls
Reid Kleckner [Fri, 24 May 2019 01:27:20 +0000 (01:27 +0000)]
[AArch64] Preserve X8 for thunks ending in variadic musttail calls

Summary:
On Windows, X8 may be used to pass in the address of an aggregate that
is returned indirectly. Therefore, it should be forwarded to variadic
musttail calls and preserved in thunks.

Fixes PR41997

Reviewers: mgrang, efriedma

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64] Add nvcast patterns for v2f32 -> v1f64
Serge Pavlov [Fri, 24 May 2019 01:20:34 +0000 (01:20 +0000)]
[AArch64] Add nvcast patterns for v2f32 -> v1f64

Summary: Constant stores of f32 values can create such NvCast nodes.

Reviewers: t.p.northover

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agodwarfdump: Add a bit more DWARF64 support
David Blaikie [Fri, 24 May 2019 01:05:52 +0000 (01:05 +0000)]
dwarfdump: Add a bit more DWARF64 support

This test case was incorrect because it mixed DWARF32 and DWARF64 for a
single unit (DWARF32 unit referencing a DWARF64 str_offsets section). So
fix enough of the unit parsing for DWARF64 and make the test valid.

(not sure if anyone needs DWARF64 support though - support in
libDebugInfoDWARF has been added piecemeal and LLVM doesn't produce it
at all)

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

5 years agoRevert r361460
Eli Friedman [Fri, 24 May 2019 01:03:51 +0000 (01:03 +0000)]
Revert r361460

It regresses https://bugs.llvm.org/show_bug.cgi?id=38309 (represented
by the testcase test/Transforms/GlobalOpt/globalsra-multigep.ll).

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

5 years agollvm-objcopy: Change sectionWithinSegment() to use virtual addresses instead of file...
Peter Collingbourne [Fri, 24 May 2019 00:21:46 +0000 (00:21 +0000)]
llvm-objcopy: Change sectionWithinSegment() to use virtual addresses instead of file offsets for SHT_NOBITS sections.

Without this, sectionWithinSegment() will return the wrong answer for bss
sections. This doesn't seem to matter now (for non-broken ELF files), but
it will matter with a change that I'm working on.

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

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

5 years ago[WebAssembly] Expand more SIMD float ops
Thomas Lively [Fri, 24 May 2019 00:15:04 +0000 (00:15 +0000)]
[WebAssembly] Expand more SIMD float ops

Summary: These were previously causing ISel failures.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

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

5 years ago[InstSimplify] fold insertelement-of-extractelement
Sanjay Patel [Fri, 24 May 2019 00:13:58 +0000 (00:13 +0000)]
[InstSimplify] fold insertelement-of-extractelement

This was partly handled in InstCombine (only the constant
index case), so delete that and zap it more generally in
InstSimplify.

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

5 years ago[InstSimplify] add tests for insert-of-extract; NFC
Sanjay Patel [Fri, 24 May 2019 00:11:23 +0000 (00:11 +0000)]
[InstSimplify] add tests for insert-of-extract; NFC

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

5 years ago[InstCombine] remove redundant fold for extractelement; NFC
Sanjay Patel [Thu, 23 May 2019 23:33:38 +0000 (23:33 +0000)]
[InstCombine] remove redundant fold for extractelement; NFC

The out-of-bounds index pattern is handled by InstSimplify,
so the extractelement should be eliminated next time it is
visited.

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

5 years ago[InstCombine] remove redundant fold for insertelement; NFC
Sanjay Patel [Thu, 23 May 2019 23:33:34 +0000 (23:33 +0000)]
[InstCombine] remove redundant fold for insertelement; NFC

The out-of-bounds index pattern is handled by InstSimplify.

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

5 years agoBreak false dependencies on target libraries
Daniel Sanders [Thu, 23 May 2019 23:02:56 +0000 (23:02 +0000)]
Break false dependencies on target libraries

Summary:
For the most part this consists of replacing ${LLVM_TARGETS_TO_BUILD} with
some combination of AllTargets* so that they depend on specific components
of a target backend rather than all of it. The overall effect of this is
that, for example, tools like opt no longer falsely depend on the
disassembler, while tools like llvm-ar no longer depend on the code
generator.

There's a couple quirks to point out here:
* AllTargetsCodeGens is a bit more prevalent than expected. Tools like dsymutil
  seem to need it which I was surprised by.
* llvm-xray linked to all the backends but doesn't seem to need any of them.
  It builds and passes the tests so that seems to be correct.
* I left gold out as it's not built when binutils is not available so I'm
  unable to test it

Reviewers: bogner, JDevlieghere

Reviewed By: bogner

Subscribers: mehdi_amini, mgorny, steven_wu, dexonsmith, rupprecht, llvm-commits

Tags: #llvm

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

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

5 years agofix accidental implicit matches in elf-disassemble-symbol-labels-rel.test
Bob Haarman [Thu, 23 May 2019 22:28:18 +0000 (22:28 +0000)]
fix accidental implicit matches in elf-disassemble-symbol-labels-rel.test

llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-labels-rel.test
uses --implicit-check-not to verify that certain patterns do not occur
in llvm-objdump's output, except in places where they are explicitly
checked. Unfortunately, the patterns are generic enough that they may
be part of the file name which is also output by llvm-objdump. This
change matches the line with the filename explicitly so that the
implicit patterns are not applied to it.

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

5 years ago[NewPassManager] Add tuning option: ForgetAllSCEVInLoopUnroll [NFC].
Alina Sbirlea [Thu, 23 May 2019 21:52:59 +0000 (21:52 +0000)]
[NewPassManager] Add tuning option: ForgetAllSCEVInLoopUnroll [NFC].

Summary: Mirror tuning option from old pass manager in new pass manager.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, zzheng, dmgreen, llvm-commits

Tags: #llvm

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

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

5 years ago[InstSimplify] insertelement V, undef, ? --> V
Sanjay Patel [Thu, 23 May 2019 21:49:47 +0000 (21:49 +0000)]
[InstSimplify] insertelement V, undef, ? --> V

This was part of InstCombine, but it's better placed in
InstSimplify. InstCombine also had an unreachable but weaker
fold for insertelement with undef index, so that is deleted.

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

5 years ago[TTI] Fix some typos in comments. NFC
Craig Topper [Thu, 23 May 2019 21:04:01 +0000 (21:04 +0000)]
[TTI] Fix some typos in comments. NFC

'implementaion' -> 'implementation'
'non-unform' -> 'non-uniform'
'mimimum' -> 'minimum'

Patch by Pavel Samolysov

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

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

5 years agoRevert [LOOPINFO] Extend Loop object to add utilities to get the loop bounds...
Kit Barton [Thu, 23 May 2019 20:53:05 +0000 (20:53 +0000)]
Revert     [LOOPINFO] Extend Loop object to add utilities to get the loop bounds, step, induction variable, and guard branch.

This reverts r361517 (git commit 2049e4dd8f61100f88f14db33bd95d197bcbfbbc)

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

5 years ago[DAGCombiner] make folds of binops safe for opcodes that produce >1 value
Sanjay Patel [Thu, 23 May 2019 20:17:25 +0000 (20:17 +0000)]
[DAGCombiner] make folds of binops safe for opcodes that produce >1 value

This is no-functional-change-intended currently because the definition
of isBinOp() only includes opcodes that produce 1 value. But if we
share that implementation with isCommutativeBinOp() as proposed in
D62191, then we need to make sure that the callers bail out for
opcodes that they are not prepared to handle correctly.

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

5 years agoUpdateTestChecks: ppc32 triple support
Roman Lebedev [Thu, 23 May 2019 19:54:41 +0000 (19:54 +0000)]
UpdateTestChecks: ppc32 triple support

Summary:
Appears identical to powerpc64{,le}.
Regenerate test that is being affected by upcoming patch.

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: nemanjai, jsji, llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Correct maximum possible private allocation size
Matt Arsenault [Thu, 23 May 2019 19:38:14 +0000 (19:38 +0000)]
AMDGPU: Correct maximum possible private allocation size

We were assuming a much larger possible per-wave visible stack
allocation than is possible:

https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/faa3ae51388517353afcdaf9c16621f879ef0a59/src/core/runtime/amd_gpu_agent.cpp#L70

Based on this, we can assume the high 15 bits of a frame index or sret
are 0. The frame index value is the per-lane offset, so the maximum
frame index value is MAX_WAVE_SCRATCH / wavesize.

Remove the corresponding subtarget feature and option that made
this configurable.

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

5 years ago[NewPassManager] Add tuning option: LoopUnrolling [NFC].
Alina Sbirlea [Thu, 23 May 2019 19:35:40 +0000 (19:35 +0000)]
[NewPassManager] Add tuning option: LoopUnrolling [NFC].

Summary: Mirror tuning option from old pass manager in new pass manager.

Reviewers: chandlerc

Subscribers: jlebar, dmgreen, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC] UpdateTestChecks: asm.py: fix whitespace issue
Roman Lebedev [Thu, 23 May 2019 19:15:05 +0000 (19:15 +0000)]
[NFC] UpdateTestChecks: asm.py: fix whitespace issue

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

5 years ago[SLPVectorizer] Set flag to previous default.
Alina Sbirlea [Thu, 23 May 2019 19:07:41 +0000 (19:07 +0000)]
[SLPVectorizer] Set flag to previous default.

Summary:
The refactoring in r360276 moved the `RunSLPVectorization` flag and added the default explicitly. The default should have been `false`, as before.

The new pass manager used to have SLPVectorization on by default, now it's off in opt, and needs D61617 checked in to enable it in clang.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, eraman, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years ago[CMake] Fixing errors in r361513
Chris Bieneman [Thu, 23 May 2019 18:51:52 +0000 (18:51 +0000)]
[CMake] Fixing errors in r361513

Summary:
I somehow messed this up. libcxx appends the subdirectories itself, so we don't need to add them here.

Also, r361513 broke the "projects" build of libcxx because it always included the extra targets.

Reviewers: lebedev.ri, mclow.lists

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine] be more careful when transforming a shuffle mask
Sanjay Patel [Thu, 23 May 2019 18:46:03 +0000 (18:46 +0000)]
[InstCombine] be more careful when transforming a shuffle mask

This is reduced from a fuzzer test:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14890

Usually, demanded elements should be able to simplify shuffle
mask elements that are pointing to undef elements of its source
operands, but that doesn't happen in the test case.

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

5 years ago[git] Be more specific when looking for llvm-svn
Jordan Rupprecht [Thu, 23 May 2019 18:43:19 +0000 (18:43 +0000)]
[git] Be more specific when looking for llvm-svn

Summary:
A commit may, for some reason, have `llvm-svn:` in it multiple times. It may even take up the whole line and look identical to what gets added automatically when svn commits land in github.

To workaround this, make changes to both lookups:

1) When doing the git -> svn lookup, make sure to go through the whole message, and:
 a) Only look for llvm-svn starting at the beginning of the line (excluding the whitespace that `git log` adds).
 b) Take the last one (at the end of the commit message), if there are multiple matches.

2) When doing the svn -> git lookup, look through a sizeable but still reasonably small number of git commits (10k, about 4-5 months right now), and:
 a) Only consider commits with the '^llvm-svn: NNNNNN' we expect, and
 b) Only consider those that also follow the same git -> svn matching above. (Error if it's not exactly one commit).

Reviewers: jyknight

Reviewed By: jyknight

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoResubmit r360436 "[X86] Avoid SFB - Fix inconsistent codegen with/without debug info"
Robert Lougher [Thu, 23 May 2019 18:15:12 +0000 (18:15 +0000)]
Resubmit r360436 "[X86] Avoid SFB - Fix inconsistent codegen with/without debug info"

Fixes https://bugs.llvm.org/show_bug.cgi?id=40969

The functions findPotentiallyBlockedCopies and buildCopy are currently not
accounting for the presence of debug instructions. In the former this results
in the optimization not being trigerred, and in the latter results in
inconsistent codegen.

This patch enables the optimization to be performed in a debug build and
ensures the codegen is consistent with non-debug builds.

Patch by Chris Dawson.

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

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

5 years ago[WebAssembly] Implement ReplaceNodeResults to fix a SIMD crash
Thomas Lively [Thu, 23 May 2019 18:09:26 +0000 (18:09 +0000)]
[WebAssembly] Implement ReplaceNodeResults to fix a SIMD crash

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][PPC] Autogenerate vec_add_sub_quadword.ll test
Roman Lebedev [Thu, 23 May 2019 18:08:26 +0000 (18:08 +0000)]
[NFC][PPC] Autogenerate vec_add_sub_quadword.ll test

Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.

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

5 years ago[NFC][PPC] Autogenerate vec_add_sub_doubleword.ll test
Roman Lebedev [Thu, 23 May 2019 18:08:21 +0000 (18:08 +0000)]
[NFC][PPC] Autogenerate vec_add_sub_doubleword.ll test

Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.

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

5 years ago[NFC][Mips] Autogenerate msa/i5-s.ll test
Roman Lebedev [Thu, 23 May 2019 18:08:17 +0000 (18:08 +0000)]
[NFC][Mips] Autogenerate msa/i5-s.ll test

Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.

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

5 years ago[NFC][Mips] Autogenerate msa/arithmetic.ll test
Roman Lebedev [Thu, 23 May 2019 18:08:13 +0000 (18:08 +0000)]
[NFC][Mips] Autogenerate msa/arithmetic.ll test

Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.

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

5 years agoUpdateTestChecks: -march=mips/-march=mipsel is mips triple.
Roman Lebedev [Thu, 23 May 2019 18:08:00 +0000 (18:08 +0000)]
UpdateTestChecks: -march=mips/-march=mipsel is mips triple.

Again, a mixture of march and triple, with majority being march:

llvm/test/CodeGen/Mips$ grep -ri triple | wc -l
818
llvm/test/CodeGen/Mips$ grep -ri march | wc -l
1457

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

5 years agogn build: Merge r361418 more
Nico Weber [Thu, 23 May 2019 18:01:16 +0000 (18:01 +0000)]
gn build: Merge r361418 more

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

5 years agoAMDGPU/GlobalISel: Legality for integer min/max
Matt Arsenault [Thu, 23 May 2019 17:58:48 +0000 (17:58 +0000)]
AMDGPU/GlobalISel: Legality for integer min/max

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

5 years ago [LOOPINFO] Extend Loop object to add utilities to get the loop bounds, step,...
Kit Barton [Thu, 23 May 2019 17:56:35 +0000 (17:56 +0000)]
[LOOPINFO] Extend Loop object to add utilities to get the loop bounds, step, induction variable, and guard branch.

    Summary:
    This PR extends the loop object with more utilities to get loop bounds, step, induction variable, and guard branch. There already exists passes which try to obtain the loop induction variable in their own pass, e.g. loop interchange. It would be useful to have a common area to get these information. Moreover, loop fusion (https://reviews.llvm.org/D55851) is planning to use getGuard() to extend the kind of loops it is able to fuse, e.g. rotated loop with non-constant upper bound, which would have a loop guard.

      /// Example:
      /// for (int i = lb; i < ub; i+=step)
      ///   <loop body>
      /// --- pseudo LLVMIR ---
      /// beforeloop:
      ///   guardcmp = (lb < ub)
      ///   if (guardcmp) goto preheader; else goto afterloop
      /// preheader:
      /// loop:
      ///   i1 = phi[{lb, preheader}, {i2, latch}]
      ///   <loop body>
      ///   i2 = i1 + step
      /// latch:
      ///   cmp = (i2 < ub)
      ///   if (cmp) goto loop
      /// exit:
      /// afterloop:
      ///
      /// getBounds
      ///   getInitialIVValue      --> lb
      ///   getStepInst            --> i2 = i1 + step
      ///   getStepValue           --> step
      ///   getFinalIVValue        --> ub
      ///   getCanonicalPredicate  --> '<'
      ///   getDirection           --> Increasing
      /// getGuard             --> if (guardcmp) goto loop; else goto afterloop
      /// getInductionVariable          --> i1
      /// getAuxiliaryInductionVariable --> {i1}
      /// isCanonical                   --> false

    Committed on behalf of @Whitney (Whitney Tsang).

    Reviewers: kbarton, hfinkel, dmgreen, Meinersbur, jdoerfert, syzaara, fhahn

    Reviewed By: kbarton

    Subscribers: tvvikram, bmahjour, etiotto, fhahn, jsji, hiraditya, llvm-commits

    Tags: #llvm

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

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

5 years ago[WebAssembly] Add multivalue and tail-call target features
Thomas Lively [Thu, 23 May 2019 17:26:47 +0000 (17:26 +0000)]
[WebAssembly] Add multivalue and tail-call target features

Summary:
These features will both be implemented soon, so I thought I would
save time by adding the boilerplate for both of them at the same time.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[FileCheck] Remove llvm:: prefix
Thomas Preud'homme [Thu, 23 May 2019 17:19:36 +0000 (17:19 +0000)]
[FileCheck] Remove llvm:: prefix

Summary:
Remove all llvm:: prefixes in FileCheck library header and
implementation except for calls to make_unique and make_shared since
both files already use the llvm namespace.

Reviewers: jhenderson, jdenny, probinson, arichardson

Subscribers: hiraditya, arichardson, probinson, llvm-commits

Tags: #llvm

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

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

5 years ago[CMake] Copy C++ headers before configuring runtimes build
Chris Bieneman [Thu, 23 May 2019 17:06:46 +0000 (17:06 +0000)]
[CMake] Copy C++ headers before configuring runtimes build

Summary: On some platforms C++ headers are packaged with the compiler not the sysroot. If you don't copy C++ headers into the build include directory during configuraiton of the outer build the C++ check during the runtime configuration may get inaccurate results.

Reviewers: phosek, compnerd, smeenai, EricWF

Reviewed By: compnerd

Subscribers: EricWF, christof, libcxx-commits, mgorny, llvm-commits

Tags: #llvm, #libc

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

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

5 years agoTransforms: lower fadd and fsub atomicrmw instructions
Saleem Abdulrasool [Thu, 23 May 2019 17:03:43 +0000 (17:03 +0000)]
Transforms: lower fadd and fsub atomicrmw instructions

`fadd` and `fsub` have recently (r351850) been added as `atomicrmw`
operations. This diff adds lowering cases for them to the LowerAtomic
transform.

Patch by Josh Berdine!

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

5 years ago[MCA] Add the ability to compute critical register dependency of an instruction.
Andrea Di Biagio [Thu, 23 May 2019 16:32:19 +0000 (16:32 +0000)]
[MCA] Add the ability to compute critical register dependency of an instruction.

This patch adds the methods `getCriticalRegDep()` and `computeCriticalRegDep()` to
class InstructionBase.
The goal is to allow users to obtain information about the critical register
dependency that most affects the latency of an instruction.

These methods are currently unused. However, the long term plan is to use them
in order to allow the computation of a critical-path as part of the bottleneck
analysis. So, this is yet another step towards fixing PR37494.

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

5 years ago[AsmPrinter] Treat a narrowing PtrToInt like Trunc
Shoaib Meenai [Thu, 23 May 2019 16:29:09 +0000 (16:29 +0000)]
[AsmPrinter] Treat a narrowing PtrToInt like Trunc

When printing assembly for PtrToInt, AsmPrinter::lowerConstant
incorrectly assumed that if PtrToInt was not converting to an
int with exactly the same number of bits, it must be widening
to a larger int. But this isn't necessarily true; PtrToInt can
also shrink the size, which is useful when you want to produce
a known 32-bit pointer on a 64-bit platform (on x86_64 ELF
this yields a R_X86_64_32 relocation).

The old behavior of falling through to the widening case for a
narrowing PtrToInt yields bogus assembly code like this, which
fails to assemble because the no-op bit and it accidentally
creates is not a valid relocation:

```
        .long   a&-1
```

The fix is to treat a narrowing PtrToInt exactly the same as
it already treats Trunc: just emit the expression and let
the assembler deal with truncating it in the appropriate way.

Patch by Mat Hostetter <mjh@fb.com>.

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

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

5 years ago[Object] object::ELFObjectFile::symbol_begin(): skip symbol index 0
Fangrui Song [Thu, 23 May 2019 16:01:59 +0000 (16:01 +0000)]
[Object] object::ELFObjectFile::symbol_begin(): skip symbol index 0

For clients iterating the symbol table, none expects to handle index 0
(STN_UNDEF). Skip it to improve consistency with other binary formats.
Clients that need STN_UNDEF (e.g. lld) can use
getSectionContentsAsArray(). A test will be added in D62148.

Reviewed By: mtrent

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

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

5 years ago[cmake] When getting Ninja version, don't include CMakeNinjaFindMake
Don Hinton [Thu, 23 May 2019 15:03:22 +0000 (15:03 +0000)]
[cmake] When getting Ninja version, don't include CMakeNinjaFindMake
which doesn't play well with passing CMAKE_MAKE_PROGRAM from the
commandline without a path.

Fixes a bug introduced in r361280.

Thanks to Mikael Holmén for reporting this!

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

5 years ago[NFC][InstCombine] Add unary FNeg tests to maximum.ll/minimum.ll
Cameron McInally [Thu, 23 May 2019 14:53:42 +0000 (14:53 +0000)]
[NFC][InstCombine] Add unary FNeg tests to maximum.ll/minimum.ll

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

5 years ago[RISCV] Support assembling TLS LA pseudo instructions
Lewis Revill [Thu, 23 May 2019 14:46:27 +0000 (14:46 +0000)]
[RISCV] Support assembling TLS LA pseudo instructions

This patch adds the pseudo instructions la.tls.ie and la.tls.gd, used in
the initial-exec and global-dynamic TLS models respectively when
addressing a global. The pseudo instructions are expanded in the
assembly parser.

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

5 years agogn build: Merge r361487
Nico Weber [Thu, 23 May 2019 13:59:44 +0000 (13:59 +0000)]
gn build: Merge r361487

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

5 years ago[LiveDebugValues] Rename 'DMI' into 'DebugInstr' (NFC)
Petar Jovanovic [Thu, 23 May 2019 13:49:06 +0000 (13:49 +0000)]
[LiveDebugValues] Rename 'DMI' into 'DebugInstr' (NFC)

This will improve code readability.

Patch by Djordje Todorovic.

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

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

5 years ago[MCA] Introduce class LSUnitBase and let LSUnit derive from it.
Andrea Di Biagio [Thu, 23 May 2019 13:42:47 +0000 (13:42 +0000)]
[MCA] Introduce class LSUnitBase and let LSUnit derive from it.

Class LSUnitBase provides a abstract interface for all the concrete LS units in
llvm-mca.

Methods exposed by the public abstract LSUnitBase interface are:
 - Status isAvailable(const InstRef&);
 - void dispatch(const InstRef &);
 - const InstRef &isReady(const InstRef &);

LSUnitBase standardises the API, but not the data structures internally used by
LS units. This allows for more flexibility.
Previously, only method `isReady()` was declared virtual by class LSUnit.
Also, derived classes had to inherit all the internal data members of LSUnit.

No functional change intended.

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

5 years ago[X86] Regenerate LZCNT tests on x86/x32/x64 targets
Simon Pilgrim [Thu, 23 May 2019 13:30:10 +0000 (13:30 +0000)]
[X86] Regenerate LZCNT tests on x86/x32/x64 targets

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

5 years ago[RISCV][NFC] Add nounwind attribute to functions missing it in test/CodeGen/RISCV
Alex Bradbury [Thu, 23 May 2019 12:43:13 +0000 (12:43 +0000)]
[RISCV][NFC] Add nounwind attribute to functions missing it in test/CodeGen/RISCV

r360897 was incomplete, must have applied an old/wip patch. This is in preparation for emitting CFI directives.

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

5 years ago[llvm-objdump][test] Make MachO test names consistent
Fangrui Song [Thu, 23 May 2019 12:43:08 +0000 (12:43 +0000)]
[llvm-objdump][test] Make MachO test names consistent

We have macho-disassembl{e,y}-*. Rename macho-disassembly-* to
macho-disassemble-* for consistency.

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

5 years ago[llvm-objdump][test] Make test names consistent
James Henderson [Thu, 23 May 2019 12:38:06 +0000 (12:38 +0000)]
[llvm-objdump][test] Make test names consistent

This change renames a number of the disassembly tests to standardise
disasm/diassemble/disassembly to disassemble. Requested in
https://reviews.llvm.org/D62255.

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

5 years ago[MergeICmps] Make the pass compatible with the new pass manager.
Clement Courbet [Thu, 23 May 2019 12:35:26 +0000 (12:35 +0000)]
[MergeICmps] Make the pass compatible with the new pass manager.

Reviewers: gchatelet, spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objdump][test] Improve testing of some switches #3
James Henderson [Thu, 23 May 2019 12:30:39 +0000 (12:30 +0000)]
[llvm-objdump][test] Improve testing of some switches #3

This is the third commit in a series of patches to improve test coverage
of llvm-objdump. In this patch I have added a number of tests testing
various aspects of disassembly.

Reviewed by: MaskRay, grimar, rupprecht

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

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

5 years ago[AMDGPU] Regenerate vector sub tests
Simon Pilgrim [Thu, 23 May 2019 11:27:28 +0000 (11:27 +0000)]
[AMDGPU] Regenerate vector sub tests

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

5 years ago[lldb] NFC modernize codebase with modernize-use-nullptr
Konrad Kleine [Thu, 23 May 2019 11:14:47 +0000 (11:14 +0000)]
[lldb] NFC modernize codebase with modernize-use-nullptr

Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]

This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.

This is the command I ran and I to fix and format the code base:

```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```

NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.

NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.

Reviewers: martong, espindola, shafik, #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits

Tags: #lldb, #llvm

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

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

5 years ago[NFC][X86] Fix check prefixes and autogenerate fold-pcmpeqd-2.ll test
Roman Lebedev [Thu, 23 May 2019 10:55:13 +0000 (10:55 +0000)]
[NFC][X86] Fix check prefixes and autogenerate fold-pcmpeqd-2.ll test

Being affected by (sub %x, c) -> (add %x, (sub 0, c))
patch in an uncertain way.

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

5 years ago[MCA] Make the bool conversion operator in class InstRef explicit. NFCI
Andrea Di Biagio [Thu, 23 May 2019 10:50:01 +0000 (10:50 +0000)]
[MCA] Make the bool conversion operator in class InstRef explicit. NFCI

This patch makes the bool conversion operator in InstRef explicit.
It also adds a operator< to hel comparing InstRef objects in sets.

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

5 years ago[DwarfExpression] Refactor dwarf expression (NFC)
Petar Jovanovic [Thu, 23 May 2019 10:37:13 +0000 (10:37 +0000)]
[DwarfExpression] Refactor dwarf expression (NFC)

Refactor location description kind in order to be easier for extensions
(needed for D60866).
In addition, cut off some bits from the other class fields.

Patch by Djordje Todorovic.

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

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

5 years ago[llvm-objdump][test] Improve testing of some switches #2
James Henderson [Thu, 23 May 2019 10:17:10 +0000 (10:17 +0000)]
[llvm-objdump][test] Improve testing of some switches #2

This patch focuses on adding additional testing for the --source switch.
For reference, the source-interleave-x86_64.ll test file has been split
into two parts - the input (shared with the other tests) and the test
itself.

Reviewed by: MaskRay, rupprecht, grimar

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

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

5 years ago[llvm-objcopy] - Many minor NFC changes to cleanup/improve the code in ELF/Object...
George Rimar [Thu, 23 May 2019 09:18:57 +0000 (09:18 +0000)]
[llvm-objcopy] - Many minor NFC changes to cleanup/improve the code in ELF/Object.cpp.

The code in ELF/Object.cpp is sometimes a bit hard to read because of
lots of auto used everywhere. The main intention of this patch is
to replace them with the real type for places where it is not obvious.
Also it cleanups few places.

It is NFC change, but I want to be sure that there is no objections to do that since it
is massive.

DIfferential revision: https://reviews.llvm.org/D62260

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

5 years ago[ARM][CGP] Clear SafeWrap before each search
Sam Parker [Thu, 23 May 2019 07:46:39 +0000 (07:46 +0000)]
[ARM][CGP] Clear SafeWrap before each search

The previous patch added a member set to store instructions that we
could allow to wrap. But this wasn't cleared between searches meaning
that they could get promoted, incorrectly, during the promotion of a
separate valid chain.

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

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

5 years ago[GlobalOpt] recognize dead struct fields and propagate values
Christian Bruel [Thu, 23 May 2019 05:53:10 +0000 (05:53 +0000)]
[GlobalOpt] recognize dead struct fields and propagate values

Summary:
Allow struct fields SRA and dead stores. This works by considering fields accesses from getElementPtr to be considered as a possible pointer root that can be cleaned up.
We check that the variable can be SRA by recursively checking the sub expressions with the new isSafeSubSROAGEP function.

basically this allows the array in following C code  to be optimized out

struct Expr {
  int a[2];
  int b;
};

static struct Expr e;

int foo (int i)
{
  e.b = 2;
  e.a[i] = 1;
  return e.b;
}

Reviewers: greened, bkramer, nicholas, jmolloy

Reviewed By: jmolloy

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[WebAssembly] Implement __builtin_return_address for emscripten
Thomas Lively [Thu, 23 May 2019 01:24:01 +0000 (01:24 +0000)]
[WebAssembly] Implement __builtin_return_address for emscripten

Summary:
In this patch, `ISD::RETURNADDR` is lowered on the emscripten target
to the new Emscripten runtime function `emscripten_return_address`, which
implements the functionality.

Patch by Guanzhong Chen

Reviewers: tlively, aheejin

Reviewed By: tlively

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Support -fno-plt __tls_get_addr calls
Fangrui Song [Thu, 23 May 2019 01:05:13 +0000 (01:05 +0000)]
[X86] Support -fno-plt __tls_get_addr calls

In general dynamic/local dynamic TLS models, with -fno-plt,

* x86: emit `calll *___tls_get_addr@GOT(%ebx)` instead of `calll ___tls_get_addr@PLT`
  Note, on x86, if we can get rid of %ebx as the PIC register,
  it may be better to use a register not preserved across function calls.
* x86_64: emit `callq *__tls_get_addr@GOTPCREL(%rip)` instead of `callq __tls_get_addr@PLT`

Reorganize the code by separating 32-bit and 64-bit.

Reviewed By: rnk

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

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

5 years ago[llvm-objcopy] Add file names to error messages
Seiya Nuta [Thu, 23 May 2019 00:42:46 +0000 (00:42 +0000)]
[llvm-objcopy] Add file names to error messages

Summary:
This patch adds the file names to llvm-objcopy error messages. It makes easy to identify which file causes an error.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41798

Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich

Reviewed By: rupprecht, jhenderson, jakehehrlich

Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Merge r361418.
Peter Collingbourne [Thu, 23 May 2019 00:31:55 +0000 (00:31 +0000)]
gn build: Merge r361418.

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