1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

39 Commits

Author SHA1 Message Date
Ted Kremenek
7cac5a8369 Add BumpPtrAllocator::getTotalMemory() to allow clients to query how much memory a BumpPtrAllocator allocated.
llvm-svn: 129727
2011-04-18 22:44:46 +00:00
Chris Lattner
85f8315219 Enhance ScopedHashTable to allow it to take an allocator argument.
llvm-svn: 122721
2011-01-03 01:29:37 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Chris Lattner
ee8dea6453 Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423, patch by nobled.

llvm-svn: 117774
2010-10-30 05:14:01 +00:00
Duncan Sands
39e0233734 Remove two uses of the gcc specific 'aligned' attribute. This
is partly because this attribute caused trouble in the past (the
SmallVector one had to be changed from aligned to aligned(8) due
to causing crashes on i386 for example; in theory the same might
be needed in the Allocator case...).  But it's mostly because
there seems to be no point in special casing gcc here.  Using the
same implementation for all compilers results in better testing.

llvm-svn: 115462
2010-10-03 15:15:19 +00:00
Benjamin Kramer
63b5d569d1 Provide operator delete for BumpPtrAllocator and RecyclingAllocator. They will
never be called but msvc complains that they're missing.

llvm-svn: 100766
2010-04-08 15:22:35 +00:00
Jakob Stoklund Olesen
70757478a1 Switch SSEDomainFix to SpecificBumpPtrAllocator.
llvm-svn: 100332
2010-04-04 18:00:21 +00:00
Torok Edwin
13048a143f Fix SpecificBumpPtrAllocator iteration.
Need to start from (char*)(Slab+1), and not from (char*)Slab+1.
This fixes crashes in Win64 debug mode.
Thanks to Nicolas Capens!

llvm-svn: 100184
2010-04-02 13:20:51 +00:00
Benjamin Kramer
4b94ce229d Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.

llvm-svn: 99919
2010-03-30 20:16:45 +00:00
Torok Edwin
df7c52143e Reapply r99881 with some fixes: only call destructor in releaseMemory!
llvm-svn: 99883
2010-03-30 11:17:48 +00:00
Torok Edwin
0994bb75ce Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.
llvm-svn: 99882
2010-03-30 10:25:08 +00:00
Torok Edwin
24db267b1e Introduce another Reset() method in BumpPtrAllocator that calls a destructor
on all objects it has allocated, if they are all of the same size and alignment.
Use this to destruct all VNInfos allocated in LiveIntervalAnalysis (PR6653).

valnos is not reliable for this purpose, as seen in r99400
(which still leaked, and sometimes caused double frees).

llvm-svn: 99881
2010-03-30 10:08:26 +00:00
Dan Gohman
6a86068718 offsetof always has type size_t.
llvm-svn: 98854
2010-03-18 19:37:35 +00:00
Dan Gohman
2fa523cbd7 Explicitly cast std::min's arguments to avoid type mismatches.
llvm-svn: 98851
2010-03-18 19:01:12 +00:00
Dan Gohman
ff37afdc4b Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.

llvm-svn: 98847
2010-03-18 18:49:47 +00:00
Bill Wendling
921cd93e85 Temporarily revert r93581. It was causing failures in the ExecutionEngine tests
on the build bots.

llvm-svn: 93606
2010-01-16 01:06:58 +00:00
Ted Kremenek
bb1779e022 BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not initialization time. This removes one of the 'init_constructors' reported in <rdar://problem/7545356>.
llvm-svn: 93581
2010-01-15 23:29:34 +00:00
Chandler Carruth
766362c707 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Reid Kleckner
5a7816053e Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests for
an off-by-one error.

llvm-svn: 76891
2009-07-23 18:34:13 +00:00
Reid Kleckner
6f9bf7f028 Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Reid Kleckner
4c892c05ec Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
malloc, so there should be no functional changes to other code.

These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.

I also added some tests which helped me pinpoint some bugs.

