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

59 Commits

Author SHA1 Message Date
Eugene Zelenko
58646d492d [ADT] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
llvm-svn: 303221
2017-05-16 23:10:25 +00:00
Zachary Turner
0a3b8732fd [ADT] Add SparseBitVector::find_last().
Differential Revision: https://reviews.llvm.org/D28817

llvm-svn: 292288
2017-01-17 23:09:21 +00:00
Eugene Zelenko
181555a389 [ADT, Support, TableGen] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 288424
2016-12-01 22:13:24 +00:00
Duncan P. N. Exon Smith
3f3dc22df8 ADT: Use std::list in SparseBitVector, NFC
The only intrusive thing about SparseBitVector's usage of ilist<> was
that new was usually called externally.  There were no custom traits.

It seems like the reason to switch to ilist in r41855 was to avoid
pointer invalidation, but std::list<> has that feature too.  Maybe
std::list<>::emplace makes this a little more obvious than it was then.

Switch over to std::list<> and simplify the code.

llvm-svn: 280573
2016-09-03 02:43:42 +00:00
Duncan P. N. Exon Smith
68b6058de5 ADT: Remove ilist_*sentinel_traits, NFC
Remove all the dead code around ilist_*sentinel_traits.  This is a
follow-up to gutting them as part of r279314 (originally r278974),
staged to prevent broken builds in sub-projects.

Uses were removed from clang in r279457 and lld in r279458.

llvm-svn: 279473
2016-08-22 20:51:00 +00:00
Duncan P. N. Exon Smith
2e8f72520b ADT: Share code for embedded sentinel traits, NFC
Share code for the (mostly problematic) embedded sentinel traits.
- Move the LLVM_NO_SANITIZE("object-size") attribute to
  ilist_half_embedded_sentinel_traits and ilist_embedded_sentinel_traits
  (previously it spread throughout the code duplication).
- Add an ilist_full_embedded_sentinel_traits which has no UB (but has
  the downside of storing the complete node).
- Replace all the custom sentinel traits in LLVM with a declaration of
  ilist_sentinel_traits that inherits from one of the embedded sentinel
  traits classes.

There are still custom sentinel traits in other LLVM subprojects.  I'll
remove those in a follow-up.

Nothing at all should be changing here, this is just rearranging code.
Note that the final goal here is to remove the sentinel traits
altogether, settling on the memory layout of
ilist_half_embedded_sentinel_traits without the UB.  This intermediate
step moves the logic into ilist.h.

llvm-svn: 278513
2016-08-12 15:00:55 +00:00
Hans Wennborg
00bac51e3e Fix Clang-tidy modernize-use-nullptr warnings in examples and include directories; other minor cleanups.
Patch by Eugene Zelenko!

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

llvm-svn: 248811
2015-09-29 18:02:48 +00:00
Daniel Berlin
e3f88c58ad Miscellaneous Fixes for SparseBitVector
Summary:

1. Fix return value in `SparseBitVector::operator&=`.
2. Add checks if SBV is being assigned is invoking SBV.

Reviewers: dberlin

Subscribers: llvm-commits

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

Committed on behalf of sl@

llvm-svn: 242693
2015-07-20 18:26:23 +00:00
Benjamin Kramer
4b76aa3d46 MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.

llvm-svn: 228930
2015-02-12 15:35:40 +00:00
NAKAMURA Takumi
a1ef3346aa Prune CRLF.
llvm-svn: 220678
2014-10-27 12:37:26 +00:00
Yaron Keren
333ef0d2b6 Reverting size_type for the containers from size_type to unsigned.
Various places in LLVM assume that container size and count are unsigned
and do not use the container size_type. Therefore they break compilation
(or possibly executation) for LP64 systems where size_t is 64 bit while
unsigned is still 32 bit.

If we'll ever that many items in the container size_type could be made
size_t for a specific containers after reviweing its other uses.

llvm-svn: 211353
2014-06-20 12:20:56 +00:00
Yaron Keren
e1172cbc66 The count() function for STL datatypes returns unsigned, even where it's
only 1/0 result like std::set. Some of the LLVM ADT already return unsigned
count(), while others still return bool count().

In continuation to r197879, this patch modifies DenseMap, DenseSet, 
ScopedHashTable, ValueMap:: count() to return size_type instead of bool,
1 instead of true and 0 instead of false.

size_type is typedef-ed locally within each class to size_t.

http://reviews.llvm.org/D4018

Reviewed by dblaikie.

llvm-svn: 211350
2014-06-20 10:26:56 +00:00
Alp Toker
e845f8af67 Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

llvm-svn: 196471
2013-12-05 05:44:44 +00:00
Michael J. Spencer
c195b8a813 Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.
llvm-svn: 182680
2013-05-24 22:23:49 +00:00
Benjamin Kramer
518ed57959 Provide malloc-free sentinels for the SparseBitVector internals.
llvm-svn: 164823
2012-09-28 15:36:41 +00:00
Sylvestre Ledru
b77340e506 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
1c5e7904de Fix a typo 'iff' => 'if'
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Richard Smith
865f47cbb6 Fix integer undefined behavior due to signed left shift overflow in LLVM.
Reviewed offline by chandlerc.

llvm-svn: 162623
2012-08-24 23:29:28 +00:00
Chandler Carruth
d731be046b What's better than fixing and simplifying broken hash functions?
Deleting them because they aren't used. =D

