Commit Graph

20307 Commits

Author SHA1 Message Date
Justin Bogner
abc5eea499 OnDiskHashTable: Expect the Info type to declare the offset type
This changes the on-disk hash to get the type to use for offsets from
the Info type, so that clients can be more flexible with the size of
table they support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206643 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 20:39:46 +00:00
Justin Bogner
acf59d9738 OnDiskHashTable: Expect the Info type to declare the hash size
This changes the on-disk hash to get the size of a hash value from the
Info type, so that clients can be more flexible with the types of hash
they use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206642 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 20:39:43 +00:00
Benjamin Kramer
561edae834 Remove a couple of redundant copies of SmallVector::operator==.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206635 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 19:48:03 +00:00
David Blaikie
e7b068f9f1 Add range access to MCAssembler's symbol collection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206631 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 18:24:25 +00:00
Reid Kleckner
b99f337151 Update comment in LLVMBitCodes.h to reflect the actual bitcode record
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206630 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 18:19:18 +00:00
Matt Arsenault
6a3c4b70ab Fix uint -> size_t conversion warning.
This warning is disabled for the LLVM build,
but external users of the header can still
run into this.

Patch by Ke Bai

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206629 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 18:08:31 +00:00
Duncan P. N. Exon Smith
ebb5d29473 Revert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
This reverts commit r206622 and the MSVC fixup in r206626.

Apparently the remotely failing tests are still failing, despite my
attempt to fix the nondeterminism in r206621.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206628 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 17:56:08 +00:00
Duncan P. N. Exon Smith
54850bedf2 Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl"
This reverts commit r206556, effectively reapplying commit r206548 and
its fixups in r206549 and r206550.

In an intervening commit I've added target triples to the tests that
were failing remotely [1] (but passing locally).  I'm hoping the mystery
is solved?  I'll revert this again if the tests are still failing
remotely.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206622 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 17:22:25 +00:00
Benjamin Kramer
5dd15cdb83 LineIterator: Add DataTypes.h for int64_t on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206617 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 16:57:01 +00:00
Benjamin Kramer
f2896111b5 Add some missing includes for various standard library implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206616 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 16:46:29 +00:00
Benjamin Kramer
98b539ae65 Make the copy member of StringRef/ArrayRef generic wrt allocators.
Doesn't make sense to restrict this to BumpPtrAllocator. While there
replace an explicit loop with std::equal. Some standard libraries know
how to compile this down to a ::memcmp call if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206615 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 16:36:15 +00:00
Benjamin Kramer
d781e40b6a Allocator: Remove ReferenceAdder hack.
This was a workaround for compilers that had issues with reference
collapsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206612 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 14:54:51 +00:00
Chandler Carruth
14def55736 [LCG] Remove all of the complexity stemming from supporting copying.
Reality is that we're never going to copy one of these. Supporting this
was becoming a nightmare because nothing even causes it to compile most
of the time. Lots of subtle errors built up that wouldn't have been
caught by any "normal" testing.

Also, make the move assignment actually work rather than the bogus swap
implementation that would just infloop if used. As part of that, factor
out the graph pointer updates into a helper to share between move
construction and move assignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206583 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 11:02:33 +00:00
Chandler Carruth
d61b3c303c [Allocator] Fix an obvious think-o with the move assignment
implementation of the SpecificBumpPtrAllocator -- we have to actually
move the subobject. =] Noticed when using this code more directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206582 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 11:02:29 +00:00
Chandler Carruth
4c7edb1240 [LCG] Add support for building persistent and connected SCCs to the
LazyCallGraph. This is the start of the whole point of this different
abstraction, but it is just the initial bits. Here is a run-down of
what's going on here. I'm planning to incorporate some (or all) of this
into comments going forward, hopefully with better editing and wording.
=]

The crux of the problem with the traditional way of building SCCs is
that they are ephemeral. The new pass manager however really needs the
ability to associate analysis passes and results of analysis passes with
SCCs in order to expose these analysis passes to the SCC passes. Making
this work is kind-of the whole point of the new pass manager. =]

