Commit Graph

51 Commits

Author SHA1 Message Date
Chris Lattner 5b6892e37c Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
Have I ever mentioned how much I _hate_ constantpointerrefs?

llvm-svn: 11212
2004-02-09 00:15:41 +00:00
Chris Lattner c70b3f63cc SlotCalculator.h moved
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner 083c99e347 Major changes. Now we only compactify individual type planes if it is in
fact "profitable" to do so.  This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.

On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.

This concludes my head bashing against the bytecode format, at least for
now.

llvm-svn: 10922
2004-01-20 00:57:32 +00:00
Chris Lattner ca1f8afe85 Add support for building the compactiontable for bytecode files. This shrinks
the bytecode file for 176.gcc by about 200K (10%), and 254.gap by about 167K,
a 25% reduction.  There is still a lot of room for improvement in the encoding
of the compaction table.

llvm-svn: 10913
2004-01-18 21:07:07 +00:00
Chris Lattner 677af4a1cb Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes.  This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.

llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner 2d0e6f6326 Cleanups & efficiency improvements
llvm-svn: 10888
2004-01-15 20:24:09 +00:00
Chris Lattner 21699e8f55 The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
llvm-svn: 10885
2004-01-15 18:47:15 +00:00
Chris Lattner de36304453 When emitting bytecode, handle strings specially. Do not add the characters
that make up the strings to the slotcalculator.

llvm-svn: 10862
2004-01-14 23:34:39 +00:00
Chris Lattner 6089bb1f19 The only clients of the slot calculator are now the asmwriter and bcwriter.
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not.  This makes it
reasonable to add bcwriter specific stuff to it as necessary.

