Commit Graph

1050 Commits

Author SHA1 Message Date
Chris Lattner 9a4c064881 Add new SetCondInst::getInverseCondition() method.
llvm-svn: 3404
2002-08-20 18:17:09 +00:00
Chris Lattner 323fe8f4a6 - ConstantPointerRefs are now automatically removed from the module table
when they are destroyed, which makes Constant::destroyConstant an actually
    useful external interface.  Expose these methods publicly.
  - Implement destroyConstant on ConstPointerNull so that destroyConstant can
    be used on any derived type constant safely.

llvm-svn: 3378
2002-08-18 00:39:59 +00:00
Chris Lattner 909b272663 Module's do not subclass from Value, so this code caused a segfault.
llvm-svn: 3376
2002-08-18 00:37:14 +00:00
Chris Lattner b6a0873bd8 Add Module::dump() method
llvm-svn: 3374
2002-08-17 23:32:42 +00:00
Chris Lattner 8d1118fd8f Remove the last traces of the NOT instruction
llvm-svn: 3346
2002-08-15 16:14:49 +00:00
Vikram S. Adve 2ba6b60374 Change opLabel numbers for Not and BNot.
Also, these tree nodes are now binary, not unary.

llvm-svn: 3344
2002-08-15 14:20:45 +00:00
Vikram S. Adve 243f187791 Added more helper functions for binary instructions emulating
unary Neg and Not: isNeg, isNot, getNegArgument, and getNotArgument.

llvm-svn: 3341
2002-08-15 14:15:48 +00:00
Chris Lattner 330b7ac76c Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast.

llvm-svn: 3328
2002-08-14 18:24:09 +00:00
Chris Lattner 8fd96fcdaf Remove support for unary operators.
llvm-svn: 3326
2002-08-14 18:19:46 +00:00
Chris Lattner 9c968aaa5a Remove reference to GenericUnaryInst class
llvm-svn: 3325
2002-08-14 18:18:50 +00:00
Chris Lattner 875d512b49 Remove support for unary instructions
llvm-svn: 3324
2002-08-14 18:18:28 +00:00
Chris Lattner 725b9e5033 Remove constant propogation support for NOT instruction
llvm-svn: 3321
2002-08-14 18:17:07 +00:00
Chris Lattner b7a74232bc Expose two new static methods from BinaryOperator: createNeg, createNot
llvm-svn: 3314
2002-08-14 17:51:29 +00:00
Vikram S. Adve 2d01206a37 Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.

Also add method MachineOperand::getVRegValueOrNull().

llvm-svn: 3307
2002-08-14 16:54:11 +00:00
Chris Lattner 1f25c93ac0 - Rename ConstantGenericIntegral -> ConstantIntegral
- Add new methods to ConstantIntegral: getMaxValue, getMinValue,
   getAllOnesValue

llvm-svn: 3298
2002-08-13 17:50:18 +00:00
Chris Lattner f43b003aba Return const char * const instead of std::string from get register name method
llvm-svn: 3294
2002-08-12 21:24:55 +00:00
Chris Lattner 41e99a07f1 - Added a new superclass of ConstantBool/ConstantInt: ConstantGenericIntegral
- Moved InstCombine: isMaxValue, isMinValue, isAllOnesValue to Constants.h

llvm-svn: 3293
2002-08-12 21:21:21 +00:00
Chris Lattner e836b583e0 * IntervalPartition no longer derives from vector
llvm-svn: 3281
2002-08-09 22:52:06 +00:00
Chris Lattner 2253a154d7 Do not add an extra vtable to EVERY machineinstr created.
llvm-svn: 3280
2002-08-09 21:49:21 +00:00
Chris Lattner a09b01b2c1 UnaryOperator::create should take a name just like BinaryOperator::create
llvm-svn: 3279
2002-08-09 21:39:38 +00:00
Chris Lattner 959a5fbf8e * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3278
2002-08-09 20:08:06 +00:00
Chris Lattner 02e7a86fec * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3277
2002-08-09 20:08:03 +00:00
Chris Lattner 107914c2ac Change machinecode for instruction to not inherit from vector.
llvm-svn: 3274
2002-08-09 20:04:28 +00:00
Chris Lattner 06524e2f07 The second parameter of hash_set is the default, remove it.
llvm-svn: 3273
2002-08-09 19:40:42 +00:00
Chris Lattner f0ed55d1ee - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3265
2002-08-08 19:01:30 +00:00
Chris Lattner 4b2ee2e848 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3263
2002-08-08 19:01:11 +00:00
Chris Lattner 5b13472129 Simplify interface to parsers.
llvm-svn: 3255
2002-08-07 18:36:27 +00:00
Vikram S. Adve e93d33cc24 Add function GetConstantValueAsUnsignedInt.
llvm-svn: 3249
2002-08-04 20:55:59 +00:00
Vikram S. Adve a173017d7b Add MemAccessInst::getNumIndices().
llvm-svn: 3234
2002-08-03 13:22:36 +00:00
Chris Lattner edefd157a7 Changes to be GCC 3.1 friendly
llvm-svn: 3184
2002-07-31 19:31:59 +00:00
Chris Lattner 188d8afeee Remove obsolete, confusing, method
llvm-svn: 3175
2002-07-31 01:45:02 +00:00
Vikram S. Adve 43af9687a6 Add GlobalDSGraph -- a common graph that holds externally visible nodes.
llvm-svn: 3169
2002-07-30 22:02:04 +00:00
Chris Lattner 353faddb1c Add hooks to get information out of concrete pass manager implementations
llvm-svn: 3164
2002-07-30 19:49:39 +00:00
Chris Lattner a13a2dac7e Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr

