Commit Graph

8319 Commits

Author SHA1 Message Date
Tom Stellard e0af6c9240 Merging r283612:
------------------------------------------------------------------------
r283612 | davide | 2016-10-07 14:53:09 -0700 (Fri, 07 Oct 2016) | 5 lines

[InstCombine] Don't unpack arrays that are too large (part 2).

This is similar to r283599, but for store instructions.
Thanks to David for pointing out!

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28 21:35:41 +00:00
Tom Stellard 7e79c454db Merging r283599:
------------------------------------------------------------------------
r283599 | davide | 2016-10-07 13:57:42 -0700 (Fri, 07 Oct 2016) | 4 lines

[InstCombine] Don't unpack arrays that are too large

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28 21:35:40 +00:00
Tom Stellard 0cdf5eea7a Merging r281650:
------------------------------------------------------------------------
r281650 | david.majnemer | 2016-09-15 13:10:09 -0700 (Thu, 15 Sep 2016) | 6 lines

[InstCombine] Do not RAUW a constant GEP

canRewriteGEPAsOffset expects to process instructions, not constants.

This fixes PR30342.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28 21:25:53 +00:00
Tom Stellard 9496ac113a Merging r279980:
------------------------------------------------------------------------
r279980 | david.majnemer | 2016-08-29 10:14:08 -0700 (Mon, 29 Aug 2016) | 7 lines

[SimplifyCFG] Hoisting invalidates metadata

We forgot to remove optimization metadata when performing hosting during
FoldTwoEntryPHINode.

This fixes PR29163.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28 21:13:03 +00:00
Tom Stellard 1d63d1c34e Merging r279930:
------------------------------------------------------------------------
r279930 | elena.demikhovsky | 2016-08-28 01:53:53 -0700 (Sun, 28 Aug 2016) | 7 lines

[Loop Vectorizer] Fixed memory confilict checks.

Fixed a bug in run-time checks for possible memory conflicts inside loop.
The bug is in Low <-> High boundaries calculation. The High boundary
should be calculated as "last memory access pointer + element size".

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@287779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 17:26:28 +00:00
Tom Stellard ecc0989ad5 Merging r280143:
------------------------------------------------------------------------
r280143 | dberlin | 2016-08-30 12:58:48 -0700 (Tue, 30 Aug 2016) | 2 lines

IntrArgMemOnly is only defined (and current AA machinery only sanely supports) pointer arguments, and these intrinsics have vector of pointer arguments.  Remove ArgMemOnly until we either have the machinery, define a new attribute, or something similar

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@287777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 17:05:01 +00:00
Hans Wennborg d6c51ae2a9 Merging r283129:
------------------------------------------------------------------------
r283129 | hans | 2016-10-03 11:18:04 -0700 (Mon, 03 Oct 2016) | 6 lines

Jump threading: avoid trying to split edge into landingpad block (PR27840)

Splitting the edge is nontrivial because of the landing pad, and we would
currently assert trying to do it.

Differential Revision: https://reviews.llvm.org/D24680
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@286246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 16:38:34 +00:00
Hans Wennborg fbbabf3203 Merging r279647:
------------------------------------------------------------------------
r279647 | sanjoy | 2016-08-24 11:10:21 -0700 (Wed, 24 Aug 2016) | 5 lines

[SCCP] Don't delete side-effecting instructions

