142452 Commits

Author SHA1 Message Date
Adrian Prantl
7766e56d48 Revert "[IR] Remove the DIExpression field from DIGlobalVariable."
This reverts commit 289902 while investigating bot berakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 01:00:30 +00:00
Tim Shen
1254a59640 [APFloatTest] Log when test fails. NFC
Reviewers: iteratee

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 00:47:17 +00:00
Peter Collingbourne
61009a6337 Add missing library dep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 00:43:00 +00:00
Adrian Prantl
1b11b0778e [IR] Remove the DIExpression field from DIGlobalVariable.
This patch implements PR31013 by introducing a
DIGlobalVariableExpression that holds a pair of DIGlobalVariable and
DIExpression.

Currently, DIGlobalVariables holds a DIExpression. This is not the
best way to model this:

(1) The DIGlobalVariable should describe the source level variable,
    not how to get to its location.

(2) It makes it unsafe/hard to update the expressions when we call
    replaceExpression on the DIGLobalVariable.

(3) It makes it impossible to represent a global variable that is in
    more than one location (e.g., a variable with multiple
    DW_OP_LLVM_fragment-s).  We also moved away from attaching the
    DIExpression to DILocalVariable for the same reasons.

<rdar://problem/29250149>
https://llvm.org/bugs/show_bug.cgi?id=31013
Differential Revision: https://reviews.llvm.org/D26769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 00:36:43 +00:00
Ehsan Amiri
c0621296d3 [PPC] corrections in two testcases
Removing sensitivity to scheduling (by using CHECK-DAG instead of CHECK) and
some other minor corrections.

In preparation to commit Power9 processor model.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 00:33:07 +00:00
Peter Collingbourne
d150401278 IPO: Introduce ThinLTOBitcodeWriter pass.
This pass prepares a module containing type metadata for ThinLTO by splitting
it into regular and thin LTO parts if possible, and writing both parts to
a multi-module bitcode file. Modules that do not contain type metadata are
written unmodified as a single module.

All globals with type metadata are added to the regular LTO module, and
the rest are added to the thin LTO module.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 00:26:30 +00:00
Evandro Menezes
339deb4b87 [AArch64] Add FeatureSlowMisaligned128Store to Exynos M1 and M2
This feature now gates such stores after r289845.  Thus the Exynos
processors now need this feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 00:18:00 +00:00
Teresa Johnson
731ad19baa [ThinLTO] Thin link efficiency improvement: don't re-export globals (NFC)
Summary:
We were reinvoking exportGlobalInModule numerous times redundantly.
No need to re-export globals referenced by a global that was already
imported from its module. This resulted in a large speedup in the thin
link for a big application, particularly when importing aggressiveness
was cranked up.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:50:06 +00:00
Davide Italiano
7a05aeb9e2 [SimplifyLibCalls] Add a test to make sure we lower fls(0) correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:48:07 +00:00
Davide Italiano
d956fc2438 [SimplifyLibCalls] Lower fls() to llvm.ctlz().
Differential Revision:  https://reviews.llvm.org/D14590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:45:11 +00:00
David Blaikie
e5d21034bc DebugInfo: Make a Generic test case actually generic (remove datalayout/triple)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:39:25 +00:00
David Blaikie
ce7273ec4b DebugInfo: Address non-deterministic output (iterating a SmallPtrSet) in 289697
Post-commit review feedback from Adrian Prantl.

Hopefully this fixes that up :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:37:38 +00:00
Quentin Colombet
e886ddf8d4 [IRTranslator] Merge the entry and ABI lowering blocks.
The IRTranslator uses an additional block before the LLVM-IR entry block
to perform all the ABI lowering and the constant hoisting. Thus, this
block is the actual entry block and it falls through the LLVM-IR entry
block. However, with such representation, we end up with two basic
blocks that are not maximal.

Therefore, this patch adds a bit of canonicalization by merging both the
LLVM-IR entry block and the ABI lowering/constants hoisting into one
block, making the resulting block more likely to be maximal (indeed the
LLVM-IR entry block might not have been maximal).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:32:25 +00:00
David Blaikie
ae8181cee7 DebugInfo: Emit ranges for functions with DISubprograms but lacking locations on any instructions
This seems more consistent, and helps tidy up/simplify some other code
in this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:17:52 +00:00
Davide Italiano
30983dc098 [SimplifyLibCalls] Remove redundant folding logic for ffs().
Lowering to llvm.cttz() will result in constant folding anyway
if the argument to ffs is a constant. Pointed out by Eli for
fls() in D14590.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 23:11:00 +00:00
Eli Friedman
986e6724ba Don't combine splats with other shuffles.
We sometimes end up creating shuffles which are worse than the obvious
translation of the IR.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 22:41:40 +00:00
Yichao Yu
e012a3d747 Fix R_AARCH64_MOVW_UABS_G3 relocation
Summary: The relocation is missing mask so an address that has non-zero bits in 47:43 may overwrite the register number. (Frequently shows up as target register changed to `xzr`....)

Reviewers: t.p.northover, lhames