llvm-svn: 3160
2002-07-30 18:54:22 +00:00
Chris Lattner 0d273698df * Implement stuff so that code can declare that they only depend on the CFG of
a function, not on anything else.  This speeds up GCCAS a lot.

llvm-svn: 3156
2002-07-30 16:27:32 +00:00
Chris Lattner 163f8b5b8f Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll

llvm-svn: 3153
2002-07-30 16:24:25 +00:00
Chris Lattner c3b3a825eb Expose instruction selection as a pass instead of a global function
llvm-svn: 3145
2002-07-30 03:55:29 +00:00
Chris Lattner bd3e2a09ec Add rough support for LLC passes
llvm-svn: 3144
2002-07-30 03:55:01 +00:00
Chris Lattner 153ccdcac0 Implement a new RemoveSuccessor function
llvm-svn: 3130
2002-07-29 22:32:06 +00:00
Chris Lattner 73503173ed * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.

llvm-svn: 3125
2002-07-29 21:03:38 +00:00
Chris Lattner f356bcc824 * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.

llvm-svn: 3124
2002-07-29 21:03:33 +00:00
Chris Lattner 83e9f43895 * Fix comment descriptions
* Remove defaulted argument to ctor that is never used anyway
* Prevent copying and assignment

llvm-svn: 3122
2002-07-29 21:01:19 +00:00
Chris Lattner 2675007573 * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.

llvm-svn: 3116
2002-07-27 01:12:17 +00:00
Chris Lattner 96a0dfa33e * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.

llvm-svn: 3115
2002-07-27 01:12:15 +00:00
Chris Lattner a2c0985980 * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

llvm-svn: 3112
2002-07-26 21:12:44 +00:00
Chris Lattner d858d8087f *** empty log message ***
llvm-svn: 3111
2002-07-26 21:11:42 +00:00
Chris Lattner e656a47313 * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

llvm-svn: 3110
2002-07-26 21:11:38 +00:00
Chris Lattner 137bc9826f Factor PassNameParser out of opt.cpp so that analyze and eventually llc can use it.
llvm-svn: 3108
2002-07-26 21:09:10 +00:00
Chris Lattner 5dd95b2e55 *** empty log message ***
llvm-svn: 3107
2002-07-26 19:19:31 +00:00
Chris Lattner b8c55331c7 Analysis contructors now no longer take AnalysisID's as their argument,
because there is a one-one mapping between classes and analyses.

llvm-svn: 3106
2002-07-26 19:19:16 +00:00
Chris Lattner d4879400ca Simplify analyses so that there is only one analysis per class
llvm-svn: 3104
2002-07-26 18:40:06 +00:00
Chris Lattner a442cde414 Remove dead options
llvm-svn: 3096
2002-07-25 19:59:38 +00:00
Chris Lattner 4f5624f218 Fix previous checkin
llvm-svn: 3093
2002-07-25 17:58:58 +00:00
Chris Lattner fcc395841b Add typenames
llvm-svn: 3092
2002-07-25 17:55:37 +00:00
Chris Lattner 3f351ba1d7 *** empty log message ***
llvm-svn: 3082
2002-07-25 15:39:09 +00:00
Chris Lattner c678c17211 Avoid warning: control reaches end of non-void function
llvm-svn: 3081
2002-07-25 15:39:05 +00:00
Chris Lattner 0c87ad3b87 Add support for GCC 3.0.4
llvm-svn: 3080
2002-07-25 15:23:20 +00:00
Chris Lattner 880cfedadd *** empty log message ***
llvm-svn: 3077
2002-07-25 15:00:45 +00:00
Chris Lattner 379d3286ff GCC 3.1 changes
llvm-svn: 3076
2002-07-25 15:00:43 +00:00
Chris Lattner 834cf2978b GCC 3.1 changes
llvm-svn: 3070
2002-07-24 22:34:01 +00:00
Chris Lattner 44a50ea5b7 *** empty log message ***
llvm-svn: 3067
2002-07-24 22:20:06 +00:00
Chris Lattner 1e9a5805a4 GCC 3.1 fixes
llvm-svn: 3066
2002-07-24 22:20:00 +00:00
Chris Lattner a82ee2df46 *** empty log message ***
llvm-svn: 3065
2002-07-24 22:08:53 +00:00
Chris Lattner 889cddf52c Changes to build with GCC 3.1
llvm-svn: 3064
2002-07-24 22:08:36 +00:00
Chris Lattner 7d520558f3 Use the Support/iterator file to abstract out compiler differences
llvm-svn: 3063
2002-07-24 22:07:57 +00:00
Chris Lattner 1fafa67e37 Use the new include/Support/iterator file
llvm-svn: 3062
2002-07-24 22:07:42 +00:00
Chris Lattner bad64ee7e3 Add forward_iterator wrapper
llvm-svn: 3061
2002-07-24 22:07:13 +00:00
Chris Lattner 80b3dfd7d6 Add another GCC2.95->3.1 compatibility header
llvm-svn: 3060
2002-07-24 21:38:41 +00:00
Chris Lattner 47ef71bd87 Spiff up the header files
llvm-svn: 3059
2002-07-24 21:25:34 +00:00
Chris Lattner 6c21f2454b *** empty log message ***
llvm-svn: 3058
2002-07-24 21:21:33 +00:00
Chris Lattner e583333ec9 Non-standard hash classes are not in the std:: namespace
llvm-svn: 3057
2002-07-24 21:21:33 +00:00
Chris Lattner e98dd5fcac *** empty log message ***
llvm-svn: 3056
2002-07-24 21:21:32 +00:00
Chris Lattner f0f2da260f Move hash_* extension headers from ext/ to Support/ so that we can support
GCC 2.95, GCC 3.0.4 and GCC 3.1 all concurrently, without having to delete
headers after a chackou.

