20625 Commits

Author SHA1 Message Date
Matthias Braun
6cf1b930a7 MIR: Support MachineMemOperands without associated value
This is allowed (though used rarely) and useful to keep your tests
short.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 00:06:31 +00:00
Xinliang David Li
670f8e5ba8 Replace hard coded probability threshold with parameter /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 23:48:36 +00:00
Justin Bogner
78cd7cbf25 Re-apply "SDAG: Update ChainNodesMatched as nodes are deleted"
My first attempt at this had an overly aggressive assert - chain nodes
will only be removed, but we could hit the assert if a non-chain node
was CSE'd (NodeToMatch, for instance).

This reapplies r271706 by reverting r271713 and fixing an assert.

Original message:

Avoid relying on UB by looking into deleted nodes for a marker value.
Instead, update the list of chain nodes as we go.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 20:47:40 +00:00
Justin Bogner
6cf7e43da7 Revert "SDAG: Update ChainNodesMatched as nodes are deleted"
Seeing failures in CodeGen/Generic/icmp-illegal.ll on quite a few
bots.

This reverts r271706.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 19:40:06 +00:00
Justin Bogner
f0704e634f SDAG: Update ChainNodesMatched as nodes are deleted
Avoid relying on UB by looking into deleted nodes for a marker value.
Instead, update the list of chain nodes as we go.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 18:50:11 +00:00
Justin Bogner
9da1c6d5f3 SDAG: Replace some unreachable code with an assert. NFC
The current node shouldn't be (and isn't) removed partway through
selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 18:09:53 +00:00
Reid Kleckner
3dbd3c0fd6 [codeview] Add basic record type translation
This only translates data members for now. Translating overloaded
methods is complicated, so I stopped short of doing that.

Reviewers: aaboud

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271680 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 15:58:20 +00:00
Sanjay Patel
a96468b9ad transform obscured FP sign bit ops into a fabs/fneg using TLI hook
This is effectively a revert of:
http://reviews.llvm.org/rL249702 - [InstCombine] transform masking off of an FP sign bit into a fabs() intrinsic call (PR24886)
and:
http://reviews.llvm.org/rL249701 - [ValueTracking] teach computeKnownBits that a fabs() clears sign bits
and a reimplementation as a DAG combine for targets that have IEEE754-compliant fabs/fneg instructions.

This is intended to resolve the objections raised on the dev list:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098154.html
and:
https://llvm.org/bugs/show_bug.cgi?id=24886#c4

In the interest of patch minimalism, I've only partly enabled AArch64. PowerPC, MIPS, x86 and others can enable later.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 20:01:37 +00:00
David Majnemer
d4031aa234 [CodeView] Use None instead of Void if there is no subprogram
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271566 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 18:51:24 +00:00
Matt Arsenault
5fff0fe032 Use false for bool instead of 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 18:37:21 +00:00
Reid Kleckner
0a3fd008de [codeview] Fix crash when handling qualified void types
The DIType* for void is the null pointer. A null DIType can never be a
qualified type, so we can just exit the loop at this point and go to
getTypeIndex(BaseTy).

Fixes PR27984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:40:51 +00:00
David Majnemer
fda0a6921b [CodeView] Implement function-type indices
We still need to do something about member functions and calling
conventions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271541 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:13:53 +00:00
Geoff Berry
c22d8b1ed9 [PEI, AArch64] Use empty spaces in stack area for local stack slot allocation.
Summary:
If the target requests it, use emptry spaces in the fixed and
callee-save stack area to allocate local stack objects.

AArch64: Change last callee-save reg stack object alignment instead of
size to leave a gap to take advantage of above change.

Reviewers: t.p.northover, qcolombet, MatzeB

Subscribers: rengolin, mcrosier, llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:22:07 +00:00
Sanjay Patel
ec6796196a [DAG] use getBitcast() to reduce code
Although this was intended to be NFC, the test case wiggle shows a change in
code scheduling/RA caused by a difference in the SDLoc() generation.

Depending on how you look at it, this is the (dis)advantage of exact checking
in regression tests.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:01:15 +00:00
David Majnemer
83f42796fe [CodeView] Use the right type index for long long
We used T_INT8 instead of T_QUAD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 07:02:32 +00:00
David Majnemer
f117b3a80f [CodeView] Remove superfluous bitmath
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 06:21:42 +00:00
David Majnemer
f69a113fe5 [codeview] Return type indices for typedefs
Use the type index of the underlying type unless we have a typedef from
long to HRESULT; HRESULT typedefs are translated to T_HRESULT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 06:21:37 +00:00
Matt Arsenault
48de2a917d Make MachineCopyPropagation preserve CFG
This doesn't touch it as far as I can tell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:04:26 +00:00
Justin Bogner
bc434826ff SDAG: Drop a redundant replace and move the dead node removal closer. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 20:55:26 +00:00
Michael Kuperstein
d99a2e3ae2 [DAG] Improve legalization of INSERT_SUBVECTOR
When the index is known to be constant 0, insert directly into the the low half,
instead of spilling, performing the insert in-memory, and reloading.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 20:49:35 +00:00
Than McIntosh
90ac7e3463 Better fix for PR27903.
Summary:
Re-enable lifetime-start-on-first-use for stack coloring,
but explicitly disable it for slots with more than one start
or end lifetime marker.

