Commit Graph

7836 Commits

Author SHA1 Message Date
Simon Pilgrim
05803957d4 [SLPVectorizer][X86] Regenerated SEXT/ZEXT cast vectorization tests
Added 256-bit vector test as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 22:22:18 +00:00
Philip Reames
a882621f8f Reapply 267210 with fix for PR27490
Original Commit Message
Extend load/store type canonicalization to handle unordered operations

Extend the type canonicalization logic to work for unordered atomic loads and stores.  Note that while this change itself is fairly simple and low risk, there's a reasonable chance this will expose problems in the backends by suddenly generating IR they wouldn't have seen before.  Anything of this nature will be an existing bug in the backend (you could write an atomic float load), but this will definitely change the frequency with which such cases are encountered.  If you see problems, feel free to revert this change, but please make sure you collect a test case. 

Note that the concern about lowering is now much less likely.  PR27490 proved that we already *were* mucking with the types of ordered atomics and volatiles.  As a result, this change doesn't introduce as much new behavior as originally thought.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 22:17:01 +00:00
Philip Reames
bcb4c00b78 [GVN] PRE of unordered loads
Again, fairly simple.  Only change is ensuring that we actually copy the property of the load correctly.  The aliasing legality constraints were already handled by the FRE patches.  There's nothing special about unorder atomics from the perspective of the PRE algorithm itself.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:43:51 +00:00
Simon Pilgrim
ffe5d4f88c [SLPVectorizer][X86] Added BSWAP/BITREVERSE vectorization tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:41:55 +00:00
Simon Pilgrim
874ffbec05 [SLPVectorizer][X86] Added CTPOP/CTLZ/CTTZ vectorization tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:33:01 +00:00
Philip Reames
881d4a05e3 [GVN] Handle unordered atomics in cross block FRE
You'll note there are essentially no code changes here.  Cross block FRE heavily reuses code from the block local FRE.  All of the tricky parts were done as part of the previous patch and the refactoring that removed the original code duplication.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 18:46:45 +00:00
Philip Reames
1c51b735d1 [GVN] Do local FRE for unordered atomic loads
This patch is the first in a small series teaching GVN to optimize unordered loads aggressively. This change just handles block local FRE because that's the simplest thing which lets me test MDA, and the AvailableValue pieces. Somewhat suprisingly, MDA appears fine and only a couple of small changes are needed in GVN.

Once this is in, I'll tackle non-local FRE and PRE. The former looks like a natural extension of this, the later will require a couple of minor changes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 18:17:13 +00:00
Sanjay Patel
2c200f0b65 [SimplifyCFG] propagate branch metadata when creating select (retry r268550 / r268751 with possible fix)
Retrying r268550/r268751 which were reverted at r268577/r268765 due a memory sanitizer failure.
I have not been able to reproduce that failure, but I've taken another guess at fixing
the problem in this version of the patch and will watch for another failure.

Original commit message:
Unlike earlier similar fixes, we need to recalculate the branch weights
in this case.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 18:07:46 +00:00
Sanjay Patel
446cee1c45 revert r268751 - caused same failures on msan bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 17:51:37 +00:00
Sanjay Patel
576f0d9e3e [SimplifyCFG] propagate branch metadata when creating select (retry r268550 with possible fix)
Retrying r268550 which was reverted at r268577 due a memory sanitizer failure.
I have not been able to reproduce that failure, but I've taken a guess at fixing
the problem in this version of the patch and will watch for another failure.

Original commit message:
Unlike earlier similar fixes, we need to recalculate the branch weights
in this case.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 17:07:47 +00:00
Chad Rosier
cd0223f1eb [SimplifyCFG] Prefer a simplification based on a dominating condition.
Rather than merge two branches with a common destination.
Differential Revision: http://reviews.llvm.org/D19743

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 14:25:14 +00:00
Xinliang David Li
ea2fb7d1dd [PM] port IR based PGO prof-gen pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 05:49:19 +00:00
Davide Italiano
2d1483c124 [PM] Port Interprocedural SCCP to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 21:05:36 +00:00
Dehao Chen
d025c697a5 Revert http://reviews.llvm.org/D19926 as it breaks tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:47:53 +00:00
Dehao Chen
8200288f55 Simplify CFG before assigning discriminator.
Summary: We need to clean up CFG before assigning discriminator to minimize the impact of optimization on debug info.

