1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

275 Commits

Author SHA1 Message Date
Chris Lattner
ab61b6f01e Fix a bug in DenseMap::clear, where we never reset a tombstone
to EmptyKey.

llvm-svn: 40839
2007-08-05 08:43:36 +00:00
Chris Lattner
10db9656ba When clearing a SmallPtrSet, if the set had a huge capacity, but the
contents of the set were small, deallocate and shrink the set.  This
avoids having us to memset as much data, significantly speeding up
some pathological cases.  For example, this speeds up the verifier
from 0.3899s to 0.0763 (5.1x) on the testcase from PR1432 in a 
release build.

llvm-svn: 40837
2007-08-05 07:32:14 +00:00
Anders Carlsson
122059b2e9 Fix bug spotted by Chris.
llvm-svn: 40725
2007-08-02 06:05:19 +00:00
Anders Carlsson
89ea07e724 Add extend and extOrTrunc methods that do sign or zero extension depending on whether the integer is signed or not
llvm-svn: 40724
2007-08-02 06:00:13 +00:00
Owen Anderson
997b15d967 Allow SmallPtrSet to hold pointers to const data.
llvm-svn: 40556
2007-07-27 18:07:02 +00:00
Chris Lattner
06bdb78751 Disable the string map copy ctor and assignment operators,
they don't do the right thing.  

Implement StringMap::erase.

Fix a nasty bug in the default ctor.

llvm-svn: 40395
2007-07-22 20:08:01 +00:00
Owen Anderson
2ceefaf94d Make the heuristic for shrinking DenseMap smarter.
llvm-svn: 40114
2007-07-20 18:56:46 +00:00
Owen Anderson
07f3b97796 Have DenseMap auto-shrink itself on clear(). This improves the time to optimize
403.gcc from 15.2s to 14.3s.

llvm-svn: 40100
2007-07-20 16:15:24 +00:00
Reid Spencer
3dd7b1699b Unbreak the build by putting calls to free into the implementation file and
having that implementation file #include <cstdlib>.

llvm-svn: 39952
2007-07-17 02:16:12 +00:00
Owen Anderson
f01c29815d Use realloc() to (potentially) resize the contents of SmallPtrSet in place.
llvm-svn: 39926
2007-07-16 21:27:44 +00:00
Chris Lattner
03bc1d9018 add a helper method.
llvm-svn: 39885
2007-07-15 23:32:03 +00:00
Owen Anderson
31eaa152b8 Evidently my earlier fix did not go far enough. When resizing a zero-sized
BitVector, make sure to set or clear ALL of the bits.

llvm-svn: 38481
2007-07-10 02:01:16 +00:00
Owen Anderson
1ab53d5ee7 When resizing a BitVector with size 0, be sure to clear the low word before using it.
llvm-svn: 38476
2007-07-09 23:39:39 +00:00
Owen Anderson
e48ed4f7a8 Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy
ctor while I'm at it.

Thanks to Chris Lattner for help with this patch.

llvm-svn: 38470
2007-07-09 20:59:01 +00:00
Chris Lattner
39e93bf0e0 work around an aparent gcc name resolution bug by
detemplatizing this.

llvm-svn: 38461
2007-07-09 17:11:53 +00:00
Chris Lattner
97ba0c99ed implement operator= for smallptrset
llvm-svn: 38460
2007-07-09 16:54:03 +00:00
Dan Gohman
2d36dfca67 Add an explicit keyword. Thanks Chris!
llvm-svn: 37819
2007-06-29 22:16:25 +00:00
John Criswell
57e5ed4b5a Convert .cvsignore files
llvm-svn: 37801
2007-06-29 16:35:07 +00:00
Dan Gohman
d2a3725004 Add a default parameter to a SmallVector constructor to allow it to
be called with just an initial length value, just like in std::vector.

llvm-svn: 37779
2007-06-28 20:27:24 +00:00
Owen Anderson
907b0a4e10 Have internal df_iterator's use SmallPtrSet instead of std::set. This provides compile time speedups to any pass using df_iterator.
llvm-svn: 37694
2007-06-21 21:25:36 +00:00
Chris Lattner
c68a1721c2 silence some "comparison between signed and unsigned integer expressions"
warnings

llvm-svn: 37177
2007-05-17 20:01:40 +00:00
Dan Gohman
2340529c17 Fix some sporadic segfaults that are triggered when SmallVector's heap
storage lands near the end of the available address space. In the expression
Begin+N > Capacity, the Begin+N was overflowing. Fix this by replacing it
by with an expression that doesn't involve computation of an address
beyond the end of allocated memory.

llvm-svn: 37171
2007-05-17 18:29:01 +00:00
Reid Spencer
a17d02ad08 Add some things needed by the llvm-gcc version supporting bit accurate integer
types:
1. Functions to compute div/rem at the same time.
2. Further assurance that an APInt with 0 bitwidth cannot be constructed.
3. Left and right rotate operations.
4. An exactLogBase2 function which requires an exact power of two or it
   returns -1.

