142816 Commits

Author SHA1 Message Date
Craig Topper
be3e531ac2 [AVX-512] Remove vextract intrinsics and autoupgrade to native shufflevectors. This unfortunately generates some really terrible code without VLX support due to v2i1 and v4i1 not being legal.
Hopefully we can improve that in future patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 05:45:46 +00:00
Matt Arsenault
f61ad6ec11 InstCombine: Add fma with constant transforms
DAGCombine already does these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 04:32:35 +00:00
Matt Arsenault
ef6bacf05a InstCombine: Add fma + fabs/fneg transforms
fma (fneg x), (fneg y), z -> fma x, y, z
fma (fabs x), (fabs x), z -> fma x, x, z

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 04:32:31 +00:00
Dean Michael Berris
87ff4c129a [XRay] Merge instrumentation point table emission code into AsmPrinter.
Summary:
No need to have this per-architecture.  While there, unify 32-bit ARM's
behaviour with what changed elsewhere and start function names lowercase
as per the coding standards.  Individual entry emission code goes to the
entry's own class.

Fully tested on amd64, cross-builds on both ARMs and PowerPC.

Reviewers: dberris

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 04:30:21 +00:00
Sanjay Patel
0d837408ba [EarlyCSE] less else, more auto; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 00:16:24 +00:00
Sanjay Patel
aa2de25b71 [InstCombine] use combineMetadataForCSE instead of copying it; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 23:25:28 +00:00
Chris Bieneman
677ee43225 [CMake] Set HAVE_${runtime} before including any subdirectories
This should allow us to avoid most order dependence in the runtime library configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 20:33:33 +00:00
Xin Tong
059fad8157 Make sure total loop body weight is preserved in loop peeling
Summary:
Regardless how the loop body weight is distributed, we should preserve
total loop body weight. i.e. we should have same weight reaching the body of the loop
or its duplicates in peeled and unpeeled case.

Reviewers: mkuper, davidxl, anemet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 20:27:23 +00:00
Michal Gorny
12ec8e1ce1 [cmake] Normalize LLVM_ENABLE_DIA_SDK to fix Windows tests
Attempts to fix Windows build breakage caused by r290818.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 20:22:45 +00:00
Daniel Berlin
03a167d742 NewGVN: Add a test case for equivalent phis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 19:55:13 +00:00
Daniel Berlin
4e6bfe2c74 NewGVN: Add forgotten testcase for PR 31483
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 19:49:20 +00:00
Daniel Berlin
34eb5e17b1 NewGVN: Clean up after removing possibility of null expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 19:49:17 +00:00
Sanjay Patel
0e0f143f17 fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 19:05:11 +00:00
Sanjay Patel
a7588d676e [ValueTracking] remove stale comments; NFC
The checks were improved with:
https://reviews.llvm.org/rL290194


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 19:04:07 +00:00
Davide Italiano
99835fb9ad [NewGVN] Fold single-use variable inside the assertion.
It placates some bots which complain because they compile the
assertion out and think the variable is unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 19:03:16 +00:00
Davide Italiano
ad8be6892b [NewGVN] Restore old code to placate buildbots.
Apparently my suggestion of using ternary doesn't really work
as clang complains about incompatible types on LHS and RHS. Some
GCC versions happen to accept the code but clang behaviour is
correct here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:41:34 +00:00
Daniel Berlin
dcdec3c8b2 NewGVN: Fix some formatting and comment issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290820 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:22:38 +00:00
Michal Gorny
a50b783ab7 [cmake] Add LLVM_ENABLE_DIA_SDK option, and expose it in LLVMConfig
Add an explicit LLVM_ENABLE_DIA_SDK option to control building support
for DIA SDK-based debugging. Control its value to match whether DIA SDK
support was found and expose it in LLVMConfig (alike LLVM_ENABLE_ZLIB).

Its value is needed for LLDB to determine whether to run tests requiring
DIA support. Currently it is obtained from llvm/Config/config.h;
however, this file is not available for standalone builds. Following
this change, LLDB will be modified to use the value from LLVMConfig.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:19:35 +00:00
Joerg Sonnenberger
9af2e4eb39 Emit .cfi_sections before the first .cfi_startproc
GNU as rejects input where .cfi_sections is used after .cfi_startproc,
if the new section differs from the old. Adjust our output to always
emit .cfi_sections before the first .cfi_startproc to minimize necessary
code.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:05:27 +00:00
Daniel Berlin
2c8e9c4003 NewGVN: Add UnknownExpression and create them for things we can't symbolize. Kill fragile machinery for handling null expressions.
Summary:
This avoids the very fragile code for null expressions. We could also use a denseset that tracks which things have null expressions instead, but that seems pretty fragile and premature optimization.