Bug: 27903

Reviewers: wmi, tejohnson, qcolombet, gbiv

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 17:55:10 +00:00
Reid Kleckner
9832c4c44a Fix the NDEBUG build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 17:31:24 +00:00
Reid Kleckner
bbbc4b9ba2 [codeview] Translate basic DITypes to CV type records
Summary:
This is meant to be the tiniest step towards DIType to CV type index
translation that I could come up with. Whenever translation fails, we use type
index zero, which is the unknown type.

Reviewers: aaboud, zturner

Subscribers: llvm-commits, amccarth

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 17:05:51 +00:00
Peter Collingbourne
cde3d96a21 DwarfDebug: Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 02:58:40 +00:00
Petr Hosek
ac42e994d0 [MC] Rename EmitFill to emitFill
This is to match the overloaded variants as well as the new style.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 01:59:58 +00:00
Matt Arsenault
f5bb758b18 DAGCombiner: Fix broken size check in isAlias
This should have been converting the size to bytes, but wasn't really.
These should probably all be using getStoreSize instead.

I haven't been able to come up with a meaningful testcase for this.
I can trigger it using combinations of struct loads and stores,
but can't observe a difference in non-broken testcases.

isAlias is only really used during store merging, so I'm not sure how
to get into the vector splitting situation the comment describes
since store merging is only done before type legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 01:00:36 +00:00
Matthias Braun
1cd242fe11 CodeGen: Refactor renameDisconnectedComponents() as a pass
Refactor LiveIntervals::renameDisconnectedComponents() to be a pass.
Also change the name to "RenameIndependentSubregs":

- renameDisconnectedComponents() worked on a MachineFunction at a time
  so it is a natural candidate for a machine function pass.

- The algorithm is testable with a .mir test now.

- This also fixes a problem where the lazy renaming as part of the
  MachineScheduler introduced IMPLICIT_DEF instructions after the number
  of a nodes in a region were counted leading to a mismatch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 22:38:06 +00:00
Ahmed Bougacha
2027459e9a [CodeGen] Promote FMINNAN/FMAXNAN like other binops.
We think it's OK to generate half fminnan because it's legal for the
transform-to type (f32; r245196). However, PromoteFloatRes was missing
the case; simply promote like the other binops, including minnum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 18:50:25 +00:00
Ahmed Bougacha
e03288c0e5 [CodeGen] Don't mark FMINNUM/FMAXNUM Expand twice. NFC.
They're already in the all_valuetypes() loop above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 18:50:21 +00:00
Reid Kleckner
25565d97e7 [codeview] Improve readability of type record assembly
Adds the method MCStreamer::EmitBinaryData, which is usually an alias
for EmitBytes. In the MCAsmStreamer case, it is overridden to emit hex
dump output like this:
        .byte   0x0e, 0x00, 0x08, 0x10
        .byte   0x03, 0x00, 0x00, 0x00
        .byte   0x00, 0x00, 0x00, 0x00
        .byte   0x00, 0x10, 0x00, 0x00

Also, when verbose asm comments are enabled, this patch prints the dump
output for each comment before its record, like this:
        # ArgList (0x1000) {
        #   TypeLeafKind: LF_ARGLIST (0x1201)
        #   NumArgs: 0
        #   Arguments [
        #   ]
        # }
        .byte   0x06, 0x00, 0x01, 0x12
        .byte   0x00, 0x00, 0x00, 0x00

This should make debugging easier and testing more convenient.

Reviewers: aaboud

Subscribers: majnemer, zturner, amccarth, aaboud, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 18:45:36 +00:00
Saleem Abdulrasool
a2bdb6de81 X86: permit using SjLj EH on x86 targets as an option
This adds support to the backed to actually support SjLj EH as an exception
model.  This is *NOT* the default model, and requires explicitly opting into it
from the frontend.  GCC supports this model and for MinGW can still be enabled
via the `--using-sjlj-exceptions` options.

Addresses PR27749!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 01:48:07 +00:00
Rafael Espindola
65123b902b Add RelaxELFRelocations to TargetOptions.h.
It will be used in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 01:57:20 +00:00
Andrew Kaylor
c465f6c040 Update the stack coloring pass to remove lifetime intrinsics in the optnone/opt-bisect skip case.
Differential Revision: http://reviews.llvm.org/D20453



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:56:49 +00:00
Matthias Braun
a827bf1ce5 MachineScheduler: Introduce ONLY1 reason to improve debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:14:26 +00:00
Michael Kuperstein
780aab5bdb [X86] Detect SAD patterns and emit psadbw instructions.
This recommits r267649 with a fix for PR27539.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:53:22 +00:00
Than McIntosh
019fdc9db3 Disable lifetime-start-on-first-use analysis.
Summary:
Turn off lifetime-start-on-first-use enhancement for the moment
pending a fix for bug 27903.