llvm-svn: 37025
2007-05-13 23:44:59 +00:00
Chris Lattner
49b1ec44eb This is a patch to fix a compile error in STLExtras.h, and
a bug in GraphWriter.cpp.

Patch by Florian Brandner

llvm-svn: 36684
2007-05-03 18:32:10 +00:00
Chris Lattner
d710ec51bf remove useless type qualifiers
llvm-svn: 36676
2007-05-03 17:09:36 +00:00
Jeff Cohen
34d6dc5574 Rename identifier that GCC uses as a macro, breaking llvm-gcc build.
llvm-svn: 36474
2007-04-26 15:07:47 +00:00
Chris Lattner
b6ae31a101 add a missing operator
llvm-svn: 36375
2007-04-23 20:58:14 +00:00
Jeff Cohen
ac369daaa3 Fix some VC++ warnings.
llvm-svn: 36259
2007-04-19 02:04:09 +00:00
Chris Lattner
4a83860eea Commit an patch from Gabor Greif in Mar 2005. This eliminates the tail
pointer from ilist, storing it in the prev pointer of the first node in the
list instead.

This shrinks ilist from 8 to 4 bytes, BasicBlock from 40->36 bytes, Function
from 76->68 bytes, Module from 52->44 bytes.

llvm-svn: 36210
2007-04-17 18:41:42 +00:00
Anton Korobeynikov
f3e62a428a Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.

llvm-svn: 36146
2007-04-16 18:10:23 +00:00
Jeff Cohen
5a502fb622 Fix PR1329.
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Reid Spencer
6e7854339e Implement a getBitsNeeded method to determine how many bits are needed to
represent a string in binary form by an APInt.

llvm-svn: 35968
2007-04-13 19:19:07 +00:00
Chris Lattner
5af0826c0b fix a comment bug Reid noticed
llvm-svn: 35864
2007-04-10 16:33:06 +00:00
Chris Lattner
f661523670 add missing methods, mark stuff const
llvm-svn: 35862
2007-04-10 07:06:21 +00:00
Chris Lattner
9359e7f928 add a method
llvm-svn: 35860
2007-04-10 06:43:18 +00:00
Chris Lattner
d39ae2fa6d Add a helper class (APSInt) which can represent an APInt along with sign
information.  This is useful when a value does have a sign associated with
it.  This shouldn't be used generally in LLVM for mid-level optimizer stuff.

llvm-svn: 35681
2007-04-05 05:20:11 +00:00
Lauro Ramos Venancio
2dfc0515a6 Fix release build.
llvm-svn: 35676
2007-04-04 22:13:39 +00:00
Anton Korobeynikov
e16f421e0e Properly emit range comparisons for switch cases, where neighbour cases
go to the same destination. Now we're producing really good code for
switch-lower-feature.ll testcase

llvm-svn: 35672
2007-04-04 21:14:49 +00:00
Chris Lattner
5d12d66728 trivial optimization
llvm-svn: 35648
2007-04-04 06:18:21 +00:00
Chris Lattner
8a4ca643dd use calloc instead of new/memset, it is more efficient
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
dbf6a79a71 Extend StringMap to support being initialized as completely empty. When
initialized this way, they do not do a malloc to allocate their buckets.

llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Chris Lattner
b5e5784b28 add missing operator
llvm-svn: 35613
2007-04-03 04:25:46 +00:00
Chris Lattner
3ff8b2cf06 add a helper function.
llvm-svn: 35585
2007-04-02 05:41:00 +00:00
Chris Lattner
b59fc9767b add range version of insert()
llvm-svn: 35572
2007-04-02 01:21:19 +00:00
Zhou Sheng
551fa60212 Remove unused methods.
llvm-svn: 35553
2007-04-01 12:45:33 +00:00
Duncan Sands
def480579a Correct typo.
llvm-svn: 35504
2007-03-30 06:39:42 +00:00
Reid Spencer
4984ab6c01 Compute getLowBitsSet correctly. Using the complement of a 64-bit value
and shifting down without regard for the bitwidth of the APInt can lead
to incorrect initialization values. Instead, check for the word size case
(to avoid undef results from shift) and then do (1 << loBitsSet) - 1

llvm-svn: 35344
2007-03-25 21:58:42 +00:00
Reid Spencer
b5b291924a Fix a typo in a comment.
llvm-svn: 35316
2007-03-25 01:13:46 +00:00
Reid Spencer
16d08887ef Actually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
illegal. Instead do the 0 valued construction for the user. This is because
the caller may not know (or care to check) that the number of bits set is
zero.

llvm-svn: 35315
2007-03-25 00:01:47 +00:00
Reid Spencer
d24dc1f9a6 Make it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
they should have used the uint64_t constructor. This avoids causing
undefined results via shifts by the word size when the bit width is an
exact multiple of the word size.

llvm-svn: 35313
2007-03-24 23:47:58 +00:00