This resolves a number of infinite loop cases, test reductions coming.

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:00:53 +00:00
Daniel Berlin
61cf41cb39 NewGVN: Fix PR31480, PR31483, PR31499, by rewriting how memory congruence handling works.
Summary: Previously, we tried to fix up the equivalences during symbolic evaluation.  This does not work. Now, we change the equivalences during congruence finding, where it belongs.  We also initialize the equivalence table to give a maximal answer.

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:00:46 +00:00
Davide Italiano
85f8cbc9e3 [PMBuilder] Remove RunFloat2Int cl::opt.
The pass has been on by default for a long time without problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 17:49:18 +00:00
Elena Demikhovsky
6c207672d9 Fixed shuffle-reverse cost on AVX-512.
(This changed was approved in https://reviews.llvm.org/D28118, but Simon asked to submit it separately).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 11:44:10 +00:00
Elena Demikhovsky
c2b6a16ee9 AVX-512 Loop Vectorizer: Cost calculation for interleave load/store patterns.
X86 target does not provide any target specific cost calculation for interleave patterns.It uses the common target-independent calculation, which gives very high numbers. As a result, the scalar version is chosen in many cases. The situation on AVX-512 is even worse, since we have 3-src shuffles that significantly reduce the cost.

In this patch I calculate the cost on AVX-512. It will allow to compare interleave pattern with gather/scatter and choose a better solution (PR31426).

* Shiffle-broadcast cost will be changed in Simon's upcoming patch.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 10:37:52 +00:00
Keno Fischer
e345a27f2d Reapply "[CodeGen] Fix invalid DWARF info on Win64"
This reapplies rL289013 (reverted in rL289014) with the fixes identified
in D21731. Should hopefully pass the buildbots this time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 03:00:19 +00:00
Sanjay Patel
5b08d8331e [InstCombine] add explanatory comment to test; NFC
The test was added at r290797, and a patch to enable the transform is proposed in D28204.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-01 18:20:49 +00:00
Sanjay Patel
b3a13c4218 [InstCombine] add test to show potential nonnull attribute propagation; NFC
This will change with the current draft of:
https://reviews.llvm.org/D28204


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-01 17:18:00 +00:00
Florian Hahn
16f02040e6 [selectiondag] Check PromotedFloats map during expansive checks.
Summary:
`PromotedFloats` needs to be checked in 
`DAGTypeLegalizer::PerformExpensiveChecks`. This patch fixes a few type
legalization failures with expansive checks for ARM fp16 tests.

Reviewers: baldrick, bogner, arsenm

Subscribers: arsenm, aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290796 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-01 13:58:27 +00:00
Sanjoy Das
f67baf043f Fix an issue with isGuaranteedToTransferExecutionToSuccessor
I'm not sure if this was intentional, but today
isGuaranteedToTransferExecutionToSuccessor returns true for readonly and
argmemonly calls that may throw.  This commit changes the function to
not implicitly infer nounwind this way.

Even if we eventually specify readonly calls as not throwing,
isGuaranteedToTransferExecutionToSuccessor is not the best place to
infer that.  We should instead teach FunctionAttrs or some other such
pass to tag readonly functions / calls as nounwind instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 22:12:34 +00:00
Sanjoy Das
7fa928aca7 Avoid const_cast; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 22:12:31 +00:00
Sanjay Patel
981c81199d [ValueTracking] add tests for known-nonnull-at; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 19:23:26 +00:00
Sanjay Patel
a8cf343942 [Inliner] remove unnecessary null checks from AddAlignmentAssumptions(); NFCI
We bail out on the 1st line if the assumption cache is not set, so there's
no need to check it after that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 17:54:05 +00:00
Sanjay Patel
c6901e1685 [ValueTracking] make dominator tree requirement explicit for isKnownNonNullFromDominatingCondition(); NFCI
I don't think this hole is currently exposed, but I crashed regression tests for
jump-threading and loop-vectorize after I added calls to isKnownNonNullAt() in
InstSimplify as part of trying to solve PR28430:
https://llvm.org/bugs/show_bug.cgi?id=28430

That's because they call into value tracking with a context instruction, but no
other parts of the query structure filled in.

For more background, see the discussion in:
https://reviews.llvm.org/D27855


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 17:37:01 +00:00
Daniel Berlin
56516028d8 NewGVN: Print out DefiningAccess for both loads and stores when debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 07:34:36 +00:00
Philip Reames
c090423e15 [SmallPtrSet] Introduce a find primitive and rewrite count/erase in terms of it
This was originally motivated by a compile time problem I've since figured out how to solve differently, but the cleanup seemed useful. We had the same logic - which essentially implemented find - in several places. By commoning them out, I can implement find and allow erase to be inlined at the call sites if profitable.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 02:33:22 +00:00
Dylan McKay
3afd0d746d [AVR] Optimize 16-bit ANDs with '1'
Summary: Fixes PR 31345

Reviewers: dylanmckay

Subscribers: fhahn, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 01:07:14 +00:00
Craig Topper
67125e9fcc [InstCombine][AVX-512] Teach InstCombine that llvm.x86.avx512.vcomi.sd and llvm.x86.avx512.vcomi.ss don't use the upper elements of their input.
This was already done for the SSE/SSE2 version of the intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 00:45:06 +00:00
Craig Topper
0a26428c58 [InstCombine][AVX-512] When turning intrinsics with masking into native IR, don't emit a select if the mask is known to be all ones.
This saves InstCombine the burden of having to optimize the select later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 23:06:28 +00:00
Simon Pilgrim
0934969dbc [X86][AVX512DQ] Add truncated math tests for AVX512DQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 22:43:41 +00:00
Simon Pilgrim
50c0e28e08 [X86][SSE] Fix truncated math test names.
Inconsistent naming convention and wrong name for some input/output types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 22:40:32 +00:00
Simon Pilgrim
3ad66d322e [X86][AVX512] Regenerate test - missing shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 22:31:33 +00:00
Philip Reames
4194070c43 Add a comment for a todo in LoopUnroll post cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 22:10:19 +00:00
Philip Reames
ef2b74ac56 [LVI] Remove count/erase idiom in favor of checking result value of erase
Minor compile time win.  Avoids an additional O(N) scan in the case where we are removing an element and costs nothing when we aren't.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 22:09:10 +00:00
Florian Hahn
f4ae367c89 [doc] Clarify steps for contributors without commit access.
Summary: Update the Phabricator docs to clarify how changes are merged for contributors without commit access. 

Reviewers: delcypher, aaron.ballman

Subscribers: aaron.ballman, anmol, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 21:28:30 +00:00
Saleem Abdulrasool
1efac55b93 DebugInfo: change the PDB UniqueId type to uint8_t
Since we type-erase the Windows GUID structure, use unsigned bytes
rather than char, which may be signed (-fsigned-char).  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 19:42:13 +00:00
Piotr Padlewski
35f35d388e [MemDep] Handle gep with zeros for invariant.group
Summary:
gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it
to getelementptr because it make SROA can then handle it.

Simple case like

    void g(A &a) {
        z(a);
        if (glob)
            a.foo();
    }
    void testG() {
        A a;
        g(a);
    }

was not devirtualized with -fstrict-vtable-pointers because luck of
handling for gep 0 in Memory Dependence Analysis

Reviewers: dberlin, nlewycky, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 18:45:07 +00:00
Philip Reames
3c26327858 [CVP] Adjust iteration order to reduce the amount of work required
CVP doesn't care about the order of blocks visited, but by using a pre-order traversal over the graph we can a) not visit unreachable blocks and b) optimize as we go so that analysis of later blocks produce slightly more precise results.

I noticed this via inspection and don't have a concrete example which points to the issue.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 18:00:55 +00:00
Philip Reames
e0083004a2 [LVI] Manually hoist computation from loop
Minor compile time win.  Not known to be a hot spot, just something I noticed while reading.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 17:56:47 +00:00
Aaron Ballman
65985d046a Caught a simple typo. I do not know of a way to test this, but it seems like an unlikely thing to regress in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 15:57:56 +00:00
Davide Italiano
c37efe30b0 [NewGVN] Remove unneeded newline from assertion message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 15:01:17 +00:00