So, when we're building SCCs for the call graph, we actually want to
build persistent nodes that stick around and can be reasoned about
later. We'd also like the ability to walk the SCC graph in more complex
ways than just the traditional postorder traversal of the current CGSCC
walk. That means that in addition to being persistent, the SCCs need to
be connected into a useful graph structure.

However, we still want the SCCs to be formed lazily where possible.

These constraints are quite hard to satisfy with the SCC iterator. Also,
using that would bypass our ability to actually add data to the nodes of
the call graph to facilite implementing the Tarjan walk. So I've
re-implemented things in a more direct and embedded way. This
immediately makes it easy to get the persistence and connectivity
correct, and it also allows leveraging the existing nodes to simplify
the algorithm. I've worked somewhat to make this implementation more
closely follow the traditional paper's nomenclature and strategy,
although it is still a bit obtuse because it isn't recursive, using
an explicit stack and a tail call instead, and it is interruptable,
resuming each time we need another SCC.

The other tricky bit here, and what actually took almost all the time
and trials and errors I spent building this, is exactly *what* graph
structure to build for the SCCs. The naive thing to build is the call
graph in its newly acyclic form. I wrote about 4 versions of this which
did precisely this. Inevitably, when I experimented with them across
various use cases, they became incredibly awkward. It was all
implementable, but it felt like a complete wrong fit. Square peg, round
hole. There were two overriding aspects that pushed me in a different
direction:

1) We want to discover the SCC graph in a postorder fashion. That means
   the root node will be the *last* node we find. Using the call-SCC DAG
   as the graph structure of the SCCs results in an orphaned graph until
   we discover a root.

2) We will eventually want to walk the SCC graph in parallel, exploring
   distinct sub-graphs independently, and synchronizing at merge points.
   This again is not helped by the call-SCC DAG structure.

The structure which, quite surprisingly, ended up being completely
natural to use is the *inverse* of the call-SCC DAG. We add the leaf
SCCs to the graph as "roots", and have edges to the caller SCCs. Once
I switched to building this structure, everything just fell into place
elegantly.

Aside from general cleanups (there are FIXMEs and too few comments
overall) that are still needed, the other missing piece of this is
support for iterating across levels of the SCC graph. These will become
useful for implementing #2, but they aren't an immediate priority.

Once SCCs are in good shape, I'll be working on adding mutation support
for incremental updates and adding the pass manager that this analysis
enables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206581 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 10:50:32 +00:00
Lang Hames
c3097bfd9b [ExecutionEngine] Allow JIT clients to enable/disable module verification.
Previously module verification was always enabled, with no way to turn it off.
As of this commit, module verification is on by default in Debug builds, and off
by default in release builds. The default behaviour can be overridden by calling
setVerifyModules(bool) on the JIT instance (this works for both the old JIT, and
MCJIT).

<rdar://problem/16150008>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 06:48:23 +00:00
Duncan P. N. Exon Smith
c7a3b95c0f Revert "blockfreq: Rewrite BlockFrequencyInfoImpl"
This reverts commits r206548, r206549 and r206549.

There are some unit tests failing that aren't failing locally [1], so
reverting until I have time to investigate.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 02:17:43 +00:00
Justin Bogner
2359d30af6 OnDiskHashTable: Provide iterator_range for keys and data
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206555 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 02:10:26 +00:00
Duncan P. N. Exon Smith
cc1e1707b8 blockfreq: Rewrite BlockFrequencyInfoImpl
Rewrite the shared implementation of BlockFrequencyInfo and
MachineBlockFrequencyInfo entirely.

The old implementation had a fundamental flaw:  precision losses from
nested loops (or very wide branches) compounded past loop exits (and
convergence points).