Reviewers: davidxl, dblaikie, dnovillo

Subscribers: dnovillo, danielcdh, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:18:49 +00:00
Chad Rosier
a2d385e71e [ValueTracking] Improve isImpliedCondition for matching LHS and Imm RHSs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 15:39:18 +00:00
Silviu Baranga
debb790c77 [LV] Identify more induction PHIs by coercing expressions to AddRecExprs
Summary:
Some PHIs can have expressions that are not AddRecExprs due to the presence
of sext/zext instructions. In order to prevent the Loop Vectorizer from
bailing out when encountering these PHIs, we now coerce the SCEV
expressions to AddRecExprs using SCEV predicates (when possible).

We only do this when the alternative would be to not vectorize.

Reviewers: mzolotukhin, anemet

Subscribers: mssimpso, sanjoy, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 15:20:39 +00:00
Davide Italiano
e44aed739e [PM] Port EliminateAvailableExternally pass to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 02:37:32 +00:00
Davide Italiano
0a517713cd [PM] Port ConstantMerge to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 00:51:09 +00:00
Adam Nemet
2b2a8f145d [LoopDataPrefetch] Add optimization remark
With -Rpass=loop-data-prefetch, show the memory access that got
prefetched.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 00:08:15 +00:00
Vitaly Buka
6e64fd8d92 Revert "[SimplifyCFG] propagate branch metadata when creating select"
MemorySanitizer: use-of-uninitialized-value
0x4910e47 in count /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/MathExtras.h:159:12
0x4910e47 in countLeadingZeros<unsigned long> /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/MathExtras.h:183
0x4910e47 in FitWeights /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:855
0x4910e47 in SimplifyCondBranchToCondBranch /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2895