llvm-svn: 3055
2002-07-24 21:16:42 +00:00
Chris Lattner cfbda0cced Move compatibility headers to Support
llvm-svn: 3054
2002-07-24 21:09:54 +00:00
Chris Lattner f7b84b6718 *** empty log message ***
llvm-svn: 3053
2002-07-24 20:44:02 +00:00
Chris Lattner afdf577637 Changes to make it GCC 3.1 compatible
llvm-svn: 3052
2002-07-24 20:44:01 +00:00
Chris Lattner 2182c33ab5 Add missing typename's that GCC3.1 is whining about.
llvm-svn: 3051
2002-07-24 20:22:09 +00:00
Chris Lattner feb53298fd Disable the operator= in Value
Disable the copy ctor and operator= in Annotation.h

llvm-svn: 3048
2002-07-24 20:01:57 +00:00
Chris Lattner 418b537393 Remove assert hack now that I'm using the right GDB. :)
llvm-svn: 3045
2002-07-24 17:21:36 +00:00
Chris Lattner 8cf6e10b4b Move many files into IPO.h
llvm-svn: 3042
2002-07-24 17:10:58 +00:00
Chris Lattner a6afead9b2 Move contents of these files into IPO.h
llvm-svn: 3041
2002-07-24 17:10:24 +00:00
Chris Lattner 259a9b25a6 * Rename to IPO.h
* Add ConstantMerge.h contents

llvm-svn: 3032
2002-07-23 19:56:27 +00:00
Chris Lattner efe5de0f81 Add a version of the bytecode writer pass that has a default ctor
llvm-svn: 3031
2002-07-23 19:56:03 +00:00
Chris Lattner b765d4e57e Incorporate into IPO.h
llvm-svn: 3030
2002-07-23 19:51:10 +00:00
Chris Lattner 86fa226049 Prepare the file to become IPO.h
llvm-svn: 3029
2002-07-23 19:48:52 +00:00
Chris Lattner b1b12d1aaa Merge the contents of ChangeAllocations.h into Scalar.h
llvm-svn: 3028
2002-07-23 19:37:38 +00:00
Chris Lattner a073fe167c Break part of Pass.h out into PassAnalysisSupport.h
Add PassSupport.h which contains code for Pass registration

llvm-svn: 3010
2002-07-23 17:59:55 +00:00
Chris Lattner 301dd0e990 Allow comparison against null
llvm-svn: 3009
2002-07-23 17:59:02 +00:00
Chris Lattner 5d33f9d4f3 *** empty log message ***
llvm-svn: 3008
2002-07-23 17:58:44 +00:00
Chris Lattner 5be9f9b357 Pass creator requires a TargetData member
llvm-svn: 3007
2002-07-23 17:58:42 +00:00
Chris Lattner 1201ce53fc Regularize the Print*Passes so they have default ctors.
llvm-svn: 3006
2002-07-23 17:58:09 +00:00
Chris Lattner 2c54a0db79 Initial checkin
llvm-svn: 3005
2002-07-23 17:56:53 +00:00
Chris Lattner ee49ae0626 Add support for removing an option from a genericparser
llvm-svn: 2998
2002-07-23 17:15:09 +00:00
Chris Lattner c0c03be046 Change to avoid bug in GCC 3.0.4
llvm-svn: 2997
2002-07-23 00:44:37 +00:00
Chris Lattner 38773cd86f initial checkin
llvm-svn: 2996
2002-07-23 00:17:55 +00:00
Chris Lattner d4a73fe927 *** empty log message ***
llvm-svn: 2995
2002-07-23 00:17:22 +00:00
Chris Lattner 4c1ab7f2c3 Initial checkin
llvm-svn: 2994
2002-07-23 00:17:14 +00:00
Mehwish Nagda 08580d4f91 Moved to Reoptimizer/Mapping directory
llvm-svn: 2991
2002-07-22 22:06:56 +00:00
Chris Lattner 5df56c47fc Checkin CommandLine 2.0
llvm-svn: 2982
2002-07-22 02:07:59 +00:00
Anand Shukla b3f6bfe0df changed first arg of parseBytecodeBuffer to unsigned char
llvm-svn: 2978
2002-07-21 09:31:59 +00:00
Anand Shukla dc7e934edb changed first arg og parseBytecodeBuffer to uchar
llvm-svn: 2977
2002-07-21 09:26:32 +00:00
Chris Lattner 45da3c7618 *** empty log message ***
llvm-svn: 2976
2002-07-20 08:20:00 +00:00
Chris Lattner aaac44a560 Check in the boost type_traits library, because it is now used by the CommandLine library.
llvm-svn: 2975
2002-07-20 08:19:52 +00:00
Chris Lattner c04eeaaded Rename removeDeadNodes to removeTriviallyDeadNodes
Add new removeDeadNodes method