The @nested_loops testcase at the end of
test/Analysis/BlockFrequencyAnalysis/basic.ll is motivating.  This
function has three nested loops, with branch weights in the loop headers
of 1:4000 (exit:continue).  The old analysis gives non-sensical results:

    Printing analysis 'Block Frequency Analysis' for function 'nested_loops':
    ---- Block Freqs ----
     entry = 1.0
     for.cond1.preheader = 1.00103
     for.cond4.preheader = 5.5222
     for.body6 = 18095.19995
     for.inc8 = 4.52264
     for.inc11 = 0.00109
     for.end13 = 0.0

The new analysis gives correct results:

    Printing analysis 'Block Frequency Analysis' for function 'nested_loops':
    block-frequency-info: nested_loops
     - entry: float = 1.0, int = 8
     - for.cond1.preheader: float = 4001.0, int = 32007
     - for.cond4.preheader: float = 16008001.0, int = 128064007
     - for.body6: float = 64048012001.0, int = 512384096007
     - for.inc8: float = 16008001.0, int = 128064007
     - for.inc11: float = 4001.0, int = 32007
     - for.end13: float = 1.0, int = 8

Most importantly, the frequency leaving each loop matches the frequency
entering it.

The new algorithm leverages BlockMass and PositiveFloat to maintain
precision, separates "probability mass distribution" from "loop
scaling", and uses dithering to eliminate probability mass loss.  I have
unit tests for these types out of tree, but it was decided in the review
to make the classes private to BlockFrequencyInfoImpl, and try to shrink
them (or remove them entirely) in follow-up commits.

The new algorithm should generally have a complexity advantage over the
old.  The previous algorithm was quadratic in the worst case.  The new
algorithm is still worst-case quadratic in the presence of irreducible
control flow, but it's linear without it.

The key difference between the old algorithm and the new is that control
flow within a loop is evaluated separately from control flow outside,
limiting propagation of precision problems and allowing loop scale to be
calculated independently of mass distribution.  Loops are visited
bottom-up, their loop scales are calculated, and they are replaced by
pseudo-nodes.  Mass is then distributed through the function, which is
now a DAG.  Finally, loops are revisited top-down to multiply through
the loop scales and the masses distributed to pseudo nodes.

There are some remaining flaws.

  - Irreducible control flow isn't modelled correctly.  LoopInfo and
    MachineLoopInfo ignore irreducible edges, so this algorithm will
    fail to scale accordingly.  There's a note in the class
    documentation about how to get closer.  See also the comments in
    test/Analysis/BlockFrequencyInfo/irreducible.ll.

  - Loop scale is limited to 4096 per loop (2^12) to avoid exhausting
    the 64-bit integer precision used downstream.

  - The "bias" calculation proposed on llvmdev is *not* incorporated
    here.  This will be added in a follow-up commit, once comments from
    this review have been handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206548 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 01:57:45 +00:00
Duncan P. N. Exon Smith
bf1d0f417e PMBuilder: Expose an option to disable tail calls
Adds API to allow frontends to disable tail calls in PassManagerBuilder.

<rdar://problem/16050591>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 01:05:15 +00:00
Diego Novillo
0a0d620db3 Fix bug 19437 - Only add discriminators for DWARF 4 and above.
Summary:
This prevents the discriminator generation pass from triggering if
the DWARF version being used in the module is prior to 4.

Reviewers: echristo, dblaikie

CC: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206507 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 22:33:50 +00:00
Tim Northover
fa9a0aa77b ARM64: add acquire/release versions of the existing atomic intrinsics.
These will be needed to support IR-level lowering of atomic
operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206489 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 20:00:24 +00:00
Tim Northover
09da6b5540 Atomics: promote ARM's IR-based atomics pass to CodeGen.
Still only 32-bit ARM using it at this stage, but the promotion allows
direct testing via opt and is a reasonably self-contained patch on the
way to switching ARM64.