This reverts commit 609f4dd4bf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 23:59:33 +00:00
Balaram Makam
94ee5ea0aa "Reapply r268521 "[InstCombine] Canonicalize icmp instructions based on dominating conditions.""
This reapplies commit r268521, that was reverted in r268530 due to a test failure in select-implied.ll
Modified the test case to reflect the new change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 21:32:14 +00:00
Sanjay Patel
609f4dd4bf [SimplifyCFG] propagate branch metadata when creating select
Unlike earlier similar fixes, we need to recalculate the branch weights
in this case.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 20:48:24 +00:00
Hal Finkel
5813ee1a22 [ConstantFold] Don't try to strip fp -> int bitcasts to simplify icmps
ConstantFold has logic to take icmp (bitcast x to y), null and strip the
bitcast. This makes sense in general, but not if x has floating-point type. In
this case, we'd need a fcmp, not an icmp, and the code will assert. We normally
don't see this situation because we constant fold fp -> int bitcasts, however,
we'll see it for bitcasts of ppc_fp128 -> i128. This is because that bitcast is
Endian-dependent, and as a result, we don't simplify it in ConstantFold (we
could, but no one has yet added the necessary logic). Regardless, ConstantFold
should not depend on that canonicalization for correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268534 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 19:37:08 +00:00
Balaram Makam
30f97f1d5c Revert "[InstCombine] Canonicalize icmp instructions based on dominating conditions."
This reverts commit 573a40f79b35cf3e71db331bb00f6a84f03b835d.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 18:37:35 +00:00
Marianne Mailhot-Sarrasin
51b20e8812 Adding test cases showing the behavior of LoopUnrollPass according to optnone and optsize attributes
The unroll pass was disabled by clang in /Os. Those new test cases shows that the pass will behave correctly even if it is not fully disabled. This patch is related in some way to the clang commit (http://reviews.llvm.org/D19827), which re-enables the pass in /Os.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 17:45:40 +00:00
Balaram Makam
decf72be2d [InstCombine] Canonicalize icmp instructions based on dominating conditions.
Summary:
    This patch canonicalizes conditions based on the constant range information
    of the dominating branch condition.
    For example:

      %cmp = icmp slt i64 %a, 0
      br i1 %cmp, label %land.lhs.true, label %lor.rhs
      lor.rhs:
        %cmp2 = icmp sgt i64 %a, 0

    Would now be canonicalized into:

      %cmp = icmp slt i64 %a, 0
      br i1 %cmp, label %land.lhs.true, label %lor.rhs
      lor.rhs:
        %cmp2 = icmp ne i64 %a, 0

Reviewers: mcrosier, gberry, t.p.northover, llvm-commits, reames, hfinkel, sanjoy, majnemer

Subscribers: MatzeB, majnemer, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 17:34:20 +00:00
Hans Wennborg
2946daa8af [SimplifyCFG] isSafeToSpeculateStore now ignores debug info
This patch fixes PR27615.

@llvm.dbg.value instructions no longer count towards the maximum number of
instructions to look back at in the instruction list when searching for a
store instruction. This should make the output consistent between debug and
non-debug build.

Patch by Henric Karlsson <henric.karlsson@ericsson.com>!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 15:40:57 +00:00
Igor Laevsky
8a04253827 [RS4GC] Use SetVector/MapVector instead of DenseSet/DenseMap to guarantee stable ordering
Goal of this change is to guarantee stable ordering of the statepoint arguments and other 
newly inserted values such as gc.relocates. Previously we had explicit sorting in a couple
of places. However for unnamed values ordering was partial and overall we didn't have any 
strong invariant regarding it. This change switches all data structures to use SetVector's
and MapVector's which provide possibility for deterministic iteration over them.
Explicit sorting is now redundant and was removed.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 14:55:36 +00:00
David Majnemer
c454f3e111 [ConstantFolding, ValueTracking] Fold constants involving bitcasts of ConstantVector
We assumed that ConstantVectors would be rather uninteresting from the
perspective of analysis.  However, this is not the case due to a quirk
of how LLVM handles vectors of i1.  Vectors of i1 are not
ConstantDataVectors like vectors of i8, i16, i32 or i64 because i1's
SizeInBits differs from it's StoreSizeInBytes.  This leads to it being
categorized as a ConstantVector instead of a ConstantDataVector.

Instead, treat ConstantVector more uniformly.

This fixes PR27591.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 06:13:33 +00:00
David Majnemer
fea3ecb60c [GlobalDCE, Misc] Don't remove functions referenced by ifuncs
We forgot to consider the target of ifuncs when considering if a
function was alive or dead.

N.B. Also update a few auxiliary tools like bugpoint and
verify-uselistorder.

This fixes PR27593.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 00:20:48 +00:00
Justin Bogner
0b059c126c PM: Port LoopRotation to the new loop pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 22:02:31 +00:00
Justin Bogner
cc5bcb5917 PM: Port LoopSimplifyCFG to the new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 21:47:32 +00:00
Sanjoy Das
5fb55f614d [RS4GC] Add a test case around calling conventions; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 20:58:10 +00:00
Davide Italiano
82cad6f228 [IPO/GlobalDCE] Port to the new pass manager.
Differential Revision:  http://reviews.llvm.org/D19782

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 19:39:15 +00:00
Jack Liu
8185ccbb4a [SROA] Function canConvertValue needs to check whether both NewTy and OldTy pointers are
pointing to the same addr space. This can prevent SROA from creating a bitcast
between pointers with different addr spaces.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 19:30:48 +00:00
Jack Liu
9fd5cab227 Revert 268409 due to missing comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 19:15:02 +00:00
Jack Liu
4ddc88ec41 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268409 91177308-0d34-0410-b5e6-96231b3b80d8 2016-05-03 18:01:43 +00:00
Sanjoy Das
2845c75fa6 [LICM] Kill SCEV loop dispositions if needed
SCEV caches whether SCEV expressions are loop invariant, variant or
computable.  LICM breaks this cache, almost by definition; so clear the
SCEV disposition cache if LICM changed anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 17:50:11 +00:00
Sanjoy Das
26fc3018c2 Use all_of instead of a raw loop; NFC
Added some tests despite being NFC, since it looks like nothing was
exercising the "all incoming values to exit PHIs are same" logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 17:50:06 +00:00
Sanjoy Das
045a03d9a7 [LoopDeletion] Clear SCEV loop dispositions
`Loop::makeLoopInvariant` can hoist instructions out of loops, so loop
dispositions for the loop it operated on may need to be cleared.  We can
be smarter here (especially around how `forgetLoopDispositions` is
implemented), but let's be correct first.

Fixes PR27570.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 17:50:02 +00:00
Anna Thomas
bf6a9dfb62 Fold compares irrespective of whether allocation can be elided
Summary
When a non-escaping pointer is compared to a global value, the
comparison can be folded even if the corresponding malloc/allocation
call cannot be elided.
We need to make sure the global value is not null, since comparisons to
null cannot be folded.

In future, we should also handle cases when the the comparison
instruction dominates the pointer escape.

Reviewers: sanjoy
Subscribers s.egerton, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 14:58:21 +00:00
Kristof Beyls
e3e438a4cd Mark that SpeculativeExecution preserves Globals Alias Analysis.
A few benchmarks with lots of accesses to global variables in the hot
loops regressed a lot since r266399, which added the
SpeculativeExecution pass to the default pipeline. The problem is that
this pass doesn't mark Globals Alias Analysis as preserved. Globals
Alias Analysis is computed in a module pass, whereas
SpeculativeExecution is a function pass, and a lot of passes dependent
on the Globals Alias Analysis to optimize these benchmarks are also
function passes. As such, the Globals Alias Analysis information cannot
be recomputed between SpeculativeExecution and the following function
passes needing that information.

SpeculativeExecution doesn't invalidate Globals Alias Analysis, so mark
it as such to fix those performance regressions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 08:33:26 +00:00
Jack Liu
2d54216d9b test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 04:06:24 +00:00
David Majnemer
67d4f302ed [LoopUnroll] Unroll loops which have exit blocks to EH pads
We were overly cautious in our analysis of loops which have invokes
which unwind to EH pads.  The loop unroll transform is safe because it
only clones blocks in the loop body, it does not try to split critical
edges involving EH pads.  Instead, move the necessary safety check to
LoopUnswitch.

N.B. The safety check for loop unswitch is covered by an existing test
which fails without it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 03:57:40 +00:00
Mehdi Amini
dd2d6cfee4 ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:27:28 +00:00
Mehdi Amini
2ef976219b Revert "ThinLTO: do not import function whose linkage prevents inlining."
This reverts commit r268315, the tests are not passing.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 22:26:04 +00:00
Mehdi Amini
e1cf918848 ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 22:11:27 +00:00
Reid Kleckner
0e77da267e Revert "[SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics"
This reverts commit r268254.

This change causes assertion failures while building Chromium. Reduced
test case coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:43:22 +00:00
Hans Wennborg
0c15a0b738 [SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics
Make it possible that TryToSimplifyUncondBranchFromEmptyBlock merges empty
basic block including lifetime intrinsics as well as phi nodes and
unconditional branch into its successor or predecessor(s).

If successor of empty block has single predecessor, all contents including
lifetime intrinsics are sinked into the successor. Otherwise, they are
hoisted into its predecessor(s) and then merged into the predecessor(s).

Patch by Josh Yoon <josh.yoon@samsung.com>!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 17:22:54 +00:00