Commit Graph

725 Commits

Author SHA1 Message Date
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
Chris Lattner fb7aae5798 Trim #includes
llvm-svn: 2169
2002-04-08 21:52:32 +00:00
Chris Lattner 3e65082b84 * Move casting stuff out to Support/Casting.h
* Add top level virtual print function, disallows instantiating Value's
  directly.
* Provide operator<< for values here, instead of in Assembly/Writer.h

llvm-svn: 2168
2002-04-08 21:51:32 +00:00
Chris Lattner c8b2aad1de * Fix comment
* Add printing support
* add isFloatingPoint method
* Remove isXXXType() methods for non-derived types

llvm-svn: 2167
2002-04-08 21:50:15 +00:00
Chris Lattner 98728f7021 Pull casting operators out of Value.h
llvm-svn: 2166
2002-04-08 21:43:56 +00:00
Chris Lattner 8c9927e762 Minor change to reflect that ConstantHandling is now part of VMCore
llvm-svn: 2163
2002-04-08 20:15:12 +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 6a3d2f3598 VCG output support removed because it was broken and will never be used.
llvm-svn: 2146
2002-04-07 22:30:17 +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 53a46fb759 Source base has been completely changed over to use Function instead of Method, this file is not obsolete.
llvm-svn: 2143
2002-04-07 20:46:56 +00:00
Chris Lattner 2e183b5c44 Add new function utohexstr.
llvm-svn: 2140
2002-04-07 08:36:19 +00:00
Chris Lattner af259a7f91 Implement constant propogation of multiply and divide instructions!!
llvm-svn: 2134
2002-04-07 08:10:14 +00:00
Chris Lattner f33ce864e1 * Delete getNumAbstractTypeUsers method
* Move addAbstractTypeUser method to Type.cpp

llvm-svn: 2120
2002-04-05 22:21:08 +00:00
Chris Lattner e2f2f54f0c s/MethodType/FunctionType
llvm-svn: 2115
2002-04-04 22:19:18 +00:00
Chris Lattner e17c1fde83 Remove backwards compatibility code
llvm-svn: 2114
2002-04-04 22:04:45 +00:00
Chris Lattner 0e9fa3a509 Deparameterize PATypeHolder
llvm-svn: 2099
2002-04-04 19:20:18 +00:00
Chris Lattner 16381517e3 Add method to get # nodes in the graph
llvm-svn: 2098
2002-04-04 19:20:00 +00:00
Chris Lattner 08a6e84038 Make the release build work
llvm-svn: 2097
2002-04-04 19:19:27 +00:00
Chris Lattner e92d7b4289 Fix the release build
llvm-svn: 2096
2002-04-04 19:18:17 +00:00
Chris Lattner 35ef4a1431 * Add dump() virtual function to AbstractType user to help track down bugs
* PATypeHolder is now a nontemplated class, because it was (almost) only
  ever instantiated with 'Type' as the parameter.

llvm-svn: 2095
2002-04-04 19:18:00 +00:00
Chris Lattner 8cb8e4608c Add a new replaceWith method useful for replacing instructions
llvm-svn: 2088
2002-04-01 17:52:16 +00:00
Chris Lattner 71fc90439b Shadow nodes don't need to know their explicit parent, they just need to
know what type to be.

llvm-svn: 2080
2002-04-01 00:12:36 +00:00
Vikram S. Adve 429621cad0 Add method getCallInstIndirectAddrVal() to add call interference
for this value.

llvm-svn: 2072
2002-03-31 18:58:49 +00:00
Vikram S. Adve f434a9ed5f Include temp. values when computing max. size of stack frame!
llvm-svn: 2070
2002-03-31 18:57:49 +00:00
Chris Lattner aeef4cbb21 * Allow access to DSNode iterator as DSNode::iterator/begin/end
* Add debugging "dump" method to DSNode
* Fix bugs in DSNode iterator

llvm-svn: 2060
2002-03-31 07:11:20 +00:00
Chris Lattner a84b29784e Initial checkin of file:
Define an iterator to operate over data structure outgoing links and
graph implementation so generic graph functions can be used.

llvm-svn: 2057
2002-03-30 09:13:23 +00:00