1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
Craig Topper
a654200309 Add includes of Compiler.h to fix build bot failures.
llvm-svn: 164008
2012-09-16 21:50:09 +00:00
Craig Topper
d34712230a Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented.
llvm-svn: 164006
2012-09-16 21:37:56 +00:00
Jay Foad
75b709336d Reinstate r133513 (reverted in r133700) with an additional fix for a
-Wshorten-64-to-32 warning in Instructions.h.

llvm-svn: 133708
2011-06-23 09:09:15 +00:00
Eric Christopher
d38d7f3300 Revert r133513:
"Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512)."

Due to some additional warnings.

llvm-svn: 133700
2011-06-23 06:24:52 +00:00
Jay Foad
2691fd9891 Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512).

llvm-svn: 133513
2011-06-21 10:33:19 +00:00
Chad Rosier
16a86e04cf Revert r133435 and r133449 to appease buildbots.
llvm-svn: 133499
2011-06-21 02:09:03 +00:00
Jay Foad
c465a95fb4 Change how PHINodes store their operands.
Change PHINodes to store simple pointers to their incoming basic blocks,
instead of full-blown Uses.

Note that this loses an optimization in SplitCriticalEdge(), because we
can no longer walk the use list of a BasicBlock to find phi nodes. See
the comment I removed starting "However, the foreach loop is slow for
blocks with lots of predecessors".

Extend replaceAllUsesWith() on a BasicBlock to also update any phi
nodes in the block's successors. This mimics what would have happened
when PHINodes were proper Users of their incoming blocks. (Note that
this only works if OldBB->replaceAllUsesWith(NewBB) is called when
OldBB still has a terminator instruction, so it still has some
successors.)

llvm-svn: 133435
2011-06-20 14:38:01 +00:00
Jay Foad
2d8b44f777 Remove the AugmentedUse struct.
I don't think the AugmentedUse struct buys us much, either in
correctness or in ease of use. Ditch it, and simplify Use::getUser() and
User::allocHungoffUses().

llvm-svn: 133433
2011-06-20 14:12:33 +00:00
Nick Lewycky
1f3febae6f Add missing include for ptrdiff_t. Patch by Joerg Sonnenberger!
llvm-svn: 124470
2011-01-28 03:52:25 +00:00
Jay Foad
31729c4638 Avoid compiler errors when this header file is included first, by adding
a forward declaration of simplify_type<>.

llvm-svn: 124187
2011-01-25 14:33:33 +00:00
Jay Foad
599c83ed66 Remove useless Tag enumeration.
llvm-svn: 123623
2011-01-17 15:18:06 +00:00
Jay Foad
aa0d059b67 Simplify the construction and destruction of Uses. Simplify
User::dropHungOffUses().

llvm-svn: 123580
2011-01-16 15:30:52 +00:00
Jay Foad
030a48213f Move the implementation of the User class into a new source file,
User.cpp.

llvm-svn: 123575
2011-01-16 08:10:57 +00:00
Jay Foad
a87f52d780 Simplify the allocation and freeing of Users' operand lists, now that
every BranchInst has a fixed number of operands.

llvm-svn: 123027
2011-01-07 20:29:02 +00:00
Gabor Greif
7ae22e4471 re-commit r109220, the compile error has already been fixed
Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).

Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.

llvm-svn: 109425
2010-07-26 18:48:07 +00:00
Eric Christopher
ea5f4cc47c Revert 109220.
llvm-svn: 109221
2010-07-23 08:53:17 +00:00
Gabor Greif
af73f58852 Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).

Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.

llvm-svn: 109220
2010-07-23 08:36:07 +00:00
Duncan Sands
78593d094f Add includes to get ptrdiff_t. This is needed by gcc-4.6 which has
done some more header trimming, resulting in cstdef being included
by less header files.

llvm-svn: 105786
2010-06-10 10:13:58 +00:00
Gabor Greif
0d4f085232 eliminate all 80-col violations that I have introduced in my recent checkins (and some others more)
llvm-svn: 80304
2009-08-27 23:44:33 +00:00
Gabor Greif
cc8681cea3 Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
llvm-svn: 80224
2009-08-27 06:41:46 +00:00
Stefanus Du Toit
a1923eed8c Add a comment to refer to the section of the programmer's manual that explains what the pointer tagging in Use is for.
llvm-svn: 70521
2009-04-30 23:28:50 +00:00
Chris Lattner
108305e9d3 Work around an apparent GCC miscompilation by specializing different,
this fixes a regression on some compilers from r68147.

llvm-svn: 68356
2009-04-03 00:26:01 +00:00
Chris Lattner
982ca20570 teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
llvm-svn: 68147
2009-03-31 21:28:39 +00:00
Chris Lattner
9dc97aa7bf Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.

Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.

Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits.  This should allow things 
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool> 
because the inner one knows that 2 low bits are free.

llvm-svn: 67979
2009-03-29 04:32:37 +00:00
Gabor Greif
037f4dc1a4 Rearrange operands of the BranchInst, to be able to
access each with a fixed negative index from op_end().

