Commit Graph

141296 Commits

Author SHA1 Message Date
Vedant Kumar
6e1a44693e Revert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path."
This reverts commit r287403. It breaks an internal asan bot. According
to Kuba, a fix is up for review here: https://reviews.llvm.org/D26929

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 20:51:09 +00:00
Meador Inge
882017a7cb llvm-nm: Print correct symbol types for init and fini sections
This patch fixes a small bug where symbols defined in the INIT
and FINI sections were incorrectly getting a type of 'n'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 20:17:20 +00:00
Meador Inge
54801d6fa5 llvm-nm: Don't print value or size for undefined or weak symbols
Undefined and weak symbols don't have a meaningful size or value.
As such, nothing should be printed for those attributes (this is
already done for the address with 'U') with the BSD format.  This
matches what GNU nm does.

Note that for the POSIX.2 format [1] zero values are still
printed for the size and value.  This seems in spirit with
the format strings in that specification, but is debatable.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 20:17:15 +00:00
Alexey Bataev
82fd34805f [SLP] Add more tests for SLP Vectorizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 20:10:32 +00:00
Haicheng Wu
ede1dc8ce8 [LoopUnroll] Move code to exit early. NFC.
Just to save some compilation time.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 19:39:26 +00:00
Daniel Berlin
c293e51672 Revert "[Triple] Add Facebook vendor"
This reverts commit r287684

Objections on the review thread had not been addressed to
prior to commit.  I asked the committer to revert, but i expect they
are gone for the US holiday or something.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 19:03:54 +00:00
Michael Kuperstein
4f54847874 [X86] Allow folding of stack reloads when loading a subreg of the spilled reg
We did not support subregs in InlineSpiller:foldMemoryOperand() because targets
may not deal with them correctly.

This adds a target hook to let the spiller know that a target can handle
subregs, and actually enables it for x86 for the case of stack slot reloads.
This fixes PR30832.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 18:33:49 +00:00
Hemant Kulkarni
fe8bde7e92 llvm-readobj: Use hash tables to print dynamic symbols.
-symbols prints both .symtab and .dynsym symbols for GNU style in ELF.
-dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 18:04:23 +00:00
Chandler Carruth
33d568124e [PM] Change the static object whose address is used to uniquely identify
analyses to have a common type which is enforced rather than using
a char object and a `void *` type when used as an identifier.

This has a number of advantages. First, it at least helps some of the
confusion raised in Justin Lebar's code review of why `void *` was being
used everywhere by having a stronger type that connects to documentation
about this.

However, perhaps more importantly, it addresses a serious issue where
the alignment of these pointer-like identifiers was unknown. This made
it hard to use them in pointer-like data structures. We were already
dodging this in dangerous ways to create the "all analyses" entry. In
a subsequent patch I attempted to use these with TinyPtrVector and
things fell apart in a very bad way.

And it isn't just a compile time or type system issue. Worse than that,
the actual alignment of these pointer-like opaque identifiers wasn't
guaranteed to be a useful alignment as they were just characters.

This change introduces a type to use as the "key" object whose address
forms the opaque identifier. This both forces the objects to have proper
alignment, and provides type checking that we get it right everywhere.
It also makes the types somewhat less mysterious than `void *`.

We could go one step further and introduce a truly opaque pointer-like
type to return from the `ID()` static function rather than returning
`AnalysisKey *`, but that didn't seem to be a clear win so this is just
the initial change to get to a reliably typed and aligned object serving
is a key for all the analyses.

Thanks to Richard Smith and Justin Lebar for helping pick plausible
names and avoid making this refactoring many times. =] And thanks to
Sean for the super fast review!

While here, I've tried to move away from the "PassID" nomenclature
entirely as it wasn't really helping and is overloaded with old pass
manager constructs. Now we have IDs for analyses, and key objects whose
address can be used as IDs. Where possible and clear I've shortened this
to just "ID". In a few places I kept "AnalysisID" to make it clear what
was being identified.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 17:53:26 +00:00
Alina Sbirlea
106bcf1838 [LoadStoreVectorizer] Enable vectorization of stores in the presence of an aliasing load
Summary:
The "getVectorizablePrefix" method would give up if it found an aliasing load for a store chain.
In practice, the aliasing load can be treated as a memory barrier and all stores that precede it
are a valid vectorizable prefix.
Issue found by volkan in D26962. Testcase is a pruned version of the one in the original patch.

Reviewers: jlebar, arsenm, tstellarAMD

Subscribers: mzolotukhin, wdng, nhaehnle, anna, volkan, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 17:43:15 +00:00
Nirav Dave
3e65807a6f [DAG] Improve loads-from-store forwarding to handle TokenFactor
Forward store values to matching loads down through token
factors. Factored from D14834.

Reviewers: jyknight, hfinkel

Subscribers: hfinkel, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 16:48:35 +00:00
Yichao Yu
3806d81f86 Fix doc of llvm.bitreverse.iN
Summary:
The return type is `iN` rather than always `i16`

Seems to be a typo in https://reviews.llvm.org/rL252878 .

