OSDN Git Service

android-x86/external-llvm.git
5 years agoARM: use correct offset from base pointer (r6) in call frame regions.
Tim Northover [Fri, 7 Dec 2018 13:43:55 +0000 (13:43 +0000)]
ARM: use correct offset from base pointer (r6) in call frame regions.

When we had dynamic call frames (i.e. sp adjustment around each call) we
were including that adjustment into offsets calculated based on r6, even
though it's only sp that changes. This led to incorrect stack slot
accesses.

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

5 years ago[Targets] Add errors for tiny and kernel codemodel on targets that don't support...
David Green [Fri, 7 Dec 2018 12:10:23 +0000 (12:10 +0000)]
[Targets] Add errors for tiny and kernel codemodel on targets that don't support them

Adds fatal errors for any target that does not support the Tiny or Kernel
codemodels by rejigging the getEffectiveCodeModel calls.

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

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

5 years agoFix gcc7.3 -Wparentheses warning. NFCI.
Simon Pilgrim [Fri, 7 Dec 2018 11:10:03 +0000 (11:10 +0000)]
Fix gcc7.3 -Wparentheses warning. NFCI.

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

5 years ago[yaml2obj] format some codes NFC.
Xing GUO [Fri, 7 Dec 2018 11:04:22 +0000 (11:04 +0000)]
[yaml2obj] format some codes NFC.

Summary: This line is longer than 80 characters.

Subscribers: llvm-commits, jakehehrlich

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

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

5 years ago[yaml2obj] revert bad change
Xing GUO [Fri, 7 Dec 2018 10:50:29 +0000 (10:50 +0000)]
[yaml2obj] revert bad change

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

5 years ago[yaml2obj] format some codes NFC.
Xing GUO [Fri, 7 Dec 2018 10:31:34 +0000 (10:31 +0000)]
[yaml2obj] format some codes NFC.

Summary: This line is longer than 80 characters.

Subscribers: llvm-commits, jakehehrlich

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

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

5 years agoFix test/tools/llvm-mca/AArch64/Exynos/direct-branch.s on Mac
Hans Wennborg [Fri, 7 Dec 2018 09:58:33 +0000 (09:58 +0000)]
Fix test/tools/llvm-mca/AArch64/Exynos/direct-branch.s on Mac

It was failing as below. Adding a triple seems to help.

--
: 'RUN: at line 2';   /work/llvm.combined/build.release/bin/llvm-mca -march=aarch64 -mcpu=exynos-m1 -resource-pressure=false < /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s | /work/llvm.combined/build.release/bin/FileCheck /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s -check-prefixes=ALL,M1
: 'RUN: at line 3';   /work/llvm.combined/build.release/bin/llvm-mca -march=aarch64 -mcpu=exynos-m3 -resource-pressure=false < /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s | /work/llvm.combined/build.release/bin/FileCheck /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s -check-prefixes=ALL,M3
--
Exit Code: 1

Command Output (stderr):
--
/work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s:36:12: error: M1-NEXT: expected string not found in input
           ^
<stdin>:21:2: note: scanning from here
 1 0 0.25 b Ltmp0
 ^

--

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

5 years ago[utils] Use operator "in" instead of bound function "has_key"
Roger Ferrer Ibanez [Fri, 7 Dec 2018 09:49:21 +0000 (09:49 +0000)]
[utils] Use operator "in" instead of bound function "has_key"

has_key has been removed in Python 3. The in comparison operator can be used
instead.

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

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

5 years ago[X86] Add ivybridge to llvm-exegesis PFM counter mappings
Simon Pilgrim [Fri, 7 Dec 2018 09:27:35 +0000 (09:27 +0000)]
[X86] Add ivybridge to llvm-exegesis PFM counter mappings

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

5 years ago[SelectionDAG] Don't pass on DemandedElts when handling SCALAR_TO_VECTOR
Simon Pilgrim [Fri, 7 Dec 2018 09:18:44 +0000 (09:18 +0000)]
[SelectionDAG] Don't pass on DemandedElts when handling SCALAR_TO_VECTOR

Fixes an assertion:

