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

64 Commits

Author SHA1 Message Date
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Jay Foad
3d4a8cab78 Fix typos in assert messages.
llvm-svn: 128002
2011-03-21 16:38:22 +00:00
Jay Foad
db0a7d4143 Simplify User::operator delete().
llvm-svn: 124330
2011-01-26 21:56:10 +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
26d5f31cc9 Remove unnecessary specialization OperandTraits<User>.
llvm-svn: 123577
2011-01-16 08:23:16 +00:00
Jay Foad
41923da581 OperandTraits<>::Layout isn't used for anything. Remove it.
llvm-svn: 123452
2011-01-14 18:41:56 +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
Chris Lattner
a62bc404fd Remove some dead functions, patch by Ryan Flynn!
llvm-svn: 75664
2009-07-14 18:58:35 +00:00
Sebastian Redl
e4e5b1c2f2 Fix the Win32 VS2008 build:
- Make type declarations match the struct/class keyword of the definition.
 - Move AddSignalHandler into the namespace where it belongs.
 - Correctly call functions from template base.
 - Some other small changes.
With this patch, LLVM and Clang should build properly and with far less noise under VS2008.

llvm-svn: 67347
2009-03-19 23:26:52 +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
cc417cc066 Give Op<N>() AppleScript-like semantics, i.e. for negative N it indexes relative to op_end.
This is a preliminary to changes to come. No intended functionality change.

llvm-svn: 66593
2009-03-10 23:02:13 +00:00
Gabor Greif
486717da40 make the Op<N> methods protected, how it was intended to be
llvm-svn: 66430
2009-03-09 19:57:49 +00:00
Gabor Greif
8c7604ed23 fix and clean up a comment
llvm-svn: 65212
2009-02-21 01:09:07 +00:00
Chris Lattner
293fe58ff3 add accessors
llvm-svn: 63478
2009-01-31 07:34:19 +00:00
Tanya Lattner
7bd0aec942 Do not allow a user to set the operand for a constant.
llvm-svn: 58335
2008-10-28 17:22:40 +00:00
Gabor Greif
ae2be0f217 Move some documentation from the header file into ProgrammersManual. About to improve.
llvm-svn: 52360
2008-06-16 21:06:12 +00:00
Gabor Greif
8617cb5391 op_iterator-ify dropAllReferences
llvm-svn: 52215
2008-06-11 11:45:26 +00:00
Gabor Greif
7ccadaaaf9 Suppress warnings about missing placement delete. This should now be std-conformant even if compiled with exceptions on.
llvm-svn: 51429
2008-05-22 13:16:42 +00:00
Bill Wendling
1866fa680f Remove warnings about unused parameters and shadowed variables.
llvm-svn: 51266
2008-05-19 20:15:12 +00:00
Nate Begeman
253fc69ff3 Move the operator new and operator delete out of line. This fixes an issue with
operator new() referring to the static initTags function, which has to be in the 
same linkage unit as any file including User.h.

llvm-svn: 51136
2008-05-15 01:23:11 +00:00
Gabor Greif
49bf1a4cf6 merge of use-diet branch to trunk
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Gabor Greif
6c6b8a57f3 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Devang Patel
f674975a65 To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
llvm-svn: 47508
2008-02-23 00:35:18 +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
Gordon Henriksen
8430f1ff9a Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day

llvm-svn: 44760
2007-12-10 02:14:30 +00:00
Gordon Henriksen
a18a78e6e5 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
llvm-svn: 44747
2007-12-09 22:46:10 +00:00
Chris Lattner
5a58a65c10 Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.

llvm-svn: 34193
2007-02-12 05:18:08 +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
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Chris Lattner
cf3862ce8d Fix spelling, patch contributed by Gabor Greif
llvm-svn: 20342
2005-02-27 06:15:51 +00:00
Chris Lattner
c6c1106909 Instead of storing operands as std::vector<Use>, just maintain a pointer
and num operands in the User class.  this allows us to embed the operands
directly in the subclasses if possible.  For example, for binary operators
we store the two operands in the derived class.