Reviewers: jmolloy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 16:25:31 +00:00
John Brawn
aae639e0bd [DAGCombiner] Fix infinite loop in vector mul/shl combining
We have the following DAGCombiner transformations:
 (mul (shl X, c1), c2) -> (mul X, c2 << c1)
 (mul (shl X, C), Y) -> (shl (mul X, Y), C)
 (shl (mul x, c1), c2) -> (mul x, c1 << c2)
Usually the constant shift is optimised by SelectionDAG::getNode when it is
constructed, by SelectionDAG::FoldConstantArithmetic, but when we're dealing
with vectors and one of those vector constants contains an undef element
FoldConstantArithmetic does not fold and we enter an infinite loop.

Fix this by making FoldConstantArithmetic use getNode to decide how to fold each
vector element, the same as FoldConstantVectorArithmetic does, and rather than
adding the constant shift to the work list instead only apply the transformation
if it's already been folded into a constant, as if it's not we're going to loop
endlessly. Additionally add missing NoOpaques to one of those transformations,
which I noticed when writing the tests for this.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 16:05:51 +00:00
Nemanja Ivanovic
fa8f01111c [PowerPC] Remove InstAlias definitions that cause incorrect assembly
In rL283190, I added some InstAlias definitions to generate extended mnemonics
for some uses of the XXPERMDI instruction. However, when the assembler matches
these extended mnemonics, it matches the new instruction in situations where it
should match the old one.
This patch removes these definitions and accomplishes that by defining these
mnemonics with additional instructions that are isCodeGenOnly.

Fixes PR31127.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 15:51:52 +00:00
Simon Pilgrim
e547b01b86 [X86][AVX512] Add support for v4i64 fptosi/fptoui/sitofp/uitofp on AVX512DQ-only targets
Use 512-bit instructions with subvector insertion/extraction like we do in a number of similar circumstances

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 14:01:18 +00:00
Elena Demikhovsky
310dd3e13b Type legalization for compressstore and expandload intrinsics.
Implemented widening (v2f32) and splitting (v16f64).
On splitting, I use "popcnt" to calculate memory increment. 
More type legalization work will come in the next patches.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 13:58:24 +00:00
Simon Pilgrim
df7181d34e [CostModel][X86] Add missing AVX512DQ v8i64 fptosi/sitofp costs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 13:42:09 +00:00
Benjamin Kramer
e776d6005b [MD5] Use write32le instead of spelling it out with shifts.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 11:49:28 +00:00
Simon Pilgrim
fca1eeaa1f [CostModel][X86] Add v2f32 -> v2i64 fptosi/fptoui cost tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 11:43:00 +00:00
Craig Topper
fa494a82ff [AVX-512] Remove intrinsics for valignd/q and autoupgrade them to native shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 06:54:55 +00:00
Zvi Rackover
92a50aa681 [X86] Simplify lowerVectorShuffleAsBitMask to handle only integer VT's
Summary: This function is only called with integer VT arguments, so remove code that handles FP vectors.