At this point, other targets should be able to make use of it without
too much difficulty if they want. (See ARM64 commit coming soon for an
example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206485 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 18:22:47 +00:00
NAKAMURA Takumi
207be301e3 Inliner::OptimizationRemark: Fix crash in clang/test/Frontend/optimization-remark.c on some hosts, including --vg.
DebugLoc in Callsite would not live after Inliner. It should be copied before Inliner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206459 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 12:22:14 +00:00
Chandler Carruth
83ae2f7c65 [LCG] Remove a dead declaration. This stopped being used when I switched
to a more normal move operation on the graph itself. The definition
already got removed, but I missed the declaration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206455 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 09:41:54 +00:00
Chandler Carruth
cad56cba1f [LCG] Move the call graph node class into the graph class's definition.
This will become necessary to build up the SCC iterators and SCC
definitions. Moving it now so that subsequent diffs are incremental.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 09:40:13 +00:00
Chandler Carruth
c95ce87c23 Make the User::value_op_iterator a random access iterator. I had written
this code ages ago and lost track of it. Seems worth doing though --
this thing can get called from places that would benefit from knowing
that std::distance is O(1). Also add a very fledgeling unittest for
Users and make sure various aspects of this seem to work reasonably.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206453 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 09:07:50 +00:00
Chandler Carruth
a30ccb064b [LCG] Just move the allocator (now that we can) when moving a call
graph. This simplifies the custom move constructor operation to one of
walking the graph and updating the 'up' pointers to point to the new
location of the graph. Switch the nodes from a reference to a pointer
for the 'up' edge to facilitate this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 07:25:59 +00:00
Chandler Carruth
40f67f5764 [LCG] Remove the Module reference member which we weren't using for
anything and doesn't make sense if assigning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206449 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 07:22:19 +00:00
Chandler Carruth
d7eaf4f325 [Allocator] Make SpecificBumpPtrAllocator also movable and move
assignable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206448 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 07:08:56 +00:00
Justin Bogner
c30a52807f Support: Move OnDiskHashTable from clang to llvm
This introduces clang's Basic/OnDiskHashTable.h into llvm as
Support/OnDiskHashTable.h. I've taken the opportunity to add doxygen
comments and run the file through clang-format, but other than the
namespace changing from clang:: to llvm:: the API is identical.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206438 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 02:16:53 +00:00
Jim Grosbach
6c35f55692 [c++11] Tidy up AsmPrinter.cpp.
Range'ify loops and tidy up some by-reference handling. No functional
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206422 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 22:38:02 +00:00
Jim Grosbach
3abd729d21 iterator_range for machine block terminators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206421 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 22:37:58 +00:00
Tom Stellard
57f45392e2 Added new functionality to LLVM C API to use DiagnosticInfo to handle errors
Patch by: Darren Powell

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206407 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 17:45:04 +00:00
Matheus Almeida
c308f165a0 [mips] Add initial support for NaN2008 in the back-end.
This is so that EF_MIPS_NAN2008 is set if we are using IEEE 754-2008
NaN encoding (-mnan=2008). This patch also adds support for parsing
'.nan legacy' and '.nan 2008' assembly directives. The handling of
these directives should match GAS' behaviour i.e., the last directive
in use sets the ELF header bit (EF_MIPS_NAN2008).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206396 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 15:48:55 +00:00
Chandler Carruth
ae8abf7896 [LCG] Stop playing fast and loose with reference members and assignment.
It doesn't work. I'm still cleaning up all the places where I blindly
followed this pattern. There are more to come in this code too.

As a benefit, this lets the default copy and move operations Just Work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 11:14:28 +00:00
Chandler Carruth
d66a3fe106 [Allocator] Make BumpPtrAllocator movable and move assignable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206372 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 10:48:27 +00:00
Chandler Carruth
acb099472e [Allocator] Nuke to useless functions. The implicit ones are sufficient
here (obviously).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206369 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 09:21:29 +00:00
Craig Topper
5422dfb5b0 Convert SelectionDAG::getVTList to use ArrayRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206357 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 06:10:51 +00:00
Chandler Carruth
d24010f61a [Allocator] Fold the two templated overloads into a single one with
a default argument. The allocator interface we're modeling doesn't
distinguish between array and non-array allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206327 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 21:51:14 +00:00
Chandler Carruth
00e4a827f5 [Allocator] Remove a really problematic overload. This is very confusing
because there is another (size_t, size_t) overload of Allocator, and the
only distinguishing factor is that one is a tempalte and the other
isn't. There was only one usage of this and that one was easily
converted to carry the alignment constraint in the type itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206325 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 21:36:02 +00:00
David Blaikie
2bbc5a7e2c Use unique_ptr to manage ownership of child Regions within llvm::Region
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206310 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 18:32:43 +00:00
Duncan P. N. Exon Smith
32791b02fa verify-di: Implement DebugInfoVerifier
Implement DebugInfoVerifier, which steals verification relying on
DebugInfoFinder from Verifier.

  - Adds LegacyDebugInfoVerifierPassPass, a ModulePass which wraps
    DebugInfoVerifier.  Uses -verify-di command-line flag.

  - Change verifyModule() to invoke DebugInfoVerifier as well as
    Verifier.

  - Add a call to createDebugInfoVerifierPass() wherever there was a
    call to createVerifierPass().

This implementation as a module pass should sidestep efficiency issues,
allowing us to turn debug info verification back on.

<rdar://problem/15500563>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206300 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 16:27:38 +00:00
Tim Northover
03eecdccff FastISel: constrain the RegClass of operands when emitting instructions.
ARM64 suffered multiple -verify-machineinstr failures (principally over the
xsp/xzr issue) because FastISel was completely ignoring which subset of the
general-purpose registers each instruction required.

More fixes are coming in ARM64 specific FastISel, but this should cover the
generic problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206283 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 13:59:49 +00:00
Chandler Carruth
b9a99d4593 [Allocator] Finally, finish nuking the redundant code that led me here
by removing the MallocSlabAllocator entirely and just using
MallocAllocator directly. This makes all off these allocators expose and
utilize the same core interface.

The only ugly part of this is that it exposes the fact that the JIT
allocator has no real handling of alignment, any more than the malloc
allocator does. =/ It would be nice to fix both of these to support
alignments, and then to leverage that in the BumpPtrAllocator to do less
over allocation in order to manually align pointers. But, that's another
patch for another day. This patch has no functional impact, it just
removes the somewhat meaningless wrapper around MallocAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206267 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 09:44:09 +00:00
Chandler Carruth
47b284ce35 [Allocator] Pass the size to the deallocation function. This, on some
allocation libraries, may allow more efficient allocation and
deallocation. It at least makes the interface implementable by the JIT
memory manager.

However, this highlights problematic overloading between the void* and
the T* deallocation functions. I'm looking into a better way to do this,
but as it happens, it comes up rarely in the codebase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206265 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 08:59:52 +00:00
Chandler Carruth
d5b514ed23 [Allocator] Fix r206256 which got the enabling case backwards on these
overloads. This doesn't matter *that* much yet, but it will in
a subsequent patch. I had tested the original pattern, but not my
attempt to pacify MSVC. This at least appears to work. Still fixing the
rest of the fallout in the final patch that uses these overloads, but it
will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206259 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 08:14:48 +00:00
Nick Lewycky
b6ecb4f8ab Fix broken build of llvm using clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 08:10:46 +00:00
Chandler Carruth
2c9a974b2b [Allocator] MSVC apparantly has broken SFINAE context handling of
'sizeof(T)' for T == void and produces a hard error. I cannot fathom why
this is OK. Oh well. switch to an explicit test for being the
(potentially qualified) void type, which is the only specific case I was
worried about. Hopefully this survives the libstdc++ build bots which
have limited type traits implementations...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206256 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 08:02:29 +00:00
Nick Lewycky
d63390cba1 Break PseudoSourceValue out of the Value hierarchy. It is now the root of its own tree containing FixedStackPseudoSourceValue (which you can use isa/dyn_cast on) and MipsCallEntry (which you can't). Anything that needs to use either a PseudoSourceValue* and Value* is strongly encouraged to use a MachinePointerInfo instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206255 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 07:22:52 +00:00