The has several effects:
  1. it improves locality because the operands and instruction are together
  2. it makes accesses to operands faster (one less load) if you access them
     through the derived class pointer.  For example this:

Value *GetBinaryOperatorOp(BinaryOperator *I, int i) {
  return I->getOperand(i);
}

Was compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    4(%esp), %edx
        movl    8(%esp), %eax
        sall    $4, %eax
        movl    24(%edx), %ecx
        addl    %ecx, %eax
        movl    (%eax), %eax
        ret

and is now compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    8(%esp), %eax
        movl    4(%esp), %edx
        sall    $4, %eax
        addl    %edx, %eax
        movl    44(%eax), %eax
        ret

Accesses through "Instruction*" are unmodified.

   3. This reduces memory consumption (by about 3%) by eliminating 1 word of
      vector overhead and a malloc header on a seperate object.
   4. This speeds up gccas about 10% (both debug and release builds) on
      large things (such as 176.gcc).  For example, it takes a debug build
      from 172.9 -> 155.6s and a release gccas from 67.7 -> 61.8s

llvm-svn: 19883
2005-01-29 00:29:39 +00:00
Chris Lattner
60e159a806 Warning fixes for VC++, contributed by Morten Ofstad!
llvm-svn: 17831
2004-11-15 19:02:35 +00:00
Reid Spencer
b0ee45b970 bug 122:
Remove redundancy in User::classof(Value*); GlobalValue isa Constant now.

llvm-svn: 14924
2004-07-17 23:32:11 +00:00
Chris Lattner
2926c33e27 Make ctor inline, change ValueTy ->unsigned
llvm-svn: 14430
2004-06-27 18:01:15 +00:00
Chris Lattner
b6833e4a48 Consider anything with a ValueType that is >= Instruction to be an instruction
llvm-svn: 14429
2004-06-26 20:51:50 +00:00
Chris Lattner
9995768f47 Fixes for PR114: Thanks to Reid Spencer!
llvm-svn: 10029
2003-11-16 20:21:15 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
a390208127 lalala
llvm-svn: 9146
2003-10-15 22:09:57 +00:00
Chris Lattner
b743545965 Add new op_erase method
llvm-svn: 9068
2003-10-13 03:29:26 +00:00
Chris Lattner
b6367d9414 Add a method to reserve space for operands
llvm-svn: 8992
2003-10-09 22:45:59 +00:00
Chris Lattner
394f190dab Remove unneeded dtors
llvm-svn: 8896
2003-10-06 17:36:49 +00:00
Chris Lattner
4e4c763dfc Standardize header file comments
llvm-svn: 8782
2003-09-30 18:37:50 +00:00
Chris Lattner
6c12776232 Remove a ton of extraneous #includes
llvm-svn: 6842
2003-06-22 03:08:05 +00:00
Chris Lattner
8903500053 Add new op_erase method
llvm-svn: 6757
2003-06-17 22:15:55 +00:00
John Criswell
4781723de6 Included assert.h so that the code compiles under newer versions of GCC.
llvm-svn: 6682
2003-06-11 14:01:36 +00:00
Chris Lattner
d3eae6379d Don't require the user to do something like isa<foo>(II->get()). The ->get
should be implicit.

llvm-svn: 6395
2003-05-29 15:08:33 +00:00
Chris Lattner
5ee67379d9 - Remove the User::eraseOperand method which is never used, really
dangerous, and not something we want to expose.

llvm-svn: 4007
2002-10-01 23:41:17 +00:00
Vikram S. Adve
9226baa6bc Add routines to update or erase operands (and to do so without external
assumptions about which operand number stores what operand).

llvm-svn: 3750
2002-09-16 16:06:12 +00:00