llvm-svn: 76825
2009-07-23 00:30:41 +00:00
Mon P Wang
12fd8e63d9 Changed Allocate to use size_t instead of unsigned.
llvm-svn: 66602
2009-03-10 23:48:49 +00:00
Mon P Wang
5645b8cdc5 Fixed rounding up EltSize
llvm-svn: 66594
2009-03-10 23:04:40 +00:00
Misha Brukman
7ee4196e74 Removed trailing whitespace.
llvm-svn: 65196
2009-02-20 22:51:36 +00:00
Ted Kremenek
fa7348b283 Deallocate() methods now take a 'const void*' instead of a 'void *', matching observed behavior with how 'delete[]' can be used.
llvm-svn: 63956
2009-02-06 19:34:14 +00:00
Chris Lattner
2f95b79fee add a method to BumpPtrAllocator that allows allocating elements
with a specified alignment.

llvm-svn: 63629
2009-02-03 07:39:50 +00:00
Ted Kremenek
da4930d361 Add member template MallocAllocator::Allocate(Num) (to match the same function in BumpPtrAllocator).
llvm-svn: 62202
2009-01-14 00:38:21 +00:00
Dan Gohman
8981962672 Add a new function, ReplaceAllUsesOfValuesWith, which handles bulk
replacement of multiple values. This is slightly more efficient
than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically
could be optimized even further. However, an important property of this
new function is that it handles the case where the source value set and
destination value set overlap. This makes it feasible for isel to use
SelectNodeTo in many very common cases, which is advantageous because
SelectNodeTo avoids a temporary node and it doesn't require CSEMap
updates for users of values that don't change position.

Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to
handle operand lists more efficiently, and to correctly handle a number
of corner cases to which its new wider use exposes it.

This commit also includes a change to the encoding of post-isel opcodes
in SDNodes; now instead of being sandwiched between the target-independent
pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel
opcodes are now represented as negative values. This makes it possible
to test if an opcode is pre-isel or post-isel without having to know
the size of the current target's post-isel instruction set.

These changes speed up llc overall by 3% and reduce memory usage by 10%
on the InstructionCombining.cpp testcase with -fast and -regalloc=local.

llvm-svn: 53728
2008-07-17 19:10:17 +00:00
Dan Gohman
ddcc08e98f Make BumpPtrAllocator noncopyable.
llvm-svn: 53188
2008-07-07 18:38:14 +00:00
Dan Gohman
68abfdf98d Add a space between * and /* to help simple-minded lexers.
llvm-svn: 53187
2008-07-07 18:34:27 +00:00
Bill Wendling
36ebc296c1 Remove warnings about shadowed and unused variables.
llvm-svn: 52791
2008-06-26 18:11:45 +00:00
Dan Gohman
7ee5cc0883 Make Allocate<T>() return a T* instead of a void*. And use
static_cast instead of reinterpret_cast.

llvm-svn: 52686
2008-06-24 17:49:26 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Dan Gohman
40634cd710 Fix a typo in a comment.
llvm-svn: 45031
2007-12-14 15:11:58 +00:00
Ted Kremenek
c00b2095fa Changed the return type of type-specific Allocate() methods to return
void*.  This is hint that we are returning uninitialized memory rather
than a constructed object.

Patched ImutAVLTree to conform to this new interface.

llvm-svn: 43106
2007-10-18 00:30:14 +00:00
Ted Kremenek
9008297075 Added member template functions to MallocAllocator and
BumpPtrAllocator that implement allocations that return a properly
typed pointer.  For BumpPtrAllocator, the allocated memory is
automatically aligned to the minimum alignment of the type (as
calculated by llvm::AlignOf::Alignment).

llvm-svn: 43087
2007-10-17 21:10:21 +00:00
Evan Cheng
5977c55f5d Added Reset() to free all allocated memory regions and reset state to be the same as right after ctor.
llvm-svn: 41728
2007-09-05 21:41:34 +00:00
Chris Lattner
6a498a7658 Add a new llvm::Allocator abstraction, which will be used by a container
I'm about to add.  This is similar to, but necessarily different than, the
STL allocator class.

llvm-svn: 31285
2006-10-29 22:08:03 +00:00