llvm-svn: 2968
2002-07-18 18:18:40 +00:00
Chris Lattner 8211ada36a Simplify saveOrigFunctionCalls
llvm-svn: 2967
2002-07-18 16:23:02 +00:00
Vikram S. Adve 4eac78e660 Add support for a top-down propagation pass.
Each DSGraph now keeps a list of pending callers that have not
been inlined into the function represented by that graph.
It also keeps a copy of the original call nodes before the BU pass
eliminates some of them.

llvm-svn: 2965
2002-07-18 16:12:08 +00:00
Chris Lattner f31527cd6f * s/method/function
* BIG CHANGE: The root of the call "graph" is considered to be the external
  node, not the "Root".  This means that users using graph iterators like
  df_begin() will start from the external node.

llvm-svn: 2957
2002-07-18 04:42:35 +00:00
Chris Lattner c63bbd9332 First cut at implementing bottom up analysis
llvm-svn: 2944
2002-07-18 00:11:28 +00:00
Chris Lattner 24684379fb Make getelementptr ConstExpr take a vector of constants not values
llvm-svn: 2943
2002-07-18 00:11:08 +00:00
Chris Lattner 586afe7398 Fix prototype to make function.
llvm-svn: 2939
2002-07-17 21:34:20 +00:00
Mehwish Nagda bbe64808db *** empty log message ***
llvm-svn: 2912
2002-07-15 23:56:27 +00:00
Vikram S. Adve 47265143a9 Ensure ConstExpr constants are unique.
llvm-svn: 2910
2002-07-15 18:20:50 +00:00
Vikram S. Adve 249f9ad3dc Create a static version of Instruction::getOpcodeName(opCode) that
can be invoked with only an opcode (i.e., without an instruction).
Move all opCode->opCodeName translations there.

llvm-svn: 2892
2002-07-14 22:48:20 +00:00
Vikram S. Adve 83500260ae Added subclass ConstantExpr to represent expressions consructed from
constants using operators such as cast, getelementptr, add, shl, etc.
Note that a ConstantExpr can be of any type, so classof() in most
other subclasses (that discriminate by type) have to check that it
is also not a ConstantExpr.   This is why isConstantExpr() is needed.

llvm-svn: 2891
2002-07-14 22:47:54 +00:00
Vikram S. Adve eacabece8d Add a couple of virtual functions to support subclass ConstantExpr.
Note that a ConstantExpr can be of any type, so classof() in most
other subclasses (that discriminate by type) have to check that it
is also not a ConstantExpr.   This is why isConstantExpr() is needed.

llvm-svn: 2890
2002-07-14 22:46:32 +00:00
Anand Shukla ede97432ae initial version: for emitfuncs pass
llvm-svn: 2886
2002-07-12 20:28:22 +00:00
Chris Lattner 46e10fc3b9 * Nodes now keep track of any global variables contained within them
llvm-svn: 2877
2002-07-11 20:30:18 +00:00
Anand Shukla cf764680ad added std:: to vector
llvm-svn: 2874
2002-07-11 00:16:28 +00:00
Chris Lattner fdbd7241c9 New implementation of data structure analysis
This diff is completely meaningless because this is a replacement
implementation.

llvm-svn: 2872
2002-07-10 22:42:17 +00:00
Vikram S. Adve 72623d57e4 Bug fix: cast (bool) has higher precedence than %... who knew!
llvm-svn: 2864
2002-07-10 21:51:46 +00:00
Vikram S. Adve 546b6ac3e3 Add support for marking each operand as a %hh, %hm, %lm or %lo.
Represent previous bools and these ones with flags in a single byte
per operand.

llvm-svn: 2863
2002-07-10 21:50:57 +00:00
Vikram S. Adve a7f736eeea Added a few more methods for creating instructions.
llvm-svn: 2862
2002-07-10 21:49:38 +00:00
Vikram S. Adve 9423a4d0a5 Put caller-saving code *before* argument copying code!
(This file has a minor change required for this fix.)

llvm-svn: 2854
2002-07-10 21:30:17 +00:00
Vikram S. Adve 075ee8a836 Minor change in comments.
llvm-svn: 2853
2002-07-10 21:29:22 +00:00
Chris Lattner fd5e6e0fb8 Allow specifying a module for context instead of a slot calculator directly
llvm-svn: 2851
2002-07-10 16:48:14 +00:00
Anand Shukla 4ddf053a63 added std:: to hash_set
llvm-svn: 2846
2002-07-09 19:18:16 +00:00
Chris Lattner d6e237ff52 Include header in the compiler-neutral location
llvm-svn: 2843
2002-07-09 16:50:24 +00:00
Vikram S. Adve 00ee3ee0d3 cpMem<->Reg functions now support CC registers (int and FP) correctly.
A scratch register has to be provided when needed to do the copy.
Also, cpMem<->Reg functions now return a vector of machine instructions.