This has two important implications:
- getUser() will work faster, because there are less iterations
  for the waymarking algorithm to perform. This is important
  when running various analyses that want to determine callers
  of basic blocks.
- getSuccessor() now runs faster, because the indirection via OperandList
  is not necessary: Uses corresponding to the successors are at fixed
  offset to "this".

The price we pay is the slightly more complicated logic in the operator
User::delete, as it has to pick up the information whether it has to free
the memory of an original unconditional BranchInst or a BranchInst that
was originally conditional, but has been shortened to unconditional.
I was not able to come up with a nicer solution to this problem. (And
rest assured, I tried *a lot*).

Similar reorderings will follow for InvokeInst and CallInst. After that
some optimizations to pred_iterator and CallSite will fall out naturally.

llvm-svn: 66815
2009-03-12 18:34:49 +00:00
Gabor Greif
21349e4801 eliminate tabs from my previous commit
llvm-svn: 61695
2009-01-05 16:28:14 +00:00
Gabor Greif
3b91310e36 Get rid of the tagging functions and use PointerIntPair.
This means that we have to include an additional header.

This patch should be functionally equivalent. I cannot outrule any performance
degradation, though I do not expect any.

llvm-svn: 61694
2009-01-05 16:05:32 +00:00
Gabor Greif
f1881095be Add comment on how tagged pointers are
distinguished from normal (untagged) ones
as per review comment.

I am sufficiently unaquainted with doxygen to
defer the markup to someone with more experience.

llvm-svn: 57676
2008-10-17 08:31:36 +00:00
Gabor Greif
2fa8672ee6 Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.

Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.

llvm-svn: 57641
2008-10-16 15:33:02 +00:00
Chris Lattner
ab625c3b99 Fix PR2115 by doxygenating Use more, and make some more methods private.
llvm-svn: 57587
2008-10-15 16:56:14 +00:00
Gabor Greif
d9cedf70c7 remove a deprecated internal interface
llvm-svn: 57434
2008-10-13 10:25:27 +00:00
Gabor Greif
984ba5a313 backing out my last commit, it was not intended to go on the trunk
llvm-svn: 56349
2008-09-19 15:13:20 +00:00
Gabor Greif
67fa076542 first shot at removing Use::Val
untested, Use::swap() is definitely not done yet

llvm-svn: 56348
2008-09-19 15:03:57 +00:00
Dan Gohman
47c5cdbc34 Tidy SDNode::use_iterator, and complete the transition to have it
parallel its analogue, Value::value_use_iterator. The operator* method
now returns the user, rather than the use.

llvm-svn: 54127
2008-07-27 20:43:25 +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
Gabor Greif
e2dcdc92ac Make Use::init() private, it breaks invariants, clients should assign or use set().
llvm-svn: 51615
2008-05-27 21:29:38 +00:00
Gabor Greif
dd2f5c797d Merge of r51073-51074 from use-diet branch.
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.

Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.

llvm-svn: 51078
2008-05-13 22:51:52 +00:00
Gabor Greif
49bf1a4cf6 merge of use-diet branch to trunk
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Dan Gohman
14ff970e58 Fix a copy+paste error in a comment.
llvm-svn: 49820
2008-04-16 21:57:29 +00:00
Torok Edwin
348c0b39a0 test commit
llvm-svn: 48984
2008-03-31 17:09:58 +00:00
Dan Gohman
2b96ce84aa Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Gabor Greif
6ff874e81c move the Use destructor where it belongs to
llvm-svn: 48376
2008-03-14 22:03:02 +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
Chris Lattner
ba2ff1f992 Add a new use_iterator::atEnd() method, which allows us to shrink
pred_iterator down to a single ivar.

llvm-svn: 42859
2007-10-11 04:18:11 +00:00
Chris Lattner
c1736fdce0 Move the definition of value_use_iterator::getOperandNo to User.h where the
definition of the User class is available, this fixes the  build with some
compiler versions.

llvm-svn: 28163
2006-05-08 05:59:36 +00:00
Chris Lattner
56ae04a191 Add a helper method.
llvm-svn: 28114
2006-05-05 00:51:42 +00:00
Chris Lattner
a6ae3e278a Add some missing template specializations for autodereferencing User.
llvm-svn: 27189
2006-03-27 22:49:07 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Chris Lattner
fdbedbbb45 Switch from using an ilist for uses to using a custom doubly linked list.
This list does not provide the ability to go backwards in the list (its
more of an unordered collection, stored in the shape of a list).

This change means that use iterators are now only forward iterators, not
bidirectional.

This improves the memory usage of use lists from '5 + 4*#use' per value to
'1 + 4*#use'.  While it would be better to reduce the multiplied factor,
I'm not smart enough to do so.  This list also has slightly more efficient
operators for manipulating list nodes (a few less loads/stores), due to not
needing to be able to iterate backwards through the list.

This change reduces the memory footprint required to hold 176.gcc from
66.025M -> 57.687M, a 14% reduction.  It also speeds up the compiler,
7.73% in the case of bytecode loading alone (release build loading 176.gcc).

llvm-svn: 19956
2005-02-01 01:22:06 +00:00
Chris Lattner
382abe80a0 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00