I'm not sure if the `!isa<CallInst>(Inst) &&
!isa<TerminatorInst>(Inst))` bit is correct either, but this fixes the
case we know is broken.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 23:46:52 +00:00
Hans Wennborg 3aa4a350b4 Merging r279268:
------------------------------------------------------------------------
r279268 | majnemer | 2016-08-19 09:37:40 -0700 (Fri, 19 Aug 2016) | 5 lines

[CloneFunction] Don't remove unrelated nodes from the CGSSC

CGSCC use a WeakVH to track call sites.  RAUW a call within a function
can result in that WeakVH getting confused about whether or not the call
site is still around.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 21:23:55 +00:00
Hans Wennborg 98e9ba6a0b Merging r279369 and update the test:
------------------------------------------------------------------------
r279369 | mssimpso | 2016-08-20 07:10:06 -0700 (Sat, 20 Aug 2016) | 1 line

[SLP] Add command line option for minimum tree size (NFC)
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 21:04:17 +00:00
Hans Wennborg a164239806 Fix gather-root.ll SLP vectorizer test to not expose UB.
The undefined behaviour (signed integer overflow) is not a regression
in itself as it was already there, but the test exposing it is a
regression compared to rc1, i.e. the lit tests no longer run ubsan-clean.

This commit fixes the test based on Matt's change in r279125 to not
expose the undefined behaviour.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 20:27:42 +00:00
Hans Wennborg 0316f025da Merging r279125 and r278343:
------------------------------------------------------------------------
r279125 | mssimpso | 2016-08-18 12:50:32 -0700 (Thu, 18 Aug 2016) | 14 lines

[SLP] Initialize VectorizedValue when gathering

We abort building vectorizable trees in some cases (e.g., if the maximum
recursion depth is reached, if the region size is too large, etc.). If this
happens for a reduction, we can be left with a root entry that needs to be
gathered. For these cases, we need make sure we actually set VectorizedValue to
the resulting vector.

This patch ensures we properly set VectorizedValue, and it also ensures the
insertelement sequence generated for the gathers is inserted at the correct
location.

Reference: https://llvm.org/bugs/show_bug.cgi?id=28330
Differential Revison: https://reviews.llvm.org/D23410
------------------------------------------------------------------------

------------------------------------------------------------------------
r278343 | mssimpso | 2016-08-11 08:28:45 -0700 (Thu, 11 Aug 2016) | 1 line

[SLP] Make RecursionMaxDepth a command line option (NFC)
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 22:38:06 +00:00
Hans Wennborg 5139e4fb9b Merging r278938:
------------------------------------------------------------------------
r278938 | mcrosier | 2016-08-17 08:54:39 -0700 (Wed, 17 Aug 2016) | 5 lines

Revert "Reassociate: Reprocess RedoInsts after each inst".

This reverts commit r258830, which introduced a bug described in PR28367.

PR28367
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 22:13:00 +00:00
Hans Wennborg d2e45b04fc Merging r278571:
------------------------------------------------------------------------
r278571 | rnk | 2016-08-12 15:23:04 -0700 (Fri, 12 Aug 2016) | 6 lines

[Inliner] Don't treat inalloca allocas as static

They aren't static, and moving them to the entry block across something
else will only result in tears.

Root cause of http://crbug.com/636558.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:06:44 +00:00
Hans Wennborg 820848abb4 Merging r278584:
------------------------------------------------------------------------
r278584 | sanjoy | 2016-08-12 17:58:31 -0700 (Fri, 12 Aug 2016) | 15 lines

[IndVars] Ignore (s|z)exts that don't extend the induction variable

`IVVisitor::visitCast` used to have the invariant that if the
instruction it was passed was a sext or zext instruction, the result of
the instruction would be wider than the induction variable.  This is no
longer true after rL275037, so this change teaches `IndVarSimplify` s
implementation of `IVVisitor::visitCast` to work with the relaxed
invariant.

A corresponding change to SimplifyIndVar to preserve the said invariant
after rL275037 would also work, but given how `IVVisitor::visitCast` is
spelled (no indication of said invariant), I figured the current fix is
cleaner.

Fixes PR28935.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 17:29:29 +00:00
Hans Wennborg 3e3f1602c5 Merging r278573 (and r277399, r278157, r278569):
------------------------------------------------------------------------
r278573 | timshen | 2016-08-12 15:47:13 -0700 (Fri, 12 Aug 2016) | 8 lines

[LoopVectorize] Detect loops in the innermost loop before creating InnerLoopVectorizer

InnerLoopVectorizer shouldn't handle a loop with cycles inside the loop
body, even if that cycle isn't a natural loop.

Fixes PR28541.

Differential Revision: https://reviews.llvm.org/D22952
------------------------------------------------------------------------

------------------------------------------------------------------------
r277399 | timshen | 2016-08-01 15:32:20 -0700 (Mon, 01 Aug 2016) | 9 lines

[ADT] NFC: Generalize GraphTraits requirement of "NodeType *" in interfaces to "NodeRef", and migrate SCCIterator.h to use NodeRef

Summary: By generalize the interface, users are able to inject more flexible Node token into the algorithm, for example, a pair of vector<Node>* and index integer. Currently I only migrated SCCIterator to use NodeRef, but more is coming. It's a NFC.

Reviewers: dblaikie, chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22937
------------------------------------------------------------------------

------------------------------------------------------------------------
r278157 | timshen | 2016-08-09 13:23:13 -0700 (Tue, 09 Aug 2016) | 7 lines

[ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs

Reviewers: chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23217
------------------------------------------------------------------------

------------------------------------------------------------------------
r278569 | timshen | 2016-08-12 15:03:28 -0700 (Fri, 12 Aug 2016) | 3 lines

[ADT] Add filter_iterator for filtering elements

Differential Revision: https://reviews.llvm.org/D22951
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 16:06:31 +00:00
Hans Wennborg 1409d14487 Merging r278413:
------------------------------------------------------------------------
r278413 | gberry | 2016-08-11 14:05:17 -0700 (Thu, 11 Aug 2016) | 17 lines

[SCEV] Update interface to handle SCEVExpander insert point motion.

Summary:
This is an extension of the fix in r271424.  That fix dealt with builder
insert points being moved by SCEV expansion, but only for the lifetime
of the expand call.  This change modifies the interface so that LSR can
safely call expand multiple times at the same insert point and do the
right thing if one of the expansions decides to move the original insert
point.

This is a fix for PR28719.

Reviewers: sanjoy

Subscribers: llvm-commits, mcrosier, mzolotukhin

Differential Revision: https://reviews.llvm.org/D23342
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:43:23 +00:00
Hans Wennborg 55ea065c2e Merging r276712:
------------------------------------------------------------------------
r276712 | eugenis | 2016-07-25 17:05:14 -0700 (Mon, 25 Jul 2016) | 3 lines

[safestack] Fix stack guard live range.

Stack guard slot is live throughout the function.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 20:06:22 +00:00
Hans Wennborg 5799ba32f5 Merging r276676:
------------------------------------------------------------------------
r276676 | eugenis | 2016-07-25 12:25:40 -0700 (Mon, 25 Jul 2016) | 1 line

Fix invalid iterator use in safestack coloring.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 20:02:49 +00:00
Hans Wennborg c39972a9b2 Merging r277691, r277693, and r277773:
------------------------------------------------------------------------
r277691 | majnemer | 2016-08-03 21:24:02 -0700 (Wed, 03 Aug 2016) | 4 lines

Reinstate "[CloneFunction] Don't remove side effecting calls"

This reinstates r277611 + r277614 and reverts r277642.  A cast_or_null
should have been a dyn_cast_or_null.
------------------------------------------------------------------------

------------------------------------------------------------------------
r277693 | majnemer | 2016-08-03 21:47:18 -0700 (Wed, 03 Aug 2016) | 1 line

Forgot the dyn_cast_or_null intended for r277691.
------------------------------------------------------------------------

------------------------------------------------------------------------
r277773 | majnemer | 2016-08-04 14:28:59 -0700 (Thu, 04 Aug 2016) | 6 lines

[CloneFunction] Add a testcase for r277691/r277693

PR28848 had a very nice reduction of the underlying cause of the bug.
Our ValueMap had, in an entry for an Instruction, a ConstantInt.

This is not at all unexpected but should be handled properly.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@277781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 22:44:36 +00:00
Hans Wennborg 8820ca41d4 Merging r277625:
------------------------------------------------------------------------
r277625 | dexonsmith | 2016-08-03 11:19:43 -0700 (Wed, 03 Aug 2016) | 42 lines

IR: Drop uniquing when an MDNode Value operand is deleted

This is a fix for PR28697.

An MDNode can indirectly refer to a GlobalValue, through a
ConstantAsMetadata.  When the GlobalValue is deleted, the MDNode operand
is reset to `nullptr`.  If the node is uniqued, this can lead to a
hard-to-detect cache invalidation in a Metadata map that's shared across
an LLVMContext.

Consider:

 1. A map from Metadata* to `T` called RemappedMDs.
 2. A node that references a global variable, `!{i1* @GV}`.
 3. Insert `!{i1* @GV} -> SomeT` in the map.
 4. Delete `@GV`, leaving behind `!{null} -> SomeT`.

Looking up the generic and uninteresting `!{null}` gives you `SomeT`,
which is likely related to `@GV`.  Worse, `SomeT`'s lifetime may be tied
to the deleted `@GV`.

This occurs in practice in the shared ValueMap used since r266579 in the
IRMover.  Other code that handles more than one Module (with different
lifetimes) in the same LLVMContext could hit it too.

The fix here is a partial revert of r225223: in the rare case that an
MDNode operand is a ConstantAsMetadata (i.e., wrapping a node from the
Value hierarchy), drop uniquing if it gets replaced with `nullptr`.
This changes step #4 above to leave behind `distinct !{null} -> SomeT`,
which can't be confused with the generic `!{null}`.

In theory, this can cause some churn in the LLVMContext's MDNode
uniquing map when Values are being deleted.  However:

  - The number of GlobalValues referenced from uniqued MDNodes is
    expected to be quite small.  E.g., the debug info metadata schema
    only references GlobalValues from distinct nodes.

  - Other Constants have the lifetime of the LLVMContext, whose teardown
    is careful to drop references before deleting the constants.

As a result, I don't expect a compile time regression from this change.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@277639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 19:52:03 +00:00
Hans Wennborg 4976a3a31b Merging r277114:
------------------------------------------------------------------------
r277114 | majnemer | 2016-07-28 22:39:21 -0700 (Thu, 28 Jul 2016) | 6 lines

[EarlyCSE] Correctly handle simplified, but live, instructions

Some instructions may have their uses replaced with a symbolic constant.
However, the instruction may still have side effects which percludes it
from being removed from the function.  EarlyCSE treated such an
instruction as if it were removed, resulting in PR28763.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@277382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 20:30:12 +00:00
Hans Wennborg 7230d55ab6 Merging r275981 and r276740:
------------------------------------------------------------------------
r275981 | rksimon | 2016-07-19 08:07:43 -0700 (Tue, 19 Jul 2016) | 13 lines

[X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR

D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead.

It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match).

This patch changes both scalar and packed versions back to using x86-specific builtins.

It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding.

A companion clang patch is at D22105

Differential Revision: https://reviews.llvm.org/D22106
------------------------------------------------------------------------

------------------------------------------------------------------------
r276740 | rksimon | 2016-07-26 03:41:28 -0700 (Tue, 26 Jul 2016) | 5 lines

[X86][SSE] Fixed issue with memory folding of (v)cvtsd2ss intrinsics

Fixed typo in the intrinsic definitions of (v)cvtsd2ss with memory folding.

This was only unearthed when rL276102 started using the intrinsic again.....
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 15:38:57 +00:00
Hans Wennborg cd00acd4fb Back-port r276209:
------------------------------------------------------------------------
r276209 | spatel | 2016-07-20 16:40:01 -0700 (Wed, 20 Jul 2016) | 4 lines

[InstSimplify][InstCombine] don't crash when folding vector selects of icmp

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

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 15:25:03 +00:00
Hans Wennborg fc9c4d6ea9 Merging r276077:
------------------------------------------------------------------------
r276077 | mzolotukhin | 2016-07-19 18:55:27 -0700 (Tue, 19 Jul 2016) | 4 lines

Revert "Revert r275883 and r275891. They seem to cause PR28608."

This reverts commit r276064, and thus reapplies r275891 and r275883 with
a fix for PR28608.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 17:45:34 +00:00
Hans Wennborg 2adc29e5fc Merging r276389:
------------------------------------------------------------------------
r276389 | majnemer | 2016-07-21 21:54:44 -0700 (Thu, 21 Jul 2016) | 6 lines

Don't remove side effecting instructions due to ConstantFoldInstruction

Just because we can constant fold the result of an instruction does not
imply that we can delete the instruction.  It may have side effects.

This fixes PR28655.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 17:27:28 +00:00
Hans Wennborg a70464418e Merging r276358, r276364, and r276368
------------------------------------------------------------------------
r276358 | spop | 2016-07-21 16:22:10 -0700 (Thu, 21 Jul 2016) | 6 lines

GVH-hoist: only clone GEPs (PR28606)

Do not clone stored values unless they are GEPs that are special cased to avoid
hoisting them without hoisting their associated ld/st.

Differential revision: https://reviews.llvm.org/D22652
------------------------------------------------------------------------

------------------------------------------------------------------------
r276364 | spop | 2016-07-21 16:32:39 -0700 (Thu, 21 Jul 2016) | 1 line

GVN-hoist: add missing check for all GEP operands available
------------------------------------------------------------------------

------------------------------------------------------------------------
r276368 | spop | 2016-07-21 17:07:01 -0700 (Thu, 21 Jul 2016) | 1 line

GVN-hoist: move check before mutating the IR
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 14:12:11 +00:00
Hans Wennborg c94b63ba84 Merging r276181:
------------------------------------------------------------------------
r276181 | majnemer | 2016-07-20 14:05:01 -0700 (Wed, 20 Jul 2016) | 6 lines

[GVNHoist] Don't hoist PHI nodes

We hoisted PHIs without respecting their special insertion point in the
block, leading to verfier errors.

This fixes PR28626.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 14:08:45 +00:00
Adam Nemet 7778b11654 [LoopDist] This test does not require ASSERTS
Only its counterpart, diagnostics-with-hotness-lazy-BFI.ll, which
invokes opt with -debug-only=.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 16:37:32 +00:00
Adam Nemet 9b7ecbef6d [LoopDist] Port to new PM
Summary:
The direct motivation for the port is to ensure that the OptRemarkEmitter
tests work with the new PM.

This remains a function pass because we not only create multiple loops
but could also version the original loop.

In the test I need to invoke opt
with -passes='require<aa>,loop-distribute'.  LoopDistribute does not
directly depend on AA however LAA does.  LAA uses getCachedResult so
I *think* we need manually pull in 'aa'.

Reviewers: davidxl, silvas

Subscribers: sanjoy, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 16:29:27 +00:00
Alexander Kornienko 71c0ef585b Revert "r275571 [DSE]Enhance shorthening MemIntrinsic based on OverlapIntervals"
Causes https://llvm.org/bugs/show_bug.cgi?id=28588


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 15:51:31 +00:00
Simon Pilgrim 0537d4bb36 [SLPVectorizer][X86] Added sqrt vectorization tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 13:20:54 +00:00
David Majnemer 93324fe683 [GVNHoist] Change the key for VNtoInsns to a pair
While debugging GVNHoist, I found it confusing that the entries in a
VNtoInsns were not always value numbers.  They _usually_ were except for
StoreInst in which case they were a hash of two different value numbers.

This leads to two observations:
- It is more difficult to debug things when the semantic contents of
  VNtoInsns changes over time.
- Using a single value number is not much cheaper, the value of
  VNtoInsns is a SmallVector.
- It is not immediately clear what the algorithm would do if there were
  hash collisions in the StoreInst case.

Using a DenseMap of std::pair sidesteps all of this.

N.B.  The changes in the test were due their sensitivity to the
iteration order of VNtoInsns which has changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 06:11:37 +00:00
NAKAMURA Takumi 73585958d4 Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute""
This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute"

It broke LTO build. Seems miscompilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 03:23:25 +00:00
Davide Italiano 7f321092d8 [GVN] Move other PRE tests to a subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 23:55:20 +00:00
Davide Italiano c2a1d898e3 [GVN] Move the PRE/LOADPRE test in a subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 23:48:18 +00:00
Davide Italiano 9cffe5e2cd [GVN] Use FileCheck instead of grep for tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 23:21:26 +00:00
Teresa Johnson e2f34269f3 [ThinLTO] Perform profile-guided indirect call promotion
Summary:
To enable profile-guided indirect call promotion in ThinLTO mode, we
simply add call graph edges for each profitable target from the profile
to the summaries, then the summary-guided importing will consider the
callee for importing as usual.

Also we need to enable the indirect call promotion pass creation in the
PassManagerBuilder when PerformThinLTO=true (we are in the ThinLTO
backend), so that the newly imported functions are considered for
promotion in the backends.

The IC promotion profiles refer to callees by GUID, which required
adding GUIDs to the per-module VST in bitcode (and assigning them
valueIds similar to how they are assigned valueIds in the combined
index).

Reviewers: mehdi_amini, xur

Subscribers: mehdi_amini, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D21932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 14:47:01 +00:00
Dehao Chen 78ee4b6ec0 [PM] Convert IVUsers analysis to new pass manager.
Summary: Convert IVUsers analysis to new pass manager.

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 22:51:33 +00:00
Sanjay Patel 2e9433d42d [InstCombine] allow X + signbit --> X ^ signbit for vector splats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:29:26 +00:00
Sanjay Patel 713ceaf392 add vector test to show missing transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:24:18 +00:00
Sanjay Patel 5de5eb94ef update tests to use FileCheck, consolidate tests, fix comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:08:22 +00:00
Sanjay Patel 32507fc5f7 update test to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:31:58 +00:00
Sanjay Patel dbf9b41991 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:27:58 +00:00
Sanjay Patel 2913e8c9be auto-ggenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:24:06 +00:00
Sanjay Patel 05d1283c18 [InstCombine] reassociate logic ops with constants separated by a zext
This is a partial implementation of a general fold for associative+commutative operators:
(op (cast (op X, C2)), C1) --> (cast (op X, op (C1, C2)))
(op (cast (op X, C2)), C1) --> (op (cast X), op (C1, C2))

There are 7 associative operators and 13 cast types, so this could potentially go a lot further.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 15:20:19 +00:00
Hal Finkel 4fe9cc7cb0 Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"
This reverts commit r275042; the initial commit triggered self-hosting failures
on ARM/AArch64. James Molloy identified the problematic backend code, which has
been disabled in r275677. Trying again...

Original commit message:

Let FuncAttrs infer the 'returned' argument attribute

A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 07:21:28 +00:00
Matt Arsenault 0d9b855807 StructurizeCFG: Fix inverting constantexpr conditions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:13:16 +00:00
Jingyue Wu 9f7e6d210d [ReassociateGEP] Update tests to allow missing "inbounds" on certain GEPs.
With r275532 fixing miscompilation of GVN, "inbounds" on certain GEPs in these
tests cannot be preserved any more. Left a TODO in the tests for future
reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275596 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 18:47:17 +00:00
Sanjay Patel a3bb4fa46d add tests for associative ops blocked by a cast
These are more generalized versions of the cases added in
r275302 and r275297.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 18:39:02 +00:00