llc: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2200: llvm::KnownBits llvm::SelectionDAG::computeKnownBits(llvm::SDValue, const llvm::APInt&, unsigned int) const: Assertion `(!Op.getValueType().isVector() || NumElts == Op.getValueType().getVectorNumElements()) && "Unexpected vector size"' failed.

Committed on behalf of: @pendingchaos (Rhys Perry)

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

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

5 years ago[CMake] Add support for NO_INSTALL_RPATH argument in llvm_add_library()
Stefan Granitz [Fri, 7 Dec 2018 09:12:54 +0000 (09:12 +0000)]
[CMake] Add support for NO_INSTALL_RPATH argument in llvm_add_library()

Summary:
Allow clients to suppress setup of default RPATHs in designated library targets. This is used in LLDB when emitting liblldb as a framework bundle, which itself doesn't load further RPATH-dependent libraries.
This follows the approach in add_llvm_executable().

Reviewers: aprantl, JDevlieghere, davide, friss

Reviewed By: aprantl

Subscribers: mgorny, lldb-commits, llvm-commits, #lldb

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

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

5 years ago[IR] Don't assume all functions are 4 byte aligned
Ranjeet Singh [Fri, 7 Dec 2018 08:34:59 +0000 (08:34 +0000)]
[IR] Don't assume all functions are 4 byte aligned

In some cases different alignments for function might be used to save
space e.g. thumb mode with -Oz will try to use 2 byte function
alignment. Similar patch that fixed this in other areas exists here
https://reviews.llvm.org/D46110

This was approved previously https://reviews.llvm.org/D55115 (r348215)
but when committed it caused failures on the sanitizer buildbots when
building llvm with clang (containing this patch). This is now fixed
because I've added a check to see if getting the parent module returns
null if it does then set the alignment to 0.

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

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

5 years ago[PM] Port LoadStoreVectorizer to the new pass manager.
Markus Lavin [Fri, 7 Dec 2018 08:23:37 +0000 (08:23 +0000)]
[PM] Port LoadStoreVectorizer to the new pass manager.

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

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

5 years ago[LoopSimplifyCFG] Do not deal with loops with irreducible CFG inside
Max Kazantsev [Fri, 7 Dec 2018 05:44:45 +0000 (05:44 +0000)]
[LoopSimplifyCFG] Do not deal with loops with irreducible CFG inside

The current algorithm that collects live/dead/inloop blocks relies on some invariants
related to RPO and PO traversals. In particular, the important fact it requires is that
the only loop's latch is the first block in PO traversal. It also relies on fact that during
RPO we visit all prececessors of a block before we visit this block (backedges ignored).

If a loop has irreducible non-loop cycle inside, both these assumptions may break.
This patch adds detection for this situation and prohibits the terminator folding
for loops with irreducible CFG.

We can in theory support this later, for this some algorithmic changes are needed.
Besides, irreducible CFG is not a frequent situation and we can just don't bother.

Thanks @uabelho for finding this!

Differential Revision: https://reviews.llvm.org/D55357
Reviewed By: skatkov

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

5 years ago[PowerPC] Fix assert from machine verify pass that missing undef register flag
Zi Xuan Wu [Fri, 7 Dec 2018 05:25:16 +0000 (05:25 +0000)]
[PowerPC] Fix assert from machine verify pass that missing undef register flag

Fix assert about using an undefined physical register in machine instruction verify pass.
The reason is that register flag undef is missing when doing transformation from If Conversion Pass.

```
Bad machine code: Using an undefined physical register
- function:    func_65
- basic block: %bb.0 entry (0x10024740738)
- instruction: BCLR killed $cr5lt, implicit $lr8, implicit $rm, implicit undef $x3
- operand 0:   killed $cr5lt
LLVM ERROR: Found 1 machine code errors.
```

There are also other existing testcases with same issue. So I add -verify-machineinstrs option to open verifying.

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

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

5 years ago[llvm-mca] Improve test (NFC)
Evandro Menezes [Fri, 7 Dec 2018 03:23:36 +0000 (03:23 +0000)]
[llvm-mca] Improve test (NFC)

Add more instructions to the test for Cortex.

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

5 years ago[llvm-mca] Improve test (NFC)
Evandro Menezes [Fri, 7 Dec 2018 03:23:14 +0000 (03:23 +0000)]
[llvm-mca] Improve test (NFC)

Add a label to make explicit that the branch is short for Exynos.

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

5 years ago[CodeExtractor] Store outputs at the first valid insertion point
Vedant Kumar [Fri, 7 Dec 2018 03:01:54 +0000 (03:01 +0000)]
[CodeExtractor] Store outputs at the first valid insertion point

When CodeExtractor outlines values which are used by the original
function, it must store those values in some in-out parameter. This
store instruction must not be inserted in between a PHI and an EH pad
instruction, as that results in invalid IR.

This fixes the following verifier failure seen while outlining within
ObjC methods with live exit values:

  The unwind destination does not have an exception handling instruction!
    %call35 = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %exn.adjusted, i8* %1)
            to label %invoke.cont34 unwind label %lpad33, !dbg !4183
  The unwind destination does not have an exception handling instruction!
    invoke void @objc_exception_throw(i8* %call35) #12
            to label %invoke.cont36 unwind label %lpad33, !dbg !4184
  LandingPadInst not the first non-PHI instruction in the block.
    %3 = landingpad { i8*, i32 }
            catch i8* null, !dbg !1411

rdar://46540815

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

5 years agoRevert "[llvm-tapi] Don't override SequenceTraits for std::string"
Armando Montanez [Fri, 7 Dec 2018 01:31:28 +0000 (01:31 +0000)]
Revert "[llvm-tapi] Don't override SequenceTraits for std::string"

Revert r348551 since it triggered some warnings that don't appear to have a quick fix.

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

5 years agoRevert "[DemandedBits][BDCE] Support vectors of integers"
Nikita Popov [Fri, 7 Dec 2018 00:42:03 +0000 (00:42 +0000)]
Revert "[DemandedBits][BDCE] Support vectors of integers"

This reverts commit r348549. Causing assertion failures during
clang build.

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

5 years ago[DAGCombiner] use root SDLoc for all nodes created by logic fold
Sanjay Patel [Fri, 7 Dec 2018 00:01:57 +0000 (00:01 +0000)]
[DAGCombiner] use root SDLoc for all nodes created by logic fold

If this is not a valid way to assign an SDLoc, then we get this
wrong all over SDAG.

I don't know enough about the SDAG to explain this. IIUC, theoretically,
debug info is not supposed to affect codegen. But here it has clearly
affected 3 different targets, and the x86 change is an actual improvement.

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

5 years ago[llvm-tapi] Don't override SequenceTraits for std::string
Armando Montanez [Thu, 6 Dec 2018 23:59:32 +0000 (23:59 +0000)]
[llvm-tapi] Don't override SequenceTraits for std::string

Change the ELF YAML implementation of TextAPI so NeededLibs uses flow
sequence vector correctly instead of overriding the YAML implementation
for std::vector<std::string>>.

This should fix the test failure with the LLVM_LINK_LLVM_DYLIB build mentioned in D55381.

Still passes existing tests that cover this.

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

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

5 years ago[DAGCombiner] don't bother saving a SDLoc for a node that's dead; NFCI
Sanjay Patel [Thu, 6 Dec 2018 23:53:58 +0000 (23:53 +0000)]
[DAGCombiner] don't bother saving a SDLoc for a node that's dead; NFCI

We shouldn't care about the debug location for a node that
we're creating, but attaching the root of the pattern should
be the best effort. (If this is not true, then we are doing
it wrong all over the SDAG).

This is no-functional-change-intended, and there are no
regression test diffs...and that's what I expected. But
there's a similar line above this diff, where those
assumptions apparently do not hold.

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

5 years ago[DemandedBits][BDCE] Support vectors of integers
Nikita Popov [Thu, 6 Dec 2018 23:50:32 +0000 (23:50 +0000)]
[DemandedBits][BDCE] Support vectors of integers

DemandedBits and BDCE currently only support scalar integers. This
patch extends them to also handle vector integer operations. In this
case bits are not tracked for individual vector elements, instead a
bit is demanded if it is demanded for any of the elements. This matches
the behavior of computeKnownBits in ValueTracking and
SimplifyDemandedBits in InstCombine.

The getDemandedBits() method can now only be called on instructions that
have integer or vector of integer type. Previously it could be called on
any sized instruction (even if it was not particularly useful). The size
of the return value is now always the scalar size in bits (while
previously it was the type size in bits).

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

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

5 years ago[BDCE] Add tests for BDCE applied to vector instructions; NFC
Nikita Popov [Thu, 6 Dec 2018 23:50:19 +0000 (23:50 +0000)]
[BDCE] Add tests for BDCE applied to vector instructions; NFC

These are baseline tests for D55297.

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

5 years ago[DAGCombiner] more clean up in hoistLogicOpWithSameOpcodeHands(); NFC
Sanjay Patel [Thu, 6 Dec 2018 23:39:28 +0000 (23:39 +0000)]
[DAGCombiner] more clean up in hoistLogicOpWithSameOpcodeHands(); NFC

This code can still misbehave.

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

5 years agoRun `git ls-files '*.gn' '*.gni' | xargs -n 1 gn format`.
Nico Weber [Thu, 6 Dec 2018 22:40:05 +0000 (22:40 +0000)]
Run `git ls-files '*.gn' '*.gni' | xargs -n 1 gn format`.

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

5 years ago[gn build] merge r348505.
Nico Weber [Thu, 6 Dec 2018 22:36:16 +0000 (22:36 +0000)]
[gn build] merge r348505.

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

5 years ago[X86] Directly create ADC/SBB nodes instead of using ADD/SUB with (and SETCC_CARRY, 1)
Craig Topper [Thu, 6 Dec 2018 22:26:59 +0000 (22:26 +0000)]
[X86] Directly create ADC/SBB nodes instead of using ADD/SUB with (and SETCC_CARRY, 1)

This addresses a FIXME and avoids depending on an isel pattern match I think. I've remove the isel patterns too since he have no lit tests left that cover them. Hopefully that really means they are unused.

I'm trying to decide if we need SETCC_CARRY. This removes one of its usages.

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

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

5 years ago[DAGCombiner] don't group bswap with casts in logic hoisting fold
Sanjay Patel [Thu, 6 Dec 2018 22:10:44 +0000 (22:10 +0000)]
[DAGCombiner] don't group bswap with casts in logic hoisting fold

This was probably organized as it was because bswap is a unary op.
But that's where the similarity to the other opcodes ends. We should
not limit this transform to scalars, and we should not try it if
either input has other uses. This is another step towards trying to
clean this whole function up to prevent it from causing infinite loops
and memory explosions.

Earlier commits in this series:
rL348501
rL348508
rL348518

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

5 years ago[x86] add test for vector bitwise-logic-of-bswaps; NFC
Sanjay Patel [Thu, 6 Dec 2018 21:56:30 +0000 (21:56 +0000)]
[x86] add test for vector bitwise-logic-of-bswaps; NFC

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

5 years ago[DAGCombiner] reduce indent; NFC
Sanjay Patel [Thu, 6 Dec 2018 20:02:47 +0000 (20:02 +0000)]
[DAGCombiner] reduce indent; NFC

Unlike some of the folds in hoistLogicOpWithSameOpcodeHands()
above this shuffle transform, this has the expected hasOneUse()
checks in place.

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

5 years ago[DagCombiner][X86] Simplify a ConcatVectors of a scalar_to_vector with undef.
Andrea Di Biagio [Thu, 6 Dec 2018 19:55:38 +0000 (19:55 +0000)]
[DagCombiner][X86] Simplify a ConcatVectors of a scalar_to_vector with undef.

This patch introduces a new DAGCombiner rule to simplify concat_vectors nodes:

concat_vectors( bitcast (scalar_to_vector %A), UNDEF)
    --> bitcast (scalar_to_vector %A)

This patch only partially addresses PR39257. In particular, it is enough to fix
one of the two problematic cases mentioned in PR39257. However, it is not enough
to fix the original test case posted by Craig; that particular case would
probably require a more complicated approach (and knowledge about used bits).

Before this patch, we used to generate the following code for function PR39257
(-mtriple=x86_64 , -mattr=+avx):

vmovsd  (%rdi), %xmm0           # xmm0 = mem[0],zero
vxorps  %xmm1, %xmm1, %xmm1
vblendps        $3, %xmm0, %xmm1, %xmm0 # xmm0 = xmm0[0,1],xmm1[2,3]
vmovaps %ymm0, (%rsi)
vzeroupper
retq

Now we generate this:

vmovsd  (%rdi), %xmm0           # xmm0 = mem[0],zero
vmovaps %ymm0, (%rsi)
vzeroupper
retq

As a side note: that VZEROUPPER is completely redundant...

I guess the vzeroupper insertion pass doesn't realize that the definition of
%xmm0 from vmovsd is already zeroing the upper half of %ymm0. Note that on
%-mcpu=btver2, we don't get that vzeroupper because pass vzeroupper insertion
%pass is disabled.

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

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

5 years ago[DAGCombiner] don't hoist logic op if operands have other uses, part 2
Sanjay Patel [Thu, 6 Dec 2018 19:18:56 +0000 (19:18 +0000)]
[DAGCombiner] don't hoist logic op if operands have other uses, part 2

The PPC test with 2 extra uses seems clearly better by avoiding this transform.
With 1 extra use, we also prevent an extra register move (although that might
be an RA problem). The general rule should be to only make a change here if
it is always profitable. The x86 diffs are all neutral.

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

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Thu, 6 Dec 2018 19:17:28 +0000 (19:17 +0000)]
Fix Wdocumentation warning. NFCI.

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

5 years ago[PowerPC] add tests for hoisting bitwise logic; NFC
Sanjay Patel [Thu, 6 Dec 2018 19:05:19 +0000 (19:05 +0000)]
[PowerPC] add tests for hoisting bitwise logic; NFC

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

5 years agoReapply "Adapt gcov to changes in CFE."
Adrian Prantl [Thu, 6 Dec 2018 18:44:48 +0000 (18:44 +0000)]
Reapply "Adapt gcov to changes in CFE."

This reverts commit r348203 and reapplies D55085 with an additional
GCOV bugfix to make the change NFC for relative file paths in .gcno files.

Thanks to Ilya Biryukov for additional testing!

Original commit message:

    Update Diagnostic handling for changes in CFE.

    The clang frontend no longer emits the current working directory for
    DIFiles containing an absolute path in the filename: and will move the
    common prefix between current working directory and the file into the
    directory: component.

    https://reviews.llvm.org/D55085

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

5 years ago[AArch64] Fix Exynos predicate
Evandro Menezes [Thu, 6 Dec 2018 18:25:37 +0000 (18:25 +0000)]
[AArch64] Fix Exynos predicate

Fix predicate for arithmetic instructions with shift and/or extend.

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

5 years ago[DAGCombiner] don't hoist logic op if operands have other uses
Sanjay Patel [Thu, 6 Dec 2018 18:16:32 +0000 (18:16 +0000)]
[DAGCombiner] don't hoist logic op if operands have other uses

The AVX512 diffs are neutral, but the bswap test shows a clear overreach in
hoistLogicOpWithSameOpcodeHands(). If we don't check for other uses, we can
increase the instruction count.

This could also fight with transforms trying to go in the opposite direction
and possibly blow up/infinite loop. This might be enough to solve the bug
noted here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181203/608593.html

I did not add the hasOneUse() checks to all opcodes because I see a perf
regression for at least one opcode. We may decide that's irrelevant in the
face of potential compiler crashing, but I'll see if I can salvage that first.

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

5 years ago[x86] add test for hoistLogicOpWithSameOpcodeHands with extra uses; NFC
Sanjay Patel [Thu, 6 Dec 2018 18:06:10 +0000 (18:06 +0000)]
[x86] add test for hoistLogicOpWithSameOpcodeHands with extra uses; NFC

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

5 years ago[PDB] Move some code around. NFC.
Zachary Turner [Thu, 6 Dec 2018 17:49:15 +0000 (17:49 +0000)]
[PDB] Move some code around.  NFC.

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

5 years ago[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn
Nico Weber [Thu, 6 Dec 2018 17:42:35 +0000 (17:42 +0000)]
[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn

Tweak write_cmake_config.py to also handle variable references looking @FOO@
(matching CMake's configure_file() function), and make it replace '\' 'n' in
values with a newline literal since there's no good portable way of passing a
real newline literal on a command line.

Use that to process all the .def.in files in llvm/include/Config and add
llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes
them.

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

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

5 years ago[DAGCombiner] refactor function that hoists bitwise logic; NFCI
Sanjay Patel [Thu, 6 Dec 2018 17:08:03 +0000 (17:08 +0000)]
[DAGCombiner] refactor function that hoists bitwise logic; NFCI

Added FIXME and TODO comments for lack of safety checks.
This function is a suspect in out-of-memory errors as discussed in
the follow-up thread to r347917:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181203/608593.html

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

5 years agoSupport skewed stream arrays.
Zachary Turner [Thu, 6 Dec 2018 16:55:00 +0000 (16:55 +0000)]
Support skewed stream arrays.

VarStreamArray was built on the assumption that it is backed by a
StreamRef, and offset 0 of that StreamRef is the first byte of the first
record in the array.

This is a logical and intuitive assumption, but unfortunately we have
use cases where it doesn't hold. Specifically, a PDB module's symbol
stream is prefixed by 4 bytes containing a magic value, and the first
byte of record data in the array is actually at offset 4 of this byte
sequence.

Previously, we would just truncate the first 4 bytes and then construct
the VarStreamArray with the resulting StreamRef, so that offset 0 of the
underlying stream did correspond to the first byte of the first record,
but this is problematic, because symbol records reference other symbol
records by the absolute offset including that initial magic 4 bytes. So
if another record wants to refer to the first record in the array, it
would say "the record at offset 4".

This led to extremely confusing hacks and semantics in loading code, and
after spending 30 minutes trying to get some math right and failing, I
decided to fix this in the underlying implementation of VarStreamArray.
Now, we can say that a stream is skewed by a particular amount. This
way, when we access a record by absolute offset, we can use the same
values that the records themselves contain, instead of having to do
fixups.

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

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

5 years ago[X86] Refactored IsSplatVector to use switch. NFCI.
Simon Pilgrim [Thu, 6 Dec 2018 16:29:14 +0000 (16:29 +0000)]
[X86] Refactored IsSplatVector to use switch. NFCI.

Initial step towards making the function more generic (and probably move into SelectionDAG).

This is necessary to avoid massive codegen bloat for PR38243 (Add modulo rotate support to LowerRotate).

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

5 years ago[DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are...
Alexey Bataev [Thu, 6 Dec 2018 16:25:35 +0000 (16:25 +0000)]
[DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are allowed.

Summary:
If the output of debug directives only is requested, we should drop
emission of ',debug' option from the target directive. Required for
supporting of nvprof profiler.

Reviewers: echristo

Subscribers: llvm-commits

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

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

5 years ago[GVN] Don't perform scalar PRE on GEPs
Alexandros Lamprineas [Thu, 6 Dec 2018 16:11:58 +0000 (16:11 +0000)]
[GVN] Don't perform scalar PRE on GEPs

Partial Redundancy Elimination of GEPs prevents CodeGenPrepare from
sinking the addressing mode computation of memory instructions back
to its uses. The problem comes from the insertion of PHIs, which
confuse CGP and make it bail.

I've autogenerated the check lines of an existing test and added a
store instruction to demonstrate the motivation behind this change.
The store is now using the gep instead of a phi.

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

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

5 years ago[DEBUGINFO, NVPTX]Emit last debugging directives.
Alexey Bataev [Thu, 6 Dec 2018 16:02:09 +0000 (16:02 +0000)]
[DEBUGINFO, NVPTX]Emit last debugging directives.

Summary:
We may end up with not emitted debug directives at the end of the module
emission. Patch fixes this problem emitting those last directives the
end of the module emission.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits

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

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

5 years agoDAGCombiner::visitINSERT_VECTOR_ELT - pull out repeated VT.getVectorNumElements(...
Simon Pilgrim [Thu, 6 Dec 2018 15:39:25 +0000 (15:39 +0000)]
DAGCombiner::visitINSERT_VECTOR_ELT - pull out repeated VT.getVectorNumElements(). NFCI.

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

5 years ago[NFC][AArch64] Split out backend features
Diogo N. Sampaio [Thu, 6 Dec 2018 15:39:17 +0000 (15:39 +0000)]
[NFC][AArch64] Split out backend features

This patch splits backend features currently
hidden behind architecture versions.

For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.

This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html

Reviewers: DavidSpickett, olista01, t.p.northover

Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio

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

--

It was reverted in rL348249 due a build bot failure in one of the
regression tests:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386

The problem seems to be that FileCheck behaves
different in windows and linux. This new patch
splits the test file in multiple,
and does more exact pattern matching attempting
to circumvent the issue.

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

5 years ago[ARM][NFC] Adding another test for armcgp
Sam Parker [Thu, 6 Dec 2018 15:13:44 +0000 (15:13 +0000)]
[ARM][NFC] Adding another test for armcgp

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

5 years agoAMDGPU: Generate VALU ThreeOp Integer instructions
Nicolai Haehnle [Thu, 6 Dec 2018 14:33:40 +0000 (14:33 +0000)]
AMDGPU: Generate VALU ThreeOp Integer instructions

Summary:
Original patch by: Fabian Wahlster <razor@singul4rity.com>

Change-Id: I148f692a88432541fad468963f58da9ddf79fac5

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, b-sumner, llvm-commits

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

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

5 years ago[AMDGPU] Partial revert of rL348371: Turn on the DPP combiner by default
Valery Pykhtin [Thu, 6 Dec 2018 14:20:02 +0000 (14:20 +0000)]
[AMDGPU] Partial revert of rL348371: Turn on the DPP combiner by default

Turn the combiner back off as there're failures until the issue is fixed.

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

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

5 years agoFix -Wcovered-switch-default warning. NFCI.
Simon Pilgrim [Thu, 6 Dec 2018 14:02:02 +0000 (14:02 +0000)]
Fix -Wcovered-switch-default warning. NFCI.

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

5 years agoRevert "[LoopSimplifyCFG] Delete dead in-loop blocks"
Ilya Biryukov [Thu, 6 Dec 2018 13:21:01 +0000 (13:21 +0000)]
Revert "[LoopSimplifyCFG] Delete dead in-loop blocks"

This reverts commit r348457.
The original commit causes clang to crash when doing an instrumented
build with a new pass manager. Reverting to unbreak our integrate.

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

5 years agoTest commit: Removed trailing space in .txt file.
Markus Lavin [Thu, 6 Dec 2018 13:20:27 +0000 (13:20 +0000)]
Test commit: Removed trailing space in .txt file.

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

5 years ago[ARM][NFC] Added extra arm-cgp test
Sam Parker [Thu, 6 Dec 2018 12:58:58 +0000 (12:58 +0000)]
[ARM][NFC] Added extra arm-cgp test

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

5 years ago[X86][NFC] Convert memcpy/memset tests to update_llc_test_checks.
Clement Courbet [Thu, 6 Dec 2018 10:07:12 +0000 (10:07 +0000)]
[X86][NFC] Convert memcpy/memset tests to update_llc_test_checks.

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

5 years ago[ARM GlobalISel] Nothing is legal for Thumb
Diana Picus [Thu, 6 Dec 2018 09:26:14 +0000 (09:26 +0000)]
[ARM GlobalISel] Nothing is legal for Thumb

...yet!

A lot of the current code should be shared for arm and thumb mode, but
until we add tests and work out some of the details (e.g. checking the
correct subtarget feature for G_SDIV) it's safer to bail out as early as
possible for thumb targets.

This should have arguably been part of r348347, which allowed Thumb
functions to be handled by the IR Translator.

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

5 years ago[X86][NFC] Add more tests for memset.
Clement Courbet [Thu, 6 Dec 2018 08:48:06 +0000 (08:48 +0000)]
[X86][NFC] Add more tests for memset.

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

5 years ago[llvm-dwarfdump] - Simplify the test case.
George Rimar [Thu, 6 Dec 2018 08:42:57 +0000 (08:42 +0000)]
[llvm-dwarfdump] - Simplify the test case.

The test was fully rewritten for simplification.

New test code was suggested by David Blaikie.

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

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

5 years ago[InstCombine] foldICmpWithLowBitMaskedVal(): don't miscompile -1 vector elts
Roman Lebedev [Thu, 6 Dec 2018 08:14:24 +0000 (08:14 +0000)]
[InstCombine] foldICmpWithLowBitMaskedVal(): don't miscompile -1 vector elts

I was finally able to quantify what i thought was missing in the fix,
it was vector constants. If we have a scalar (and %x, -1),
it will be instsimplified before we reach this code,
but if it is a vector, we may still have a -1 element.

Thus, we want to avoid the fold if *at least one* element is -1.
Or in other words, ignoring the undef elements, no sign bits
should be set. Thus, m_NonNegative().

A follow-up for rL348181
https://bugs.llvm.org/show_bug.cgi?id=39861

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

5 years ago[NFC][InstCombine] Add more miscompile tests for foldICmpWithLowBitMaskedVal()
Roman Lebedev [Thu, 6 Dec 2018 08:11:20 +0000 (08:11 +0000)]
[NFC][InstCombine] Add more miscompile tests for foldICmpWithLowBitMaskedVal()

We also have to me aware of vector constants. If at least one element
is -1, we can't transform.

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

5 years ago[X86] Remove some leftover code for handling an i1 setcc type. NFC
Craig Topper [Thu, 6 Dec 2018 07:00:02 +0000 (07:00 +0000)]
[X86] Remove some leftover code for handling an i1 setcc type. NFC

We should only need to handle i8 now.

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

5 years ago[LoopSimplifyCFG] Delete dead in-loop blocks
Max Kazantsev [Thu, 6 Dec 2018 05:45:02 +0000 (05:45 +0000)]
[LoopSimplifyCFG] Delete dead in-loop blocks

This patch teaches LoopSimplifyCFG to delete loop blocks that have
become unreachable after terminator folding has been done.

Differential Revision: https://reviews.llvm.org/D54023
Reviewed By: anna

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

5 years agoInstCombine: Add some missing tests for scalarization
Matt Arsenault [Thu, 6 Dec 2018 03:32:50 +0000 (03:32 +0000)]
InstCombine: Add some missing tests for scalarization

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

5 years ago[llvm-objcopy] Change --only-keep to --only-section
Jake Ehrlich [Thu, 6 Dec 2018 02:03:53 +0000 (02:03 +0000)]
[llvm-objcopy] Change --only-keep to --only-section

I just hard core goofed when I wrote this and created a different name
for no good reason. I'm failry aware of most "fresh" users of llvm-objcopy
(that is, users which are not using it as a drop in replacement for GNU
objcopy) and can say that only "-j" is being used by such people so this
patch should strictly increase compatibility and not remove it.

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

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

5 years agoAArch64: Fix invalid CCMP emission
Matthias Braun [Thu, 6 Dec 2018 01:40:23 +0000 (01:40 +0000)]
AArch64: Fix invalid CCMP emission

The code emitting AND-subtrees used to check whether any of the operands
was an OR in order to figure out if the result needs to be negated.
However the OR could be hidden in further subtrees and not immediately
visible.

Change the code so that canEmitConjunction() determines whether the
result of the generated subtree needs to be negated. Cleanup emission
logic to use this. I also changed the code a bit to make all negation
decisions early before we actually emit the subtrees.

This fixes http://llvm.org/PR39550

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

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

5 years agoAdd objc.* ARC intrinsics and codegen them to their runtime methods.
Pete Cooper [Thu, 6 Dec 2018 00:52:54 +0000 (00:52 +0000)]
Add objc.* ARC intrinsics and codegen them to their runtime methods.

Reviewers: erik.pilkington, ahatanak

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

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

5 years ago[MachineOutliner][NFC] Move yet another std::vector out of a loop
Jessica Paquette [Thu, 6 Dec 2018 00:26:21 +0000 (00:26 +0000)]
[MachineOutliner][NFC] Move yet another std::vector out of a loop

Once again, following the wisdom of the LLVM Programmer's Manual.

I think that's enough refactoring for today. :)

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

5 years ago[MachineOutliner][NFC] Move std::vector out of loop
Jessica Paquette [Thu, 6 Dec 2018 00:04:03 +0000 (00:04 +0000)]
[MachineOutliner][NFC] Move std::vector out of loop

See http://llvm.org/docs/ProgrammersManual.html#vector

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

5 years ago[MachineOutliner][NFC] Remove IntegerInstructionMap from InstructionMapper
Jessica Paquette [Thu, 6 Dec 2018 00:01:51 +0000 (00:01 +0000)]
[MachineOutliner][NFC] Remove IntegerInstructionMap from InstructionMapper

Refactoring.

This map was only used when we used a string of integers to output the outlined
sequence. Since it's no longer used for anything, there's no reason to keep it
around.

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

5 years ago[GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.
Amara Emerson [Wed, 5 Dec 2018 23:53:30 +0000 (23:53 +0000)]
[GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.

These opcodes are intended to subsume some of the capability of G_MERGE_VALUES,
as it was too powerful and thus complex to add deal with throughout the GISel
pipeline.

G_BUILD_VECTOR creates a vector value from a sequence of uniformly typed
scalar values. G_BUILD_VECTOR_TRUNC is a special opcode for handling scalar
operands which are larger than the destination vector element type, and
therefore does an implicit truncate.

G_CONCAT_VECTOR creates a vector by concatenating smaller, uniformly typed,
vectors together.

These will be used in a subsequent commit. This commit just adds the initial
infrastructure.

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

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

5 years ago[MachineOutliner][NFC] Remove buildCandidateList and replace with findCandidates
Jessica Paquette [Wed, 5 Dec 2018 23:39:07 +0000 (23:39 +0000)]
[MachineOutliner][NFC] Remove buildCandidateList and replace with findCandidates

More refactoring.

Since the pruning logic has changed, and the candidate list is gone,
everything can be sunk into findCandidates.

We no longer need to keep track of the length of the longest substring, so we
can drop all of that logic as well.

After this, we just find all of the candidates and move to outlining.

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

5 years ago[MachineOutliner][NFC] Candidates don't need to be shared_ptrs anymore
Jessica Paquette [Wed, 5 Dec 2018 23:24:22 +0000 (23:24 +0000)]
[MachineOutliner][NFC] Candidates don't need to be shared_ptrs anymore

More refactoring.

After the changes to the pruning logic, and removing CandidateList, there's
no reason for Candiates to be shared_ptrs (or pointers at all).

std::shared_ptr<Candidate> -> Candidate.

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

5 years agoRevert r347934 "[SCEV] Guard movement of insertion point for loop-invariants"
David L. Jones [Wed, 5 Dec 2018 23:13:50 +0000 (23:13 +0000)]
Revert r347934 "[SCEV] Guard movement of insertion point for loop-invariants"

This change caused SEGVs in instcombine. (The r347934 change seems to me to be a
precipitating cause, not a root cause. Details are on the llvm-commits thread
for r347934.)

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

5 years ago[WebAssembly] Change event section code to 13
Heejin Ahn [Wed, 5 Dec 2018 23:10:09 +0000 (23:10 +0000)]
[WebAssembly] Change event section code to 13

Summary:
We decided to change the event section code from 12 to 13 as new
`DataCount` section in the bulk memory operations proposal will take the
code 12 instead.

Reviewers: sbc100

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

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

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

5 years ago[InstCombine] remove dead code from visitExtractElement
Sanjay Patel [Wed, 5 Dec 2018 23:09:33 +0000 (23:09 +0000)]
[InstCombine] remove dead code from visitExtractElement

Extracting from a splat constant is always handled by InstSimplify.
Move the test for this from InstCombine to InstSimplify to make
sure that stays true.

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

5 years ago[MachineOutliner][NFC] Remove CandidateList, since it's now unused.
Jessica Paquette [Wed, 5 Dec 2018 22:50:26 +0000 (22:50 +0000)]
[MachineOutliner][NFC] Remove CandidateList, since it's now unused.

After removing the pruning logic, there's no reason to populate a list of
Candidates. Remove CandidateList and update comments.

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

5 years agoFix buildbot capture warning
Jessica Paquette [Wed, 5 Dec 2018 22:47:25 +0000 (22:47 +0000)]
Fix buildbot capture warning

A bot didn't like my lambda. This ought to fix it.

Example:

http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/30139/steps/build%20lld/logs/stdio

error C3493: 'AlreadyRemoved' cannot be implicitly captured because no default
capture mode has been specified

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

5 years ago[MachineOutliner][NFC] Simplify and unify pruning/outlining logic
Jessica Paquette [Wed, 5 Dec 2018 22:27:38 +0000 (22:27 +0000)]
[MachineOutliner][NFC] Simplify and unify pruning/outlining logic

Since we're now performing outlining per OutlinedFunction rather than per
Candidate, we can simply outline each candidate as it shows up.

Instead of having a pruning phase, instead, we'll outline entire functions.
Then we'll update the UnsignedVec we mapped to reflect the deletion. If any
candidate is in a space that's marked dirty, then we'll drop it.

This lets us remove the pruning logic entirely, and greatly simplifies the
code.

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

5 years ago[InstCombine] reduce duplication in visitExtractElementInst; NFC
Sanjay Patel [Wed, 5 Dec 2018 21:57:51 +0000 (21:57 +0000)]
[InstCombine] reduce duplication in visitExtractElementInst; NFC

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

5 years ago[InstCombine] add/move tests for extractelement; NFC
Sanjay Patel [Wed, 5 Dec 2018 21:56:13 +0000 (21:56 +0000)]
[InstCombine] add/move tests for extractelement; NFC

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

5 years agoThinLTO: Do not import debug info for imported global constants
David Blaikie [Wed, 5 Dec 2018 21:42:17 +0000 (21:42 +0000)]
ThinLTO: Do not import debug info for imported global constants

It looks like this isn't necessary (in any tests I've done, it results
in the global being described with no location or value in the imported
side - while it's still fully described in the place it's imported from)
& results in significant/pathological debug info growth to home these
location-less global variable descriptions on the import side.

This is a rather pressing/important issue to address - this regressed
executable size for one example I'm looking at by 15%, object size is probably
similar though I haven't measured it, and a 22x increase in the number of CUs
in the cu_index in split DWARF DWP files, creating a similarly large regression
in the time it takes llvm-symbolizer to run on such binaries.

Reviewers: tejohnson, evgeny777

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

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

5 years ago[MachineOutliner] Outline functions by order of benefit
Jessica Paquette [Wed, 5 Dec 2018 21:36:04 +0000 (21:36 +0000)]
[MachineOutliner] Outline functions by order of benefit

Mostly NFC, only change is the order of outlined function names.

Loop over the outlined functions instead of walking the candidate list.

This is a bit easier to understand. It's far more natural to create a function,
then replace all of its occurrences with calls than the other way around.

The functions outlined after this do not change, but their names will be
decided by their benefit. E.g, OUTLINED_FUNCTION_0 will now always be the
most beneficial function, rather than the first one seen.

This makes it easier to enforce an ordering on the outlined functions. So,
this also adds a test to make sure that the ordering works as expected.

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

5 years ago[Hexagon] Add intrinsics for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:14:51 +0000 (21:14 +0000)]
[Hexagon] Add intrinsics for Hexagon V66

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

5 years ago[Hexagon] Add instruction definitions for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:01:07 +0000 (21:01 +0000)]
[Hexagon] Add instruction definitions for Hexagon V66

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

5 years ago[Hexagon] Foundation of support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 20:18:09 +0000 (20:18 +0000)]
[Hexagon] Foundation of support for Hexagon V66

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

5 years ago[GISel]: Provide standard interface to observe changes in GISel passes
Aditya Nandakumar [Wed, 5 Dec 2018 20:14:52 +0000 (20:14 +0000)]
[GISel]: Provide standard interface to observe changes in GISel passes

https://reviews.llvm.org/D54980

This provides a standard API across GISel passes to observe and notify
passes about changes (insertions/deletions/mutations) to MachineInstrs.
This patch also removes the recordInsertion method in MachineIRBuilder
and instead provides method to setObserver.

Reviewed by: vkeles.

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

5 years ago[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn
Vedant Kumar [Wed, 5 Dec 2018 19:35:37 +0000 (19:35 +0000)]
[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn

Treat terminators which resume exception propagation as returning instructions
(at least, for the purposes of marking outlined functions `noreturn`). This is
to avoid inserting traps after calls to outlined functions which unwind.

rdar://46129950

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

5 years ago[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors
Simon Pilgrim [Wed, 5 Dec 2018 19:32:19 +0000 (19:32 +0000)]
[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors

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

5 years ago[AArch64] Reword description of feature (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:42:57 +0000 (18:42 +0000)]
[AArch64] Reword description of feature (NFC)

Reword the description of the feature that enables custom handling of cheap
instructions.

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

5 years ago[llvm-mca] Simplify test (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:34:51 +0000 (18:34 +0000)]
[llvm-mca] Simplify test (NFC)

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

5 years ago[llvm-mca] Sort test run lines (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:30:06 +0000 (18:30 +0000)]
[llvm-mca] Sort test run lines (NFC)

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

5 years ago[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()
Jessica Paquette [Wed, 5 Dec 2018 18:17:40 +0000 (18:17 +0000)]
[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()

Some more gardening.

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

5 years ago[MachineOutliner][NFC] Make getters in MachineOutliner.h const
Jessica Paquette [Wed, 5 Dec 2018 18:12:52 +0000 (18:12 +0000)]
[MachineOutliner][NFC] Make getters in MachineOutliner.h const

Just some refactoring. A few of the getters in OutlinedFunction weren't const.

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

5 years ago[MachineOutliner][NFC] Don't create outlined sequence from integer mapping
Jessica Paquette [Wed, 5 Dec 2018 17:57:33 +0000 (17:57 +0000)]
[MachineOutliner][NFC] Don't create outlined sequence from integer mapping

Some gardening/refactoring.

It's cleaner to copy the instructions into the MachineFunction using the first
candidate instead of going to the mapper.

Also, by doing this we can remove the Seq member from OutlinedFunction entirely.

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

5 years ago[gold-plugin] allow function/data sections to be toggleable
Nick Desaulniers [Wed, 5 Dec 2018 17:46:24 +0000 (17:46 +0000)]
[gold-plugin] allow function/data sections to be toggleable

Summary:
r336838 allowed these to be toggleable.
r336858 reverted r336838.
r336943 made the generation of these sections conditional on LDPO_REL.

This commit brings back the toggle-ability.  You can specify:
-plugin-opt=-function-sections
-plugin-opt=-data-sections
For your linker flags to disable the changes made in r336943.

Without toggling r336943 off, arm64 linux kernels linked with gold-plugin
see significant boot time regressions, but with r336943 outright reverted
x86_64 linux kernels linked with gold-plugin fail to boot.

Reviewers: pcc, void

Reviewed By: pcc

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

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

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

5 years agoAMDGPU: Fix using old address spaces in some tests
Matt Arsenault [Wed, 5 Dec 2018 17:34:59 +0000 (17:34 +0000)]
AMDGPU: Fix using old address spaces in some tests

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

5 years ago[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)
Sanjay Patel [Wed, 5 Dec 2018 17:10:30 +0000 (17:10 +0000)]
[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)

Because we're potentially peeking through a bitcast in this transform,
we need to use overall bitwidths rather than number of elements to
determine when it's safe to proceed.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=39893

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