Yell if you need these, I'm happy to instead replace them with nice uses
of the new infrastructure.

llvm-svn: 152219
2012-03-07 09:54:06 +00:00
Craig Topper
e18a06be4d Convert assert(0) to llvm_unreachable
llvm-svn: 149849
2012-02-05 22:14:15 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
John Mosby
cec9b7fc9c Trivial change to dump() function for SparseBitVector
llvm-svn: 104433
2010-05-22 05:13:17 +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
Duncan Sands
750b1f5de2 Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.

llvm-svn: 81107
2009-09-06 08:55:57 +00:00
Benjamin Kramer
8e70ffa886 Delete unused #include.
llvm-svn: 81076
2009-09-05 08:50:14 +00:00
Jeffrey Yasskin
da42799098 Add a missing ilist_node.h #include to SparseBitVector, and add a very short
test for it. The test is by no means complete, but it tests the problem I was
fixing.

llvm-svn: 77025
2009-07-25 00:33:57 +00:00
Daniel Dunbar
1df20e31e5 Move to raw_ostream.
llvm-svn: 76963
2009-07-24 09:53:24 +00:00
Bill Wendling
4698f862f3 Use struct instead of class to make MCVS compile.
llvm-svn: 71600
2009-05-12 21:50:43 +00:00
John Mosby
366006cfd3 Shrink wrapping in PEI:
- reduces _static_ callee saved register spills
  and restores similar to Chow's original algorithm.
- iterative implementation with simple heuristic
  limits to mitigate compile time impact.
- handles placing spills/restores for multi-entry,
  multi-exit regions in the Machine CFG without
  splitting edges.
- passes test-suite in LLCBETA mode.

Added contains() method to ADT/SparseBitVector.

llvm-svn: 71438
2009-05-11 17:04:19 +00:00
Dan Gohman
770f4158e5 Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.

llvm-svn: 68227
2009-04-01 18:45:54 +00:00
Chris Lattner
047b30aba8 add some inline methods for infix operators on sparse vectors,
tidy some df iteration stuff, patch by John Mosby!

llvm-svn: 67428
2009-03-21 05:40:09 +00:00
Misha Brukman
da77da48f3 Removed trailing whitespace.
llvm-svn: 62000
2009-01-09 19:25:42 +00:00
Dan Gohman
8271066844 Tidy up #includes, deleting a bunch of unnecessary #includes.
llvm-svn: 61715
2009-01-05 17:59:02 +00:00
Dan Gohman
9653b21dc2 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Anton Korobeynikov
f77142326f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
llvm-svn: 51687
2008-05-29 17:41:17 +00:00
Owen Anderson
4ad5a5201c Add operator= implementations to SparseBitVector, allowing it to be used in GVN. This results
in both time and memory savings for GVN.  For example, one testcase went from 10.5s to 6s with
this patch.

llvm-svn: 49345
2008-04-07 17:38:23 +00:00
Chris Lattner
49e9edd6f6 Fix "Control reaches the end of non-void function" warnings,
patch by David Chisnall.

llvm-svn: 48963
2008-03-30 18:22:13 +00:00
Scott Michel
889ee011f7 Dial down gcc's warnings: don't use 0UL when 0U suffices (and when the
variables and methods themselves only use unsigned.)

llvm-svn: 48492
2008-03-18 16:55:06 +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
Daniel Berlin
13a0e04717 Fix bugs in iterator invalidation
llvm-svn: 44174
2007-11-15 18:06:49 +00:00
Hartmut Kaiser
1ba24a4989 Fixed a strange construct. Please review.
llvm-svn: 44082
2007-11-13 23:04:06 +00:00
Daniel Berlin
afb1610cf3 Some more problems noticed by Curtis
llvm-svn: 42717
2007-10-07 04:47:57 +00:00
Daniel Berlin
7cb8b28613 Fix intersectWithComplement bug noticed by Curtis Dunham
Optimize |= case for empty RHS

llvm-svn: 42629
2007-10-05 05:10:53 +00:00
Daniel Berlin
cf42f07a47 Fix the previous bug a slightly different way (by modifying how find_next works)
llvm-svn: 42613
2007-10-04 21:27:17 +00:00
Daniel Berlin
bbe5e56458 Fix off by one error in iterator
llvm-svn: 42612
2007-10-04 21:18:20 +00:00
Daniel Berlin
cd14e3d42a It helps a lot when you check for the end of your list before randomly
dereferencing things.

llvm-svn: 42605
2007-10-04 05:29:36 +00:00
Daniel Berlin
a4df074d31 Make SparseBitVector::set actually work properly when sets are not in ascending or descending order.
llvm-svn: 42604
2007-10-04 05:25:51 +00:00
Daniel Berlin
4ba5c86ebb Fix small bug in operator== for iterators
llvm-svn: 42331
2007-09-26 00:11:59 +00:00
Daniel Berlin
f6cb4c3d65 Comment fixups
llvm-svn: 42279
2007-09-24 22:20:45 +00:00
Daniel Berlin
f900d1295f Implement offline variable substitution in order to reduce memory
and time usage.
Fixup operator == to make this work, and add a resize method to DenseMap
so we can resize our hashtable once we know how big it should be.

llvm-svn: 42269
2007-09-24 19:45:49 +00:00