Reviewers: RKSimon, craig.topper, delena, andreadb

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 06:45:25 +00:00
Rui Ueyama
74e176a884 Fix builbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 03:58:12 +00:00
Kuba Mracek
a64c974a27 [xray] Add XRay support for Mach-O in CodeGen
Currently, XRay only supports emitting the XRay table (xray_instr_map) on ELF binaries. Let's add Mach-O support.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 02:07:04 +00:00
Davide Italiano
329c83f959 [SCCP] Add a test for switches on undef.
Without this test, you can just remove the code fixing the
switch to the first constant in ResolvedUndefs in and everything
pass. This test, instead, fails with an assertion if the code
is removed. Found while refactoring SCCP to integrate undef in
the solver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 01:42:39 +00:00
Rui Ueyama
6356463f9a Add convenient functions to compute hashes of byte vectors.
In many sitautions, you just want to compute a hash for one chunk
of data. This patch adds convenient functions for that purpose.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 00:46:09 +00:00
Eugene Zelenko
904bc550b3 [ADT] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D27001


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 00:30:24 +00:00
Zachary Turner
4aa1e956b2 Make STL range adapter naming consistent.
Differential Revision: https://reviews.llvm.org/D27009

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 00:27:23 +00:00
Zachary Turner
370e6fdfc6 Add some searching functions for ArrayRef<T>.
Differential Revision: https://reviews.llvm.org/D26999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:22:19 +00:00
Justin Lebar
65342d216d [StructurizeCFG] Refactor OrderNodes.
Summary:
No need to copy the RPOT vector before using it.  Switch from std::map
to SmallDenseMap.  Get rid of an unused variable (TempVisited).  Get rid
of a typedef, RNVector, which is now used only once.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:14:11 +00:00
Justin Lebar
9e95f26cb5 [StructurizeCFG] Add whitespace in getAnalysisUsage.
Summary:
"addRequired" and "addPreserved" look very similar when squished up next
to each other -- without the newline this code looked to me like it was
addRequired'ing DominatorTreeWrapperPass twice.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:14:07 +00:00
Justin Lebar
31a97838f9 [StructurizeCFG] Remove unnecessary "using" in class.
Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:13:49 +00:00
Justin Lebar
7532ceb728 [StructurizeCFG] Merge the two constructors into one.
Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:13:44 +00:00
Justin Lebar
9582fba0c0 [StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion.
Summary:

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:13:37 +00:00
Justin Lebar
a9c2819951 [StructurizeCFG] Make hasOnlyUniformBranches a non-member function.
Summary: Lets us get rid of one member variable too.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:13:33 +00:00
Justin Lebar
ac4f8e1d52 [CUDA] Note in docs that you need to build with -lcudart on MacOS
-lcudart_static doesn't work.  We don't know why.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:13:29 +00:00
Sanjay Patel
68d10b6699 add and use isBitwiseLogicOp() helper function; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:54:36 +00:00
Dehao Chen
ded77cc923 Before sample pgo annotation, do not inline a function that has no debug info. (NFC)
If there is no debug info in the callee, inlining it will not help annotator. This avoids infinite loop as reported in PR/31119.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:50:01 +00:00
Davide Italiano
4f65080637 [SCCP] Remove code in visitBinaryOperator (and add tests).
We visit and/or, we try to derive a lattice value for the
instruction even if one of the operands is overdefined.
If the non-overdefined value is still 'unknown' just return and wait
for ResolvedUndefsIn to "plug in" the correct value. This simplifies
the logic a bit. While I'm here add tests for missing cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:11:25 +00:00
Matthias Braun
e436226fa3 TargetSubtargetInfo: Move implementation to lib/CodeGen; NFC
TargetSubtargetInfo is filled with CodeGen specific interfaces nowadays
(getInstrInfo(), getFrameLowering(), getSelectionDAGInfo()) most of the
tuning flags like enablePostRAScheduler(), getAntiDepBreakMode(),
enableRALocalReassignment(), ... also do not seem to be universal enough
to make sense outside of CodeGen.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:09:03 +00:00
Sanjay Patel
fe998e6ec2 [InstCombine] change bitwise logic type to eliminate bitcasts
In PR27925:
https://llvm.org/bugs/show_bug.cgi?id=27925

...we proposed adding this fold to eliminate a bitcast. In D20774, there was 
some concern about changing the type of a bitwise op as well as creating 
bitcasts that might not be free for a target. However, if we're strictly 
eliminating an instruction (by limiting this to one-use ops), then we should 
be able to do this in InstCombine.

But we're cautiously restricting the transform for now to vector types to
avoid possible backend problems. A transform to make sure the logic op is
legal for the target should be added to reverse this transform and improve
codegen.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:05:48 +00:00
Simon Pilgrim
2d1bdd9d61 [X86][AVX512DQ] Add fp <-> int tests for AVX512DQ/AVX512DQ+VL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:04:50 +00:00
Chandler Carruth
ecfbd3fb80 [LCG] Add a previously missing assert about the relationship of RefSCCs.
No intended change, everything seems to be in working order already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 21:40:10 +00:00
Peter Collingbourne
15e8caa4f4 LTO: Remove a now-unused InputFile accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 21:25:30 +00:00
Vyacheslav Klochkov
f907632b35 Fixed the lost FastMathFlags in GVN(Global Value Numbering).
Reviewer: Hal Finkel.
Differential Revision: https://reviews.llvm.org/D26952



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:52:53 +00:00
Chandler Carruth
62cfc59ef6 [LCG] Start using SCC relationship predicates in the unittest.
This mostly gives us nice unittesting of the predicates themselves. I'll
start using them further in subsequent commits to help test the actual
operations performed on the graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:35:32 +00:00
Rui Ueyama
66b8dab1a9 Remove PDBFileBuilder::build() and related functions.
PDBFileBuilder supports two different ways to create files.
One is PDBFileBuilder::commit. That function takes a filename
and write a result to the file. The other is PDBFileBuilder::build.
That returns a new PDBFile object.

This patch removes the latter because no one is using it and
in a real life situation we are very unlikely to need it.
Even if you need it, it'd be easy to write a new PDB to a memory
buffer and read it back.

Removing PDBFileBuilder::build enables us to remove other classes
build transitively.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:32:22 +00:00
Vyacheslav Klochkov
f060e3f4bc Fixed the lost FastMathFlags in Reassociate optimization.
Reviewer: Hal Finkel.
Differential Revision: https://reviews.llvm.org/D26957



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:23:04 +00:00
Paul Robinson
abb5e38a8f Restructure DwarfDebug::beginInstruction(). [NFC]
Will help a pending patch.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:46:51 +00:00
Shoaib Meenai
d0843bfa3b [Triple] Add Facebook vendor
Add a compiler vendor for Facebook, to enable future vendor-specific
behavior.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:36:26 +00:00
Chandler Carruth
2fb7ff7c1d [LCG] Add utilities to compute parent and ascestor relationships between
SCCs.

These will be fairly expensive routines to call and might be abused in
real code, but are quite useful when debugging or in asserts and are
reasonable and well formed properties to query.

I've used one of them in an assert that was requested in a code review
here. In subsequent commits I'll start using these routines more
heavily, for example in unittests etc. But this at least gets the
groundwork in place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:23:31 +00:00