llvm-svn: 10837
2004-01-14 02:49:34 +00:00
Chris Lattner d248950a8f Urg, remove testing code.
llvm-svn: 10757
2004-01-11 23:30:03 +00:00
Chris Lattner 0180590bea Fix a regression that I introduced yesterday. :(
llvm-svn: 10756
2004-01-11 23:29:26 +00:00
Chris Lattner 65f901e23b Check in two changes:
The first change (which is disabled) compactifies all of the function constant
pools into the global constant pool, in an attempt to reduce the amount of
duplication and overhead.  Unfortunately, as the comment indicates, this is
not yet a win, so it is disabled.

The second change sorts the typeid's so that those types that can be used
by instructions in the program appear earlier in the table than those that
cannot (such as structures and arrays).  This causes the instructions to
be able to use the dense encoding more often, saving about 5K on 254.gap.
This is only a .65% savings though, unfortunately. :(

llvm-svn: 10754
2004-01-10 23:46:13 +00:00
Chris Lattner 189d19fb04 Finegrainify namespacification
llvm-svn: 10131
2003-11-21 20:23:48 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Alkis Evlogimenos 6029d4032c Use already existing classes for post order iterator.
llvm-svn: 9629
2003-10-31 03:02:34 +00:00
Alkis Evlogimenos 5a320efd3b Output types in reverse postorder. This will allow the ByteCode/Reader
to create the minimum number of opaque types for each type with a
cycle in its type graph.

llvm-svn: 9615
2003-10-30 21:04:44 +00:00
Alkis Evlogimenos d478d3d19c Add more debugging info to help tracing the SlotCalculator.
llvm-svn: 9575
2003-10-29 03:12:12 +00:00
Chris Lattner 2c35b1c94c Make sure to add a type for va_next operands, which may not other wise
occur in the module

llvm-svn: 9336
2003-10-21 17:40:54 +00:00
Chris Lattner 7267b352fb Fix problem which effected linking apache
llvm-svn: 9335
2003-10-21 17:39:59 +00:00
John Criswell 482202a601 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner d77dd78c52 "Function"[0] == 'F', not 'M'
llvm-svn: 9297
2003-10-20 19:10:06 +00:00
Alkis Evlogimenos 8faf8d93d5 Eliminate some extraneous code in SlotCalculator::insertVal().
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
       SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
       SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
       SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().

llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Chris Lattner 0c068c097a Stop using "reverse depth first" order
llvm-svn: 9081
2003-10-13 15:21:58 +00:00
Chris Lattner 44d2c3514a Regularize header file comments
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Chris Lattner f26a8ee580 Remove redundant const qualifiers from cast<> expressions
llvm-svn: 7253
2003-07-23 15:30:06 +00:00
Chris Lattner faca62c74a * Change the order that globals and constants are processed in
* Add support for implicit zero initializers

llvm-svn: 5750
2003-03-19 20:57:22 +00:00
Chris Lattner 98cf1f5d64 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner 251a7e6231 Minor cleanups, no changes to functionality
llvm-svn: 4157
2002-10-14 00:48:57 +00:00
Chris Lattner a82ee2df46 *** empty log message ***
llvm-svn: 3065
2002-07-24 22:08:53 +00:00
Chris Lattner 113f4f4609 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner ca14237696 Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner de9c04cff3 Remove old frivolous uses of getStrValue in a debugging statement
llvm-svn: 2270
2002-04-16 21:36:59 +00:00
Chris Lattner 2e9fa6d101 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

llvm-svn: 2216
2002-04-09 19:48:49 +00:00
Chris Lattner 6915f8fc3c * Move include/llvm/Analysis/SlotCalculator.h to include/llvm/SlotCalculator.h
because the slot calculator is already part of the VMCore library.
* Rename incorporateMethod and purgeMethod to *Function

llvm-svn: 2154
2002-04-07 22:49:37 +00:00
Chris Lattner 62b7fd136e Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.

llvm-svn: 2144
2002-04-07 20:49:59 +00:00
Chris Lattner 60a6591d83 Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h

llvm-svn: 1746
2002-02-12 21:07:25 +00:00
Chris Lattner 7f74a56e24 Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner 2413b160ec Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()

llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Chris Lattner 3462ae3ad7 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h

llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner 5de2204fe8 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner 1907f4e8cc Support pointers to globals happily
llvm-svn: 754
2001-10-13 06:35:09 +00:00
Chris Lattner 3856934386 Convert more code to use new style casts
Eliminate old style casts from value.h

llvm-svn: 696
2001-10-01 20:11:19 +00:00
Chris Lattner 8f19112923 Add more support for new style casts
Convert more code to use them

llvm-svn: 695
2001-10-01 18:26:53 +00:00
Chris Lattner bb09a10929 Pull iterators out of CFG.h and CFGdecls and put them in Support directory
llvm-svn: 664
2001-09-28 22:56:31 +00:00
Chris Lattner 3779864fcf Add support for global constants, and for initializers for constants
llvm-svn: 598
2001-09-18 04:01:05 +00:00
Chris Lattner da9755002f Implement global variable support
llvm-svn: 530
2001-09-10 07:58:01 +00:00
Chris Lattner 1e6912a13f * Slot calc is now simpler and not based on module analyzer.
* Add new SC_DEBUG option to enable debugging of why stuff doesn't work

llvm-svn: 442
2001-09-07 16:31:52 +00:00
Chris Lattner 89d4dfbfba Add an arg to insertVal to allow us to prevent builtin types from being ignored
when they are inserted.

Ignore constant values without names.  If they are used, they will be inlined.

llvm-svn: 303
2001-07-26 16:28:37 +00:00
Chris Lattner 32503d5637 Fixed some error messages to be nicer
llvm-svn: 147
2001-07-07 08:36:05 +00:00
Chris Lattner 4cee8d8ffb Miscellaneous cleanups:
* Convert post to pre-increment for for loops
  * Use generic programming more
  * Use new Value::cast* instructions
  * Use new Module, Method, & BasicBlock forwarding methods
  * Use new facilities in STLExtras.h
  * Use new Instruction::isPHINode() method

llvm-svn: 96
2001-06-27 23:41:11 +00:00