Subscribers: davide, aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 22:36:53 +00:00
Matt Arsenault
0b698fea77 AMDGPU: Select branch on undef to uniform scc branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 21:57:11 +00:00
Teresa Johnson
97e27342c0 [gold] Add datalayout to test where it was missing
Needed due to change to require datalayout (r289719).

Found this in my own testing, maybe there aren't any bots using a v1.12
gold yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 21:42:56 +00:00
Teresa Johnson
6a48d2eaa3 [ThinLTO] Revert part of r289843 that belonged to another patch.
The code change for D27687 accidentally got committed along with the
main change in r289843. Revert it temporarily, so that I can recommit it
along with its test as intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 21:39:42 +00:00
Eli Friedman
259f5fb782 Don't combine a shuffle of two BUILD_VECTORs with duplicate elements.
Targets can't handle this case well in general; we often transform
a shuffle of two cheap BUILD_VECTORs to element-by-element insertion,
which is very inefficient.

Fixes https://llvm.org/bugs/show_bug.cgi?id=31364 . Partially
fixes https://llvm.org/bugs/show_bug.cgi?id=31301.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 21:36:59 +00:00
Sanjoy Das
8cf1000f92 [Verifier] Allow TBAA metadata on atomicrmw and atomiccmpxchg
This used to be allowed before r289402 by default (before r289402 you
could have TBAA metadata on any instruction), and while I'm not sure
that it helps, it does sound reasonable enough to not fail the verifier
and we have out-of-tree users who use this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 21:23:44 +00:00
Teresa Johnson
70b49e61fb [ThinLTO] Remove stale comment (NFC)
This should have been removed with r288446.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:53:31 +00:00
Ehsan Amiri
9ee618f860 [PPC] Use CHECK-DAG instead of CHECK in the testcase
This test is currently sensitive to scheduling. Using CHECK-DAG allows us to
preserve the main purpose of the test and remove this sensivity.

In preparation to commit Power9 processor model.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289869 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:51:09 +00:00
Matt Arsenault
56f1e4a76b AMDGPU: Fix asserting on returned tail calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:50:12 +00:00
Teresa Johnson
de94ece810 [ThinLTO] Thin link efficiency: skip candidate added later with higher threshold (NFC)
Summary:
Thin link efficiency improvement. After adding an importing candidate to
the worklist we might have later added it again with a higher threshold.
Skip it when popped from the worklist if we recorded a higher threshold
than the current worklist entry, it will get processed again at the
higher threshold when that entry is popped.

This required adding the summary's GUID to the worklist, so that it can
be used to query the recorded highest threshold for it when we pop from the
worklist.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:48:19 +00:00
Matt Arsenault
31f86653e9 AMDGPU: Assembler support for vintrp instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:40:20 +00:00
Matthew Simpson
f977c2b26d [LV] Enable vectorization of loops with conditional stores by default
This patch sets the default value of the "-enable-cond-stores-vec" command line
option to "true".

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:11:05 +00:00
Andrea Di Biagio
84ecaa6c56 [SimplifyCFG] Merge debug locations when hoisting an instruction from a then/else branch. NFC.
Now that a new API to merge debug locations has been committed at r289661 (see
review D26256 for more details), we can use it to "improve" the code added by
revision r280995.

Instead of nulling the debugloc of a commoned instruction, we use the 'merged'
debug location. At the moment, this is just a no functional change since
function `DILocation::getMergedLocation()` is just a stub and would always
return a null location.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 20:01:26 +00:00
Geoff Berry
f192c5da47 [LiveRangeEdit] Change eliminateDeadDef assert to if condition.
The assert could potentially fire (though no cases have been
encountered), so just check that the instruction we're handling
specially for rematerialization only has one def to begin with.

Reviewed by Wei Mi over email.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:55:19 +00:00
Peter Collingbourne
fa552fc861 LibDriver: Allow resource files to be archive members.
It seems pointless to add a resource to an archive because it won't have
any symbols to link against (and link.exe doesn't have an equivalent of
--whole-archive), but lib.exe allows it for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:37:46 +00:00
Zachary Turner
3e57787cab Re-add the check for __has_attribute in StringLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:33:31 +00:00
Boris Ulasevich
0eeb59d037 BrainF example: fixing segfault caused by outdated code with missing MCJIT dependency
Differential Revision: https://reviews.llvm.org/D26280

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:29:42 +00:00
Zachary Turner
3ed425b164 Ignore -Wgcc-compat diagnostic in StringLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:22:58 +00:00
Sanjay Patel
8ca87b1e6e [InstCombine] add folds for icmp (smin X, Y), X
Min/max canonicalization (r287585) exposes the fact that we're missing combines for min/max patterns. 
This patch won't solve the example that was attached to that thread, so something else still needs fixing.

The line between InstCombine and InstSimplify gets blurry here because sometimes the icmp instruction that
we want to fold to already exists, but sometimes it's the swapped form of what we want.

Corresponding changes for smax/umin/umax to follow.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:13:37 +00:00
Reid Kleckner
36850aafe2 Fix some remaining documentation references to MSVC 2013
MSVC 2015 has been the minimum supported version of VS since October.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:08:02 +00:00
Zachary Turner
18e2348b67 [StringRef] Add enable-if to StringLiteral.
to prevent StringLiteral from being created with a non-literal
char array, clang has a macro enable_if() that can be used
in such a way as to guarantee that the constructor is disabled
unless the length fo the string can be computed at compile time.

