llvm-6502/include/llvm
Chris Lattner f718e70c7e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19883 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:29:39 +00:00
..
ADT Convert some old C-style casts to C++ style. 2005-01-28 07:22:20 +00:00
Analysis Get VC++ compiling again 2005-01-28 07:29:32 +00:00
Assembly Add llvm-as project to Visual Studio 2005-01-01 20:51:41 +00:00
Bytecode Improve compatibility with aCC on HPUX. Patch by Duraid Madina 2005-01-16 01:22:18 +00:00
CodeGen Add an accessor. 2005-01-23 22:57:27 +00:00
Config Provide support for HP/UX aCC compiler's variant of hash_map and hash_set 2005-01-16 02:58:39 +00:00
Debugger For PR351: \ 2004-12-13 17:01:53 +00:00
ExecutionEngine Add a convenience function for clearing the two global areas. 2004-12-13 16:22:32 +00:00
Support Remove two dead methods and improve the comments for DiffFilesWithTolerance. 2005-01-23 03:30:39 +00:00
System Do not clean up if the MappedFile was never used or if the client already 2005-01-28 16:08:23 +00:00
Target Add a new method, described in the comment. 2005-01-19 06:53:02 +00:00
Transforms Get VC++ compiling again 2005-01-28 07:29:32 +00:00
AbstractTypeUser.h Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
Argument.h Forward-declare templates for fix compilation when Argument.h is included first. 2004-03-11 23:42:24 +00:00
BasicBlock.h Warning fixes for VC++, contributed by Morten Ofstad! 2004-11-15 19:02:35 +00:00
CallGraphSCCPass.h 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
Constant.h Add static functions to clear singleton maps. Patch contributed by 2004-11-19 16:39:04 +00:00
Constants.h Change this method to return ulong, not uint, for 64-bit targets. 2004-12-13 19:48:51 +00:00
DerivedTypes.h Fix VC++ compilation error 2005-01-08 22:44:06 +00:00
Function.h Add convenience method. 2005-01-07 07:40:32 +00:00
GlobalValue.h Add an accessor 2004-11-15 23:20:19 +00:00
GlobalVariable.h Add long overdue methods 2004-10-11 22:21:13 +00:00
InstrTypes.h Move the implementation of the clone method for these classes to 2004-10-15 23:52:05 +00:00
Instruction.def Add new unreachable instruction 2004-10-16 18:05:37 +00:00
Instruction.h Add method 2004-11-30 02:51:53 +00:00
Instructions.h Add missing accessor. 2004-12-10 20:35:47 +00:00
IntrinsicInst.h Fix bountiful sources of VC++ 'possible loss of data' warnings 2005-01-01 18:58:23 +00:00
Intrinsics.h The Alpha (tm) intrinsics aren't even being used 2004-10-29 18:43:43 +00:00
Linker.h Completely rewrite the interface to be class based 2004-12-13 02:58:05 +00:00
Module.h These methods are long gone, ConstantPointerRef is dead. 2004-11-19 16:25:42 +00:00
ModuleProvider.h Add comments 2004-02-01 00:32:48 +00:00
Pass.h For PR387:\ 2004-12-07 08:11:11 +00:00
PassAnalysisSupport.h Add AnalysisUsage::addRequiredTransitive() to keep analysis info alive for 2004-03-12 06:13:15 +00:00
PassManager.h 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
PassSupport.h Fix more warnings 2004-06-04 20:39:05 +00:00
SymbolTable.h Fix typeo 2004-12-05 06:33:15 +00:00
SymbolTableListTraits.h Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
Type.def Packed types, brought to you by Brad Jones 2004-08-20 06:00:58 +00:00
Type.h primitive' has no a' 2005-01-24 16:28:03 +00:00
Use.h Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
User.h Instead of storing operands as std::vector<Use>, just maintain a pointer 2005-01-29 00:29:39 +00:00
Value.h Added a size_type typedef to LLVM containers to make Visual Studio shut up 2004-12-13 16:28:53 +00:00