Added several get{Class,Type} functions.

Suggest/Color methods may modify the MachineInstr (and always did),
so don't make that argument const!

llvm-svn: 2824
2002-07-08 22:44:14 +00:00
Vikram S. Adve dc21fb7775 Interface to class MachineCodeForBasicBlock.
Moved here from MachineInstr.h to make it an annotation on BasicBlock.

llvm-svn: 2823
2002-07-08 22:40:34 +00:00
Vikram S. Adve 6c013a9689 Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.{cpp,h}.
An (explicit or implicit) operand may now be both a def and a use.
Also add a set of regs used by each instruction.
dump() no longer takes an optional argument, which doesn't work in gdb.

llvm-svn: 2821
2002-07-08 22:38:45 +00:00
Vikram S. Adve 50684c092d Added two more helper functions for instruction creation.
llvm-svn: 2819
2002-07-08 22:33:45 +00:00
Vikram S. Adve 6e792fca91 Moved MachineCodeForBB to be an annotation on BasicBlock.
llvm-svn: 2818
2002-07-08 22:31:11 +00:00
Anand Shukla bc7054b466 Add new << to allow printing modules by reference.
llvm-svn: 2814
2002-07-03 16:52:15 +00:00
Chris Lattner 03b18721be Fix comment
llvm-svn: 2803
2002-06-30 15:50:09 +00:00
Anand Shukla 949659c0e2 added include<iostream> for cerr
llvm-svn: 2800
2002-06-25 22:04:00 +00:00
Chris Lattner 2d38db3b45 We must with with GCC 2.95 :(
llvm-svn: 2787
2002-06-25 20:33:28 +00:00
Anand Shukla f1c0d920e3 changes to make it compatible with 64bit gcc
llvm-svn: 2786
2002-06-25 20:22:25 +00:00
Anand Shukla f1aafa4236 Added setSuccessor() method to terminator instructions
llvm-svn: 2784
2002-06-25 20:17:40 +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 fda72b1aad *** empty log message ***
llvm-svn: 2777
2002-06-25 16:12:52 +00:00
Chris Lattner e7779b56a0 Allow const bb's to be checked for containment in a loop
llvm-svn: 2754
2002-06-03 22:10:48 +00:00
Chris Lattner 6457590f1b Simplify the interface to local dce and constprop
llvm-svn: 2750
2002-05-26 20:18:35 +00:00
Chris Lattner abe98198a8 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.

llvm-svn: 2731
2002-05-23 15:50:03 +00:00
Chris Lattner 54474c75ec Add a new setSuccessor method to terminator instructions
llvm-svn: 2730
2002-05-23 15:48:41 +00:00
Chris Lattner d99d9d5aef Implement DataTypes.h in terms of inttypes.h
llvm-svn: 2729
2002-05-23 15:48:12 +00:00
Chris Lattner d5ed3694ae Avoid #including CommandLine.h
llvm-svn: 2710
2002-05-22 17:06:56 +00:00
Chris Lattner 5184bdc596 Implement a new command line option, -debug, which is meant to unify all of
the random debugging macros scattered throughout llvm.

The new DEBUG(x) macro should be used instead of special purpose debug macros.

llvm-svn: 2709
2002-05-22 17:06:20 +00:00
Chris Lattner 8f7b500fff Add ability to update existing variables with values read from the command line
to certain classes.  This is nice because it means that in header files we can
just declare a value, and still have that value be set based on a command-line
argument.  The difference is now that the #include of CommandLine.h does not
need to go into the header file as well.

llvm-svn: 2708
2002-05-22 17:03:05 +00:00
Chris Lattner 4b009adc77 Simplify interface to ConstantFoldTerminator
llvm-svn: 2697
2002-05-21 20:04:50 +00:00
Chris Lattner c18f65fdae Expose CFG simplification pass
llvm-svn: 2696
2002-05-21 20:04:15 +00:00
Chris Lattner 84dc8633e8 Cleanups, rename IsPowerOf2 to isPowerOf2
llvm-svn: 2662
2002-05-19 21:19:55 +00:00
Vikram S. Adve e363307e49 Added log2 for log-base-2 and also modified IsPower2 to use it.
llvm-svn: 2653
2002-05-19 15:46:52 +00:00
Vikram S. Adve 18d5a88024 Added parameter IntRegSize for standard general-purpose register size.
llvm-svn: 2652
2002-05-19 15:44:07 +00:00
Vikram S. Adve c479fd5cd9 New function CreateSignExtensionInstructions.
Methods now take MachineCodeForInstruction& as an argument and record
temporary values in it directly, instead of return the temps.
Really simplifies callers.

llvm-svn: 2651
2002-05-19 15:43:31 +00:00
Vikram S. Adve 58d578957d Many functions that returned a single MachineInstr now take a
vector of MachineInstr* to return multiple ones.

llvm-svn: 2650
2002-05-19 15:42:21 +00:00
Vikram S. Adve d379fe042a Better interface to generating machine instr for common cases
(many places still need to be updated to use this interface).

llvm-svn: 2648
2002-05-19 15:40:41 +00:00
Vikram S. Adve a98ff36ec1 MachineInstr now inherits from Annotable.
llvm-svn: 2647
2002-05-19 15:39:59 +00:00
Vikram S. Adve 1e45411a31 Annotation class for MachineInstr.
llvm-svn: 2643
2002-05-19 15:30:21 +00:00
Vikram S. Adve 8b831746be Add integer register size field.
Make all sizes and offsets uint64_t instead of uint.
Fixed GetIndexedOffset to handle mixed array and struct indices.

llvm-svn: 2641
2002-05-19 15:28:02 +00:00
Chris Lattner 3262f9406b Invoke inst has side effects!
llvm-svn: 2619
2002-05-14 04:20:25 +00:00
Chris Lattner da6743e60c Add method to check to see if two _Instructions_ dominate each other
llvm-svn: 2616
2002-05-13 22:03:16 +00:00
Chris Lattner b9f60c24d9 Add prototype for LICM pass
llvm-svn: 2612
2002-05-10 22:44:16 +00:00
Chris Lattner d5696e7125 Make sure to call the derived visit versions from the ranged iterator.
llvm-svn: 2607
2002-05-10 22:21:05 +00:00
Chris Lattner 94b4c5fe83 Add explicit abort so optimized build knows that the function does not return
llvm-svn: 2605
2002-05-10 18:53:55 +00:00
Chris Lattner e5bf51fc4f Add an explicit abort so that the optimized build knows the function does
not return.

llvm-svn: 2604
2002-05-10 18:53:21 +00:00
Chris Lattner 529ad64148 Initial checkin of Statistic class
llvm-svn: 2599
2002-05-10 15:36:56 +00:00
Chris Lattner b621decdad remove deprecated getInstType() method
llvm-svn: 2595
2002-05-10 13:28:47 +00:00
Chris Lattner f3d6e41d29 Add prototype for the PiNodeInserter pass
llvm-svn: 2592
2002-05-10 05:40:37 +00:00
Chris Lattner 5fbada2e21 Add expr reassociation pass prototype
llvm-svn: 2558
2002-05-08 22:19:01 +00:00
Sumant Kowshik cf3afd9dc5 *** empty log message ***
llvm-svn: 2552
2002-05-08 18:09:58 +00:00
Chris Lattner f1b3d4f27a Spell aggressive right
llvm-svn: 2549
2002-05-07 22:12:52 +00:00
Chris Lattner e3fdc3355a Fix misspelling
llvm-svn: 2548
2002-05-07 22:12:36 +00:00
Chris Lattner ac70e1cdd0 These files are supersumed by include/llvm/Transforms/Scalar.h
llvm-svn: 2534
2002-05-07 19:38:42 +00:00
Chris Lattner 6a74c61af3 New header file to replace all of the Scalar/*.h files.
llvm-svn: 2533
2002-05-07 19:37:18 +00:00
Chris Lattner 1ccea0a64c Checkin headers for Utils library
llvm-svn: 2528
2002-05-07 18:52:48 +00:00
Chris Lattner 1dcec05669 Cleanup implementation a bit + comments
llvm-svn: 2527
2002-05-07 18:51:44 +00:00
Chris Lattner 18409a4fb7 Update header after moving file
llvm-svn: 2522
2002-05-07 18:34:57 +00:00
Chris Lattner 6341185836 Remove long dead file
llvm-svn: 2521
2002-05-07 18:20:10 +00:00
Chris Lattner 3d3f4df710 Factor code out to the Transform Utils library
llvm-svn: 2519
2002-05-07 18:18:00 +00:00
Chris Lattner 3a7241c13e Add support for passes to announce that they only depend on the CFG of a
function.  This is crude but effective

llvm-svn: 2505
2002-05-06 19:31:16 +00:00
Chris Lattner 5576a2caff Move a bunch of code to a .cpp file, don't #include Instruction.h
llvm-svn: 2499
2002-05-06 17:54:50 +00:00
Chris Lattner feede662ad * Add getPrimitiveSize method
* Remove isPointerType, isMethodType, etc... methods.  Use isa<> instead
* Added specialization of isa for pointer types so that DerivedTypes.h doesn't
  have to be #included to use isa<PointerType>(..)

llvm-svn: 2483
2002-05-06 16:12:53 +00:00
Chris Lattner 08b2c3638d Void and Label values cannot be acted on directly so they have zero size
llvm-svn: 2481
2002-05-06 15:10:15 +00:00
Chris Lattner 940daedc22 Implement constant propogation of shift instructions
llvm-svn: 2471
2002-05-06 03:01:37 +00:00
Chris Lattner 94121c9409 Add a range remove method
llvm-svn: 2468
2002-05-06 02:59:52 +00:00
Chris Lattner fcc96e582f Implement remainder
llvm-svn: 2463
2002-05-03 21:40:37 +00:00
Chris Lattner f3dee03ba9 Make the range insert operation return an iterator, even though the STL
range insert doesn't

llvm-svn: 2413
2002-04-29 21:23:30 +00:00
Chris Lattner 09bbb5c015 Remove unused files: This is the old induction varaible cannonicalization
pass built on top of interval analysis

llvm-svn: 2411
2002-04-29 20:18:00 +00:00
Chris Lattner df159af353 Change to allow iMemory.h to avoid including DerivedTypes.h
llvm-svn: 2403
2002-04-29 18:46:22 +00:00
Chris Lattner 9550e21152 Remove analysis namespace
llvm-svn: 2399
2002-04-29 18:12:52 +00:00
Chris Lattner d5a847057b Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner 37104aace8 Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.

llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner e936e24ca4 Stub functions for timing support
llvm-svn: 2393
2002-04-29 04:02:50 +00:00
Chris Lattner a452f86593 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFG
llvm-svn: 2385
2002-04-28 21:26:51 +00:00
Chris Lattner ee2ff5da74 Move FunctionPass::doesNotModifyCFG to AnalysisUsage::preservesCFG()
llvm-svn: 2384
2002-04-28 21:25:41 +00:00
Chris Lattner 37c8667190 * Add a stub to FunctionPass so that subclasses can declare that they do not
modify the CFG.  It currently does nothing, but will in the future.
* Changes to make the public PassManager.h be MUCH smaller, and devoid of
  implementation details.  Now PassManager is just a Pimpl class that wraps
  PassManagerT<Module>, but lib/VMCore/Pass.cpp is now the only class that
  has to #include PassManagerT.h

llvm-svn: 2383
2002-04-28 20:46:05 +00:00
Chris Lattner 5cf963e3e0 Use forward decl instead of #include
llvm-svn: 2380
2002-04-28 20:40:25 +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 aa77eab129 Fix two FIXME's
llvm-svn: 2377
2002-04-28 19:49:58 +00:00
Chris Lattner 002958cdbb Remove all contents of the cfg namespace to the global namespace
llvm-svn: 2369
2002-04-28 16:19:42 +00:00
Chris Lattner 138c8a32b5 Remove obsolete namespace from example
llvm-svn: 2368
2002-04-28 16:18:32 +00:00
Chris Lattner 1b94c007dc Initial checkin of new "Internalize" pass for GCCLD
llvm-svn: 2362
2002-04-28 05:43:27 +00:00
Chris Lattner 02260eeabf SymTabValue class incorporated into Function and Module classes.
llvm-svn: 2359
2002-04-28 04:56:59 +00:00
Chris Lattner 97c1e50207 Include an operator<<, to print modules
llvm-svn: 2358
2002-04-28 04:56:28 +00:00
Chris Lattner 17e72e9bc3 Remove forward def'ns that are already in Value.h
Do not support output of Modules directly

llvm-svn: 2349
2002-04-28 04:47:33 +00:00
Chris Lattner 5833d481c0 s/Method/Function
llvm-svn: 2348
2002-04-28 04:47:06 +00:00
Chris Lattner 6b0910e99e Module's are no longer Value's.
llvm-svn: 2347
2002-04-28 04:46:29 +00:00
Chris Lattner b5bf1dc8db The interesting contents of SymTabValue were incorporated into Function
llvm-svn: 2346
2002-04-28 04:46:07 +00:00
Chris Lattner 1531f1611c * Module's are no longer Value's
* Incorporate SymTabValue contents into the Module class

llvm-svn: 2345
2002-04-28 04:45:48 +00:00
Chris Lattner 0edd8aca0b Add a forward defn for Module since it's no longer in Value.h
llvm-svn: 2344
2002-04-28 04:45:05 +00:00
Chris Lattner e472ae5df1 * Incorporate the functionality of SymTabValue into Function
* s/Method/Function

llvm-svn: 2343
2002-04-28 04:44:40 +00:00
Chris Lattner 1467f64f01 Initial checkin of simple&fast SSA based GCSE algorithm
llvm-svn: 2338
2002-04-28 00:47:11 +00:00
Chris Lattner 99b6f5cac4 Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
const BasicBlocks

llvm-svn: 2337
2002-04-28 00:15:57 +00:00
Chris Lattner f998685cd9 s/Method/Function
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner 8157a90b5d s/Method/Function in classname
llvm-svn: 2335
2002-04-27 06:59:56 +00:00
Chris Lattner 5948d72c9d Remove old file that will never be used
llvm-svn: 2334
2002-04-27 06:57:52 +00:00
Chris Lattner c8e665431b * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner 4feb6f4a31 Change the semantics of getSuccessor to FAIL if an out of range successor # is attempted.
llvm-svn: 2330
2002-04-27 03:14:12 +00:00
Chris Lattner a09451cc7b Support array allocations
llvm-svn: 2326
2002-04-27 02:27:11 +00:00
Chris Lattner 9d0e721b1d Rename getNullConstant to getNullValue
llvm-svn: 2321
2002-04-27 02:22:42 +00:00
Vikram S. Adve 7447c1b750 Added functions to compute the offset of a given incoming or outgoing
argument. These are no longer allocated as they are discovered.

llvm-svn: 2320
2002-04-25 04:48:54 +00:00
Vikram S. Adve f0a992f0de Optional args are no longer allocated as they are discovered.
(This can be improved to avoid making the initial pass over the method.)
Also, ensure automatic vars and reg. spills areas are not extended
if their sizes are used for computing some other offset.

llvm-svn: 2319
2002-04-25 04:47:26 +00:00
Chris Lattner a7d90ceccb Changes to make print pass work!
llvm-svn: 2306
2002-04-18 22:11:12 +00:00
Chris Lattner 67f206acc7 New api for signal handling for LLVM tools
llvm-svn: 2301
2002-04-18 19:53:34 +00:00
Chris Lattner 9844d8868f Remove getStrValue method from Constant implementations. The AssemblyWriter
now knows how to write out a constant, not the constants themselves.  This is
fixed due to the move of the AsmWriter to the VMcore library.

llvm-svn: 2297
2002-04-18 18:51:39 +00:00
Chris Lattner 86d9dbe8ca * Add a comment to the header giving a breif overview of how to return a
value from a visit function
* Define a (file local) DELEGATE macro to make the code easier to read/maintain
* Define per-opcode delegation functions so that users can override specific
  instances of BinaryOperator for example.

llvm-svn: 2290
2002-04-18 16:16:16 +00:00
Chris Lattner b69c81d36c * Make dtor virtual
* Add a new defaulted argument that allows the instruction visitation
  visitors to return a non-void value.

llvm-svn: 2289
2002-04-18 15:46:40 +00:00
Chris Lattner b1c0335fc7 * StoreInst's shouldn't take names (they are _always_ void type)
* Remove two methods that are not used

llvm-svn: 2281
2002-04-18 14:42:27 +00:00
Chris Lattner 116dfdd6e1 Make data structure acurately get ALL edges, even loads of null fields of
nodes that are not shadow nodes

llvm-svn: 2273
2002-04-17 03:24:47 +00:00
Chris Lattner de86c86f10 Remove the concept of a critical shadow node
llvm-svn: 2265
2002-04-16 20:39:23 +00:00
Chris Lattner 8f008c82b7 * Eliminate ArgDSNode's completely, rely now on Scalar map
llvm-svn: 2256
2002-04-16 03:41:22 +00:00
Chris Lattner ffe541feb2 * s/Method/Function
* Add/allow callbacks for module,function, & basic block visiting

llvm-svn: 2250
2002-04-15 19:32:36 +00:00
Chris Lattner 41924aad91 s/Method/Function
llvm-svn: 2246
2002-04-14 06:14:15 +00:00
Chris Lattner 10b7cb5de9 Add Module::getTypeName
llvm-svn: 2237
2002-04-13 18:58:33 +00:00
Chris Lattner 8e79dbf9bd Split the CleanupGCCOutput pass into two passes, and add real life actual
documentation on when they do.

llvm-svn: 2222
2002-04-10 20:31:22 +00:00
Chris Lattner 4eb6ad3a35 Allow a pass to obtain an analysis result for updating.
llvm-svn: 2221
2002-04-10 20:30:44 +00:00
Chris Lattner 87b84e474f Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

llvm-svn: 2217
2002-04-09 19:59:31 +00:00
Chris Lattner 34c925e22a Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

llvm-svn: 2210
2002-04-09 19:36:56 +00:00
Chris Lattner ea0d3c61f2 Use explicit .get() calls to avoid having to #include Function.h
llvm-svn: 2208
2002-04-09 19:07:44 +00:00
Chris Lattner 7922f8e7ba Use .get() explicitly and add a few extra casts to avoid 2 #includes
llvm-svn: 2204
2002-04-09 18:36:05 +00:00
Chris Lattner 7d1b67b792 Use opaque decl instead of #include
llvm-svn: 2203
2002-04-09 18:35:38 +00:00
Chris Lattner 46df9aec96 Rewrite MachineCodeForBasicBlock in terms of containment rather than
inheritance.

llvm-svn: 2200
2002-04-09 18:00:49 +00:00
Chris Lattner d4f70f5790 Free memory when done with it.
llvm-svn: 2198
2002-04-09 15:04:37 +00:00
Chris Lattner 8c7e050576 Don't leak all of the Loop objects created...
llvm-svn: 2196
2002-04-09 05:43:19 +00:00
Chris Lattner f8a9bfbc03 Move the InsertPrologEpilogCode class out of the Sparc.cpp file into the
new PrologEpilogCodeInserter.cpp file, and include the bodies of the
GetInstructionsFor(Prolog|Epilog) functions from SparcInstrSelection.cpp
into the class.  This eliminates the need for a static global vector of
instructions and a class of errors that is really unneccesary.

llvm-svn: 2194
2002-04-09 05:20:15 +00:00
Chris Lattner 8690ac124f Don't leak memory like a seive
llvm-svn: 2185
2002-04-08 23:09:07 +00:00
Chris Lattner f739fa8541 s/Method/Function
llvm-svn: 2180
2002-04-08 22:03:57 +00:00
Chris Lattner c3221463a6 * Add virtual print methods
* s/Method/Function

llvm-svn: 2172
2002-04-08 21:56:02 +00:00
Chris Lattner 810d721959 * Trim #includes
* Remove WriteToAssembly functions from interface
* Move operator<< definition to only allow top level operator<< on Value*'s.
  Defined in Value.h

This header file is greatly deemphasized by these changes.  Now it is only
used if custom printing through WriteTypeSymbolic or WriteAsOperand is needed.

llvm-svn: 2171
2002-04-08 21:55:12 +00:00
Chris Lattner 71dfc02de9 s/Method/Function
Trim #includes

llvm-svn: 2170
2002-04-08 21:52:58 +00:00