Bug: 27903

Reviewers: tejohnson, wmi, qcolombet, gbiv

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 15:27:51 +00:00
Benjamin Kramer
14aae01bc3 Apply clang-tidy's misc-move-constructor-init throughout LLVM.
No functionality change intended, maybe a tiny performance improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 14:27:24 +00:00
George Rimar
ec285af61c Recommit 270977 - [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.
Fix: updated clang code which was not updated by mistake.

Original commit message:
[llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.

This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)

Difference that this patch supports both zlib and zlib-gnu styles.

-compress-debug-sections option now supports next values:

-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.

Differential revision: http://reviews.llvm.org/D20676

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 12:27:32 +00:00
Benjamin Kramer
0ad6107994 Apply clang-tidy's misc-static-assert where it makes sense.
Also fold conditions into assert(0) where it makes sense. No functional
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 11:36:04 +00:00
George Rimar
8ab5c74bc0 Revert r270977 ([llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.)
It broke buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/13585/steps/build/logs/stdio

Initial commit message:
[llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.

This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)

Difference that this patch supports both zlib and zlib-gnu styles.

-compress-debug-sections option now supports next values:

-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.

Differential revision: http://reviews.llvm.org/D20676

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 10:06:16 +00:00
George Rimar
dd4101a976 [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.
This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)

Difference that this patch supports both zlib and zlib-gnu styles.

-compress-debug-sections option now supports next values:

-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.

Differential revision: http://reviews.llvm.org/D20676

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 09:58:08 +00:00
Mitch Bodart
f688cf78d6 [CodeGen] Fix problem with X86 byte registers in CriticalAntiDepBreaker
CriticalAntiDepBreaker was not correctly tracking defs of the high X86 byte
registers, leading to incorrect use of a busy register to break an
antidependence.

Fixes pr27681, and its duplicates pr27580, pr27804.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 23:08:52 +00:00
Justin Bogner
f8165c02ed SDAG: Use an Optional<> instead of a sigil value. NFC
This just makes it a bit more clear that we don't intend to use a
deleted node for anything here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 22:29:34 +00:00
Adrian Prantl
514970f03e PR26055: Speed up LiveDebugValues::transferDebugValue()
This patch builds upon r270776 and speeds up
LiveDebugValues::transferDebugValue() by adding an index that maps each
DebugVariable to its open VarLoc.

The transferDebugValue() function needs to close all open ranges for a
given DebugVariable. Iterating over the set bits of OpenRanges is
prohibitively slow in practice. I experimented with using the sorted map
of VarLocs in the UniqueVector to iterate only over the range of VarLocs
with a given DebugVariable, but the binary search turned out to be even
more expensive than just iterating over the set bits in OpenRanges.
Instead, this patch exploits the fact that there can only be one open
location for each DebugVariable and redundantly stores this location in a
DenseMap.

This patch brings the time spent in the LiveDebugValues pass down to an
almost neglectiable amount.

http://llvm.org/bugs/show_bug.cgi?id=26055
http://reviews.llvm.org/D20636
rdar://problem/24091200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270923 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:42:47 +00:00
Krzysztof Parzyszek
e19980c408 Do not rename registers that do not start an independent live range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 18:22:53 +00:00
Adrian Prantl
7fc375e6c4 Undo a suboptimal clang-format decision. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 16:06:04 +00:00
Rafael Espindola
22f5417147 Use shouldAssumeDSOLocal on AArch64.
This reduces code duplication and now AArch64 also handles PIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 12:42:55 +00:00
Reid Kleckner
8cc1c5e65b [codeview] Use comdats for debug info describing comdat functions
Summary:
This allows the linker to discard unused symbol information for comdat
functions that were discarded during the link. Before this change,
searching for the name of an inline function in the debugger would
return multiple results, one per symbol subsection in the object file.
After this change, there is only one result, the result for the function
chosen by the linker.

Reviewers: zturner, majnemer

Subscribers: aaboud, amccarth, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:16:12 +00:00
Adrian Prantl
aa8d763129 Work around an MSVC compiler issue in r270776.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:37:29 +00:00
Adrian Prantl
82629e7ee8 PR26055: Speed up LiveDebugValues by replacing lists with bitvectors.
This patch modifies the LiveDebugValues pass to use more efficient set
data structures as outlined in PR26055. Both VarLocSet and VarLocList are
now SparseBitVectors which allows us to perform much faster bitvector
arithmetic on them.

The speedup can be in the order of minutes especially on ASANified code.

The change is not NFC in the assembler output because the inserted
DBG_VALUEs are now sorted by variable and location.

Many thanks to Daniel Berlin for helping design the improved algorithm and
reviewing the patch.

https://llvm.org/bugs/show_bug.cgi?id=26055
http://reviews.llvm.org/D20178
rdar://problem/24091200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:21:12 +00:00