This only works on clang, but at least it should allow bots
to catch abuse of StringLiteral.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:02:43 +00:00
Kostya Serebryany
94ab0f2699 [libFuzzer] doc update
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:47:22 +00:00
Ahmed Bougacha
d834e0854a [GlobalISel] Drop workaround for Legalizer member/class sharing a name. NFC.
MachineLegalizer used to be the name of both the class and the member,
causing GCC errors. r276522 fixed that by renaming the member to just
'Legalizer'.  The 'class' workaround isn't necessary anymore; drop it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:45:30 +00:00
Sanjay Patel
b782ce76a4 [x86] use a single shufps for 256-bit vectors when it can save instructions
This is the 256-bit counterpart to the 128-bit transform checked in here:
https://reviews.llvm.org/rL289837

This patch is based on the draft by @sroland (Roland Scheidegger) that is
attached to PR27885:
https://llvm.org/bugs/show_bug.cgi?id=27885



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:43:46 +00:00
Matthew Simpson
ad1bdf6350 [AArch64] Guard Misaligned 128-bit store penalty by subtarget feature
This patch checks that the SlowMisaligned128Store subtarget feature is set
when penalizing such stores in getMemoryOpCost.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:36:59 +00:00
Ahmed Bougacha
13061e3ece [AArch64][GlobalISel] Remove redundant RBI comments. NFC.
It's brittle, and Doxygen already picks the overriden method's comment
anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:22:15 +00:00
Teresa Johnson
260d27c8d8 [ThinLTO] Ensure callees get hot threshold when first seen on cold path
This is split out from D27696, since it turned out to be a bug fix and
not part of the NFC efficiency change.

Keep the same adjusted (possibly decayed) threshold in both the worklist
and the ImportList. Otherwise if we encountered it first along a cold
path, the callee would be added to the worklist with a lower decayed
threshold than when it is later encountered along a hot path. But the
logic uses the threshold recorded in the ImportList entry to check if
we should re-add it, and without this patch the threshold recorded there
is the same along both paths so we don't re-add it. Using the
same possibly decayed threshold in the ImportList ensures we re-add it
later with the higher non-decayed hot path threshold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:21:01 +00:00
Chris Bieneman
69a678c244 [CMake] Minor change to symlink generation for LLDB
If OUTPUT_DIR is not specified we can assume the symlink is linking to a file in the same directory, so we can use $<TARGET_FILE_NAME:${target}> to create a relative symlink.

In the case of LLDB, when we build a framework, we are creating symlinks in a different directory than the file we're pointing to, and we don't install those links. To make this work in the build directory we can use $<TARGET_FILE:${target}> instead, which uses the full path to the target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:17:07 +00:00
Sanjay Patel
b10a96eb1c [x86] use a single shufps when it can save instructions
This is a tiny patch with a big pile of test changes.
This partially fixes PR27885:
https://llvm.org/bugs/show_bug.cgi?id=27885

My motivating case looks like this:

  - vpshufd {{.*#+}} xmm1 = xmm1[0,1,0,2]
  - vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
  - vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]

  + vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]

And this happens several times in the diffs. For chips with domain-crossing penalties,
the instruction count and size reduction should usually overcome any potential 
domain-crossing penalty due to using an FP op in a sequence of int ops. For chips such
as recent Intel big cores and Atom, there is no domain-crossing penalty for shufps, so
using shufps is a pure win.

So the test case diffs all appear to be improvements except one test in 
vector-shuffle-combining.ll where we miss an opportunity to use a shift to generate 
zero elements and one test in combine-sra.ll where multiple uses prevent the expected
shuffle combining.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:03:38 +00:00
Simon Pilgrim
6677747efb [X86][SSE] Fix domains for scalar store instructions
As discussed on D27692

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 17:09:24 +00:00
Robert Lougher
bdaef54463 Revert "[SimplifyCFG] In sinkLastInstruction correctly set debugloc of common inst"
Reverting as it is causing buildbot failures (address sanitizer).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 16:59:13 +00:00
Jacques Pienaar
de365874b0 [lanai] Simplify small section check in LowerGlobalAddress and treat ldata sections specially.
Move the check for the code model into isGlobalInSmallSectionImpl and return false (not in small section) for variables placed in sections prefixed with .ldata (workaround for a tool limitation).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 16:56:16 +00:00
Simon Pilgrim
fb4f51ede1 [X86][AVX512] Moved instruction domain lookups to the right table. NFCI.
Avoid duplicating instructions in the int32/int64 domains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 16:38:51 +00:00
Robert Lougher
9fc6de78fb [SimplifyCFG] In sinkLastInstruction correctly set debugloc of "common" inst
Simplify CFG will try to sink the last instruction in a series of basic blocks,
creating a "common" instruction in the successor block (sinkLastInstruction).
When it does this, the debug location of the single instruction should be the
merged debug locations of the commoned instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 16:17:53 +00:00