1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

1469 Commits

Author SHA1 Message Date
Chris Lattner
4c9a3f11d3 Remove dead code
llvm-svn: 2390
2002-04-28 21:57:50 +00:00
Chris Lattner
9e194d76a1 FIXME removed: malloc/alloca ALWAYS have a size argument
llvm-svn: 2389
2002-04-28 21:57:33 +00:00
Chris Lattner
c760a6a4f4 Todo has been implemented, remove it
llvm-svn: 2387
2002-04-28 21:45:02 +00:00
Chris Lattner
ec70d92221 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
llvm-svn: 2386
2002-04-28 21:27:06 +00:00
Chris Lattner
c74c58800a Move FunctionPass::doesNotModifyCFG to AnalysisUsage::preservesCFG()
llvm-svn: 2384
2002-04-28 21:25:41 +00:00
Chris Lattner
c64ef6740a * 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
f6c808bc29 Move include/llvm/PassManager.h to lib/VMCore/PassManagerT.h
llvm-svn: 2382
2002-04-28 20:42:50 +00:00
Chris Lattner
7102c8f2c9 Add #include that was removed from TargetMachine.h
llvm-svn: 2381
2002-04-28 20:40:59 +00:00
Chris Lattner
e7143ad386 Include appropriate file
llvm-svn: 2379
2002-04-28 20:40:16 +00:00
Chris Lattner
321a8cf4ba Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
e20c7411d3 Simplify and update code a bit
llvm-svn: 2376
2002-04-28 19:20:10 +00:00
Chris Lattner
50a089867d Eliminate the PromoteInstance class, incorporating it into the PromotePass
class.

llvm-svn: 2375
2002-04-28 19:12:38 +00:00
Chris Lattner
b8ade8715e Eliminate visited, CurrentValue, and WriteSets as instance variables of
PromoteInstance.  Make them local variables that are passed around as
appropriate.  Especially in the case of CurrentValue, this makes the
code simpler.

llvm-svn: 2374
2002-04-28 18:54:01 +00:00
Chris Lattner
1d9e63dca0 * Fix bug: test/Regression/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll
* Minor cleanup that was missed in last patch

llvm-svn: 2373
2002-04-28 18:39:46 +00:00
Chris Lattner
246083577b This huge changeset is a strictly cleanup change
Bugfixes will come in the next revision so that the diff is obvious.

llvm-svn: 2372
2002-04-28 18:27:55 +00:00
Chris Lattner
07fe96ca98 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace

llvm-svn: 2370
2002-04-28 16:21:30 +00:00
Chris Lattner
f043c4baac Remove all contents of the cfg namespace to the global namespace
llvm-svn: 2369
2002-04-28 16:19:42 +00:00
Chris Lattner
0431ac1783 Remove extra unused argument from CheckFailed method
Remove extraneous \n's from assert strings

llvm-svn: 2367
2002-04-28 16:06:24 +00:00
Chris Lattner
600135a049 The check to see if an external function was marked internal was not reachable!
llvm-svn: 2366
2002-04-28 16:04:26 +00:00
Chris Lattner
e5d8bd9baf Be careful not to make "external" function internal
llvm-svn: 2363
2002-04-28 05:48:34 +00:00
Chris Lattner
23e713d49d Initial checkin of new "Internalize" pass for GCCLD
llvm-svn: 2362
2002-04-28 05:43:27 +00:00
Chris Lattner
514c7b752e Minor changes to allow Modules (which are no longer Values) to work
llvm-svn: 2361
2002-04-28 05:14:06 +00:00
Chris Lattner
a903875f0f Eliminate use of SymTabValue class
llvm-svn: 2357
2002-04-28 04:55:14 +00:00
Chris Lattner
38e114c016 The contents of the SymTabValue class have been incorporated into the
Module and Function classes directly.

llvm-svn: 2356
2002-04-28 04:52:28 +00:00
Chris Lattner
602655926c * Incorporate the contents of SymTabValue into Function and Module
* Module no longer subclasses Value

llvm-svn: 2355
2002-04-28 04:51:51 +00:00
Chris Lattner
07da09cd34 Module's are no longer values
llvm-svn: 2354
2002-04-28 04:51:09 +00:00
Chris Lattner
7b48239cc1 Simplify code
Remove unneccesary getID variant for module's

llvm-svn: 2353
2002-04-28 04:50:54 +00:00
Chris Lattner
efd4654268 Remove unneccesary #include
llvm-svn: 2352
2002-04-28 04:50:19 +00:00
Chris Lattner
d7e179b25f Module's are no longer Value subclasses
llvm-svn: 2351
2002-04-28 04:50:00 +00:00
Chris Lattner
e6d056f520 Fix signed/unsigned comparison warning
llvm-svn: 2350
2002-04-28 04:49:43 +00:00
Chris Lattner
0bd57e6e99 Initial checkin of simple&fast SSA based GCSE algorithm
llvm-svn: 2338
2002-04-28 00:47:11 +00:00
Chris Lattner
741453dd60 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
2f0ee1833d s/Method/Function
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner
536cf1b13f * 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
0c04e4d1ef Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.

llvm-svn: 2332
2002-04-27 03:15:45 +00:00
Chris Lattner
0196db7833 Use the cast<> operator in favor of C style casts
llvm-svn: 2331
2002-04-27 03:14:39 +00:00
Chris Lattner
1e7147c9e9 * Change Constant::getNullConstant to Constant::getNullValue
* Add support for pool allocating array allocations of varying size

llvm-svn: 2329
2002-04-27 02:29:32 +00:00
Chris Lattner
3f7a62a960 Add support for tracking array allocations
llvm-svn: 2328
2002-04-27 02:28:41 +00:00
Chris Lattner
4e52f71340 Allow the inline limit to be modified on the commandline for debugging
llvm-svn: 2327
2002-04-27 02:27:48 +00:00
Chris Lattner
543ab06854 Trivial simplification of code
llvm-svn: 2325
2002-04-27 02:26:03 +00:00
Chris Lattner
83819833b1 * Change Constant::getNullConstant to Constant::getNullValue
* Remove some unused code

llvm-svn: 2324
2002-04-27 02:25:43 +00:00
Chris Lattner
078d292f4c Change Constant::getNullConstant to Constant::getNullValue
llvm-svn: 2323
2002-04-27 02:25:14 +00:00
Chris Lattner
dfdfae42df Simplify code a bit
llvm-svn: 2322
2002-04-27 02:24:17 +00:00
Vikram S. Adve
95b080aca1 Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.

llvm-svn: 2318
2002-04-25 04:46:28 +00:00
Vikram S. Adve
1004ba9d5f Don't pad spills and temp. stack areas for alignment.
Freeze auto vars and spill areas when their sizes are used
for computing other offsets.

llvm-svn: 2317
2002-04-25 04:43:45 +00:00
Vikram S. Adve
a9037d5d60 Major changes to how int and FP arguments are handled. Varargs
function calls were simply wrong; other functions were just not
using all available registers.

llvm-svn: 2316
2002-04-25 04:42:21 +00:00
Vikram S. Adve
10ba17d6fe Added functions to compute which register, if any, to use
for a particular argument in a list of arguments.

llvm-svn: 2315
2002-04-25 04:40:24 +00:00
Vikram S. Adve
9995ae21c2 Insert copy operations for FP arguments to a varargs function,
to copy the FP arg. to an integer.  Necessary so that the
register allocator has two different live ranges for the FP value
and the int. argument.

llvm-svn: 2314
2002-04-25 04:37:51 +00:00
Vikram S. Adve
1837d86a85 Implementation of class MachineFrameInfo.
llvm-svn: 2313
2002-04-25 04:35:27 +00:00
Vikram S. Adve
f69db4f795 Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.

llvm-svn: 2312
2002-04-25 04:34:15 +00:00
Vikram S. Adve
ad382a01be Improve printing during dumps.
llvm-svn: 2311
2002-04-25 04:31:18 +00:00
Vikram S. Adve
9f9392ec24 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: 2310
2002-04-25 04:30:43 +00:00
Chris Lattner
73791c9610 * Abort program on verification errors
* Verify that load, store, and GEP instructions indices are correct, because
  they _continually_ bite me on this pool allocations stuff

llvm-svn: 2309
2002-04-24 19:12:21 +00:00
Chris Lattner
bffa0990cf Add some basic checks of CallInst's.
Assert now returns from the current function on error.

llvm-svn: 2308
2002-04-18 22:11:52 +00:00
Chris Lattner
039edb92f3 Programs that actually free memory were broken
llvm-svn: 2307
2002-04-18 22:11:30 +00:00
Chris Lattner
60f426703d * Convert the verifier to use an InstVisitor to be better structured
* Implement checking that a binary operator's two sides are the same type
* Actually check that an instruction does not have a name if it has a void
  return type.

llvm-svn: 2305
2002-04-18 20:37:37 +00:00
Chris Lattner
37c9e90c89 Add new api for basic signal handling for tools
llvm-svn: 2302
2002-04-18 19:53:53 +00:00
Chris Lattner
8f81cd7da6 Move asmwriter/getStrValue cruft into AsmWriter.cpp file.
llvm-svn: 2300
2002-04-18 18:53:33 +00:00
Chris Lattner
f1dee31d23 Pull all of the getStrValue implementation cruft out of Constants.cpp and
put it into the AsmWriter.  This code is kinda gross and could probably be
cleaned up, but not now.

llvm-svn: 2299
2002-04-18 18:53:13 +00:00
Chris Lattner
8e2b6edf87 Add a fixme so that we don't forget this is broken.
llvm-svn: 2298
2002-04-18 18:52:03 +00:00
Chris Lattner
2789c27277 * getAsString requires that the input array is string compatible, so
assert it.
* Use WriteAsOperand instead of getStringValue for constants

llvm-svn: 2296
2002-04-18 18:15:38 +00:00
Chris Lattner
f43286a1e4 Make debugging code not use getStrValue
llvm-svn: 2295
2002-04-18 18:14:56 +00:00
Chris Lattner
e935ad94d0 Just use << isntead of forcing getStrValue
llvm-svn: 2294
2002-04-18 18:14:40 +00:00
Chris Lattner
bde9202648 Print argument scalars as ellipses instead of boxes
llvm-svn: 2293
2002-04-18 18:14:19 +00:00
Chris Lattner
a392a80a60 Significantly rework InstructionCombining to work better and to be cleaner.
We now use an InstVisitor to delegate to different cases that we are
interested in handling.  We also fix the FIXME's by adding users to the
worklist when appropriate.

llvm-svn: 2292
2002-04-18 17:39:14 +00:00
Chris Lattner
bb60c83409 Convert SCCP over to use InstVisitor instead of hand crafted switch
llvm-svn: 2286
2002-04-18 15:13:15 +00:00
Chris Lattner
e2f1e01fc1 Remove gep::isStructSelector
CTor's do not allow names anymore for StoreInst objects

llvm-svn: 2285
2002-04-18 14:44:53 +00:00
Chris Lattner
b736829547 GEP instructions can never be constant propogated.
llvm-svn: 2284
2002-04-18 14:44:13 +00:00
Chris Lattner
5e7d6d8066 Store instructions always return void, so they never get a name
llvm-svn: 2283
2002-04-18 14:43:54 +00:00
Chris Lattner
eee0e3f1f7 Correctly transform dependant arguments, allowing the perimeter bm to work.
llvm-svn: 2282
2002-04-18 14:43:30 +00:00
Chris Lattner
e4f2e7ecf4 Fix a bug printing out %c formated characters.
llvm-svn: 2277
2002-04-17 17:43:01 +00:00
Chris Lattner
a4add093c6 Inline indirect function calls that are only capable of calling one function
llvm-svn: 2275
2002-04-17 03:42:51 +00:00
Chris Lattner
59927296e4 Make data structure acurately get ALL edges, even loads of null fields of
nodes that are not shadow nodes

This fixes em3d to be _correct_ if not optimial

llvm-svn: 2274
2002-04-17 03:24:59 +00:00
Chris Lattner
04437c9749 Add casts for documentation
llvm-svn: 2272
2002-04-16 22:10:52 +00:00
Chris Lattner
68c032623c * Clean up the code a bit
* Allow structs with negative offsets.  This enables the em3d benchmark to
  be made typesafe.  In this case, the struct had an array as the first
  element, so a negative index was ok (the expr was -8 + 8x)

llvm-svn: 2271
2002-04-16 22:10:36 +00:00
Chris Lattner
f1dd584bbe Remove old frivolous uses of getStrValue in a debugging statement
llvm-svn: 2270
2002-04-16 21:36:59 +00:00
Chris Lattner
c43b279e94 Remove unneccesary cast
llvm-svn: 2269
2002-04-16 21:36:29 +00:00
Chris Lattner
10c22c6970 Changes to:
* Fix bug printing method types (oops when converting previous code)
* Move some of the code from Constant::getStrValue implementations here.
  This allows us to do a MUCH MUCH better job printing out complex constant
  values (think an array of structure pointers), because we print symbolic
  type names instead of structural.  The assistance when debugging is immense

Eventually, Constant::getStrValue should be removed (it existed before because
the asmwriter file was not in VMCore), and everyone should go through the
asmwriter that want's equivalent functionality.

llvm-svn: 2268
2002-04-16 21:36:08 +00:00
Chris Lattner
0cda7182ba * Remove the concept of a critical shadow node
* Make the function pointer argument explicit for a call nodes
* Eliminate unreachable global values
* Merge call nodes that are identical

llvm-svn: 2266
2002-04-16 20:39:59 +00:00
Chris Lattner
11f9ff83ec * Eliminate ArgDSNode's completely, now rely on scalar map
* Fold call nodes that are indistinguishable for each other.  This is a big
  win for external functions like sqrt, which would multiply dramatically
  before.
* Global nodes with no edges to or from them are now eliminated from the graph.

llvm-svn: 2257
2002-04-16 03:44:03 +00:00
Chris Lattner
c004e8f534 run an extra pass after a function has been transformed to eliminate
obviously duplicate loads of the pool base.

llvm-svn: 2255
2002-04-15 22:42:23 +00:00
Chris Lattner
9799e40136 Only print debug message if DEBUG_RA is on
llvm-svn: 2254
2002-04-15 22:41:48 +00:00
Chris Lattner
572d298aa6 Only emit message if DEBUG_RA is on
llvm-svn: 2252
2002-04-15 20:36:15 +00:00
Chris Lattner
1923a5cfaa Eliminate cast of same type instructions.
llvm-svn: 2251
2002-04-15 19:45:29 +00:00
Chris Lattner
2e20403fad * s/Method/Function
* Fix bug where the character after a % was being discarded

llvm-svn: 2248
2002-04-14 06:15:24 +00:00
Chris Lattner
983272ba58 Turn off debug output
llvm-svn: 2247
2002-04-14 06:14:41 +00:00
Chris Lattner
3b7f72e4e4 * Allow datasize to be specified on the commandline
* Build new datatypes correctly
* Transform instructions that return null pointers from functions to return
  a null index.

llvm-svn: 2244
2002-04-13 23:13:18 +00:00
Chris Lattner
0bc26610af * Fix bug: test/Regression/Verifier/2002-04-13-RetTypes.ll
* Check that arguments match the method types of the method they live in

llvm-svn: 2243
2002-04-13 22:48:46 +00:00
Chris Lattner
c0505e8d4e Minor bugfix for previous checkin
llvm-svn: 2241
2002-04-13 21:11:04 +00:00
Chris Lattner
5496a44cc2 * Remove obselete code for unsized arrays
* Add new function printTypeAtLeastOneLevel used to...
* Print the symbol table *WITH SYMBOLIC TYPES*.  Now we get:
       %tree = type { int, %tree*, %tree* }
  in the type definition section of the disassembled output instead of
       %tree = type { int, \2*, \2* }
  the different for the health benchmark and power are simply amazing.

llvm-svn: 2240
2002-04-13 20:53:41 +00:00
Chris Lattner
47b17915d5 * Give alloca's for pool descriptors better names than "pool<n>".
* Fill in the pool descriptor links in the pool descriptors.

llvm-svn: 2239
2002-04-13 19:52:54 +00:00
Chris Lattner
249f5243f1 * Add names to the symbol table for pool types and modified types
* Handle more complex structure so that power works almost
* Fix bug with pooldestroy call where we passed in the size of the object
  instead of the pool to destroy.  bisort is now pool allocated successfully!

llvm-svn: 2238
2002-04-13 19:25:57 +00:00
Chris Lattner
92b32c82bf Add Module::getTypeName
llvm-svn: 2237
2002-04-13 18:58:33 +00:00
Chris Lattner
a4bce481d6 * Clean up code to use isa & dyncast instead of poking directly into instructions
* Do not print the allocation size for a non array allocation (this used to work,
  but was broken).

llvm-svn: 2235
2002-04-13 18:34:38 +00:00
Chris Lattner
24f4497fe9 Implement function rewriting to use offsets instead of pointers in programs.
This now works with treeadd at least, and perhaps other programs as well.

llvm-svn: 2233
2002-04-12 20:23:15 +00:00
Chris Lattner
d1d6edad49 * Add comment
* Do not print a space before the * in a pointer type.

llvm-svn: 2232
2002-04-12 18:21:53 +00:00
Chris Lattner
ed2a2c0c57 Add new check of return value type matching ret instruction values types
llvm-svn: 2230
2002-04-12 18:20:49 +00:00
Chris Lattner
8584e40a86 Fix pure virtual function called exception!
llvm-svn: 2229
2002-04-12 18:19:45 +00:00
Chris Lattner
c9d79fd15f Handle the FP format problem, where outputed FP constants were not precise
enough.  This fixes compilation of the health benchmark.

llvm-svn: 2228
2002-04-11 21:44:02 +00:00
Chris Lattner
3b04124abd * Add documentation
* Split the CleanGCC pass into two passes, a global pass and an IP pass.
  Before it was just a global pass, but it did illegal things to the
  module, which broke other passes that were being scheduled with it by
  gccld.

llvm-svn: 2224
2002-04-10 20:33:11 +00:00
Chris Lattner
866bf47eff Print out what the root of the call graph is.
llvm-svn: 2223
2002-04-10 20:31:44 +00:00
Chris Lattner
150fc89dcd Implement TODO, fixing bug:
test/Regression/Transforms/LevelRaise/2002-04-09-MissedRaise.ll

llvm-svn: 2219
2002-04-09 20:53:36 +00:00
Chris Lattner
4434e03eb6 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
5e12c7caf5 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
7186b402ec Eliminate unneccesary extraneous iterators
llvm-svn: 2215
2002-04-09 19:46:27 +00:00
Chris Lattner
74e29d9b61 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

Rename some yacc type names to be more concise.  Change jump table to use
a vector instead of a list.

llvm-svn: 2214
2002-04-09 19:41:42 +00:00
Chris Lattner
a5c460d052 Update comment to reflect class name change.
llvm-svn: 2213
2002-04-09 19:40:40 +00:00
Chris Lattner
37a1b36f0a Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

Move implementation to Function.cpp

llvm-svn: 2212
2002-04-09 19:39:58 +00:00
Chris Lattner
0eb1e7c044 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

Move Argument implementation to Function.cpp

llvm-svn: 2211
2002-04-09 19:39:35 +00:00
Chris Lattner
b2038512b2 Add explicit #includes of Function.h to make up for the removed #include
in iOther.h

llvm-svn: 2209
2002-04-09 19:08:28 +00:00
Chris Lattner
7ae20d642d Add #includes to make up for #includes pruned out of header files.
llvm-svn: 2207
2002-04-09 18:37:46 +00:00
Chris Lattner
bcca3f108e Add a couple of extra casts to avoid extra #include
llvm-svn: 2206
2002-04-09 18:37:08 +00:00
Chris Lattner
b579d93f7f Add a couple of extra casts to avoid having to add #include
llvm-svn: 2205
2002-04-09 18:36:52 +00:00
Chris Lattner
fb97e6628c iUse new form of pop_back to make code more concise
llvm-svn: 2202
2002-04-09 18:02:02 +00:00
Chris Lattner
97ce718b8d No need to reserve space, erasing does not change the size of the container.
llvm-svn: 2201
2002-04-09 18:01:21 +00:00
Chris Lattner
3557e076c5 Delete NOP instructions as they are eliminated.
llvm-svn: 2199
2002-04-09 15:05:04 +00:00
Chris Lattner
119c675af7 * Add a file header with some information
* Delete the DelaySlotInfo objects created by the SchedulingManager class.
  These leaked objects were accounting for 3/4 of the memory leaked by the
  backend, so this is a relatively major win.
* Reorganize SchedulingManager::getDelaySlotInfoForInstr so that it has
  better code locality (making it easier to read).

llvm-svn: 2197
2002-04-09 05:45:58 +00:00
Chris Lattner
0a8a112014 Don't leak all of the Loop objects created...
llvm-svn: 2196
2002-04-09 05:43:19 +00:00
Chris Lattner
dbc90d1c0c * Add a useful file comment
* Move InsertPrologEpilogCode class to PrologEpilogCodeInserter.cpp
   -> Among other things, this eliminates the need for the minstrVec static
      global array.

llvm-svn: 2195
2002-04-09 05:21:26 +00:00
Chris Lattner
259b748661 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
c738b9e631 Move the InsertPrologEpilogCode class out of the Sparc.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: 2193
2002-04-09 05:18:31 +00:00
Chris Lattner
2a77170587 Include prototype for interface to PrologEpilogCodeInserter.cpp file
llvm-svn: 2192
2002-04-09 05:16:36 +00:00
Chris Lattner
5db83c9e2e Use new higher level isFloatingPoint() function
llvm-svn: 2191
2002-04-09 05:16:08 +00:00
Chris Lattner
cd23d94446 Clean up the ownership model a bit so that nodes actually get deleted more
frequently. This still leaks edges quite a bit, but it leaks no nodes
(I think).

llvm-svn: 2190
2002-04-09 05:15:33 +00:00
Chris Lattner
5f86cf1a1c * General cleanups
* In calcLiveVarSetsForBB, do not leak a ValueSet every time the function
  is called!

llvm-svn: 2189
2002-04-09 05:14:14 +00:00
Chris Lattner
ee0fa0eb15 Convert AddedInstrMapType to contain AddedInstrns by value instead of by
pointer so that they do not all get leaked!

llvm-svn: 2188
2002-04-09 05:13:04 +00:00
Chris Lattner
9a2cf06433 *blush* somehow this debugging code got checked in...
llvm-svn: 2187
2002-04-09 05:10:39 +00:00
Chris Lattner
7bc600203b GCC3.0 is reported to die without an alloca definition.
llvm-svn: 2186
2002-04-09 03:37:11 +00:00
Chris Lattner
e7a2ce6e4e Don't leak memory like a seive
llvm-svn: 2185
2002-04-08 23:09:07 +00:00
Chris Lattner
56229b8690 Value cannot be directly instantiated. I think that this code was TRYING to
make a PHI node, although it was badly broken.  This keeps tests passing, so
we'll go with it.

llvm-svn: 2184
2002-04-08 22:05:54 +00:00
Chris Lattner
ba71c8f7e1 Remove extranous #include
llvm-svn: 2183
2002-04-08 22:05:10 +00:00
Chris Lattner
c8166cec07 s/Method/Function
llvm-svn: 2180
2002-04-08 22:03:57 +00:00
Chris Lattner
5046c084ec * Narrow AsmWriter interface
* Implement Value::print methods here instead of WriteToAssembly

llvm-svn: 2179
2002-04-08 22:03:40 +00:00
Chris Lattner
31e5838296 s/Method/Function
Remove extraneous #includes of llvm/Assembly/Writer

llvm-svn: 2178
2002-04-08 22:03:00 +00:00
Chris Lattner
cd3575a5cf s/method/function
llvm-svn: 2177
2002-04-08 22:01:15 +00:00
Chris Lattner
8bfb164f22 llvm/Assembly/Writer.h is unneccesary except for extreme output
isLabelType is obsolete

llvm-svn: 2176
2002-04-08 21:59:36 +00:00
Chris Lattner
56e96eb88f isLabelType is obsolete
llvm-svn: 2175
2002-04-08 21:59:08 +00:00
Chris Lattner
0962b63d7c Play around with #includes
llvm-svn: 2174
2002-04-08 21:58:53 +00:00
Chris Lattner
49808e463c Add #includes that were pruned from already #included files
llvm-svn: 2173
2002-04-08 21:56:50 +00:00
Chris Lattner
44f14449c4 ConstantHandling moved into VMCore library
llvm-svn: 2165
2002-04-08 20:18:09 +00:00
Chris Lattner
87314d504c Library bumped up out of Assembly directory
llvm-svn: 2164
2002-04-08 20:17:06 +00:00
Chris Lattner
ea46675105 Moved assembly writer library into its own top level directory.
llvm-svn: 2162
2002-04-08 19:42:33 +00:00
Chris Lattner
7083f2bcf0 Move include/llvm/ValueHolderImpl.h to lib/VMCore/ValueHolderImpl.h
llvm-svn: 2156
2002-04-08 00:15:29 +00:00
Chris Lattner
137fa92dce * 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
8b16900b1b Remove asmwriter library from link line, because the useful contents of it
have been incorporated into the vmcore library.

llvm-svn: 2153
2002-04-07 22:35:30 +00:00
Chris Lattner
0b712a046b Remove some gross code by using the Value::dump method to do debug dumps
llvm-svn: 2150
2002-04-07 22:33:13 +00:00
Chris Lattner
47f1f0e588 Remove some gross code by using the VAlue::dump method to do debug dumps
llvm-svn: 2149
2002-04-07 22:32:25 +00:00
Chris Lattner
c994519230 Update comments
Implement Value::dump here.

llvm-svn: 2148
2002-04-07 22:31:46 +00:00
Chris Lattner
0cfa70b083 Eliminate explicit use of Writer library, using debug dump output instead.
llvm-svn: 2147
2002-04-07 22:31:23 +00:00
Chris Lattner
bc15ae64dd 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
96135c924f Fix Bug: test/Regression/Other/2002-04-07-InfConstant.ll
llvm-svn: 2142
2002-04-07 08:42:53 +00:00
Chris Lattner
1c83a4a20c Fix bug: test/Regression/Other/2002-04-07-HexFloatConstants.ll
llvm-svn: 2141
2002-04-07 08:37:11 +00:00
Chris Lattner
9dfa62172d Add a better comment to explain what is going on.
llvm-svn: 2139
2002-04-07 08:31:26 +00:00
Chris Lattner
7413f64df2 Remove debugging code accidentally checked in!
llvm-svn: 2137
2002-04-07 08:13:29 +00:00
Chris Lattner
c6c7c99011 Add support for hexadecimal FP constants!
llvm-svn: 2135
2002-04-07 08:10:41 +00:00
Chris Lattner
e7b5d159c5 Implement constant propogation of multiply and divide instructions!!
llvm-svn: 2134
2002-04-07 08:10:14 +00:00
Chris Lattner
d81ca8a752 * Make all of the refineAbstractType functions work identically
* Remove ambiguous code that caused problems with understanding how stuff
  worked.
* Implement DerivedType::typeIsRefined right.  Add a big comment talking
  about it.
* The removeUserFromConcrete method already checks to see if the type is
  not abstract, so no need to duplicate the test all over this code

This checkin makes all of the type parsing related failures work.  All
Assembler Regression tests now pass!

llvm-svn: 2127
2002-04-07 06:14:56 +00:00
Chris Lattner
ff6ec9b552 Enable better debug output. When debugging the type system, print out the
type tables after reading a bytecode file to make sure they are ok

llvm-svn: 2126
2002-04-07 06:11:22 +00:00
Chris Lattner
35c1a4347b * Reenable apparently neccesary code, that breaks testcases when enabled,
but causes MANY FUNDAMENTAL PROBLEMS when not enabled. :(
* Add debugging function

llvm-svn: 2125
2002-04-06 00:21:11 +00:00
Chris Lattner
83b6eecc84 * FIX: test/Regression/Assembler/2002-02-19-TypeParsing.ll
That was due to the StructType object not getting called multiple times
   to remove itself from the ATU list for an object, because it stopped
   getting queried due to this wrong test

* Improve debug output when DEBUG_MERGE_TYPES is on

llvm-svn: 2124
2002-04-05 23:02:46 +00:00
Chris Lattner
68857bb2bf * Move DerivedType::addAbstractTypeUser from DerivedType.h
* Refactor a bunch of code.  Types now only remove one subelement at a time
  when they are told that they have changed
* Improve debugging output, add more assertions...
* FIX Bugs:
  * test/Regression/Assembler/2002-04-04-PureVirtMethCall.ll
  * test/Regression/Assembler/2002-04-04-PureVirtMethCall2.ll
  * The change to fix these bugs was the to ValTypeBase::refineAbstractType
    method.  Basically we #if 0'd out the chunk of code there and make the
    table get reorganized EVEN IF the type has the same pointer.  Merging
    opportunities were being missed!

llvm-svn: 2121
2002-04-05 22:25:26 +00:00
Chris Lattner
3b80438423 Clean up debugging code
llvm-svn: 2119
2002-04-05 19:53:06 +00:00
Chris Lattner
e105f97672 * Refactor loop in removeAbstractTypeUser to be more clear
* Fix a bug in DerivedType::refineAbstractTypeTo that caused
  test/Regression/Assembler/2002-04-05-TypeParsing.ll to fail.
  The added comment describes the fix

llvm-svn: 2118
2002-04-05 19:44:07 +00:00
Chris Lattner
8afff0c29a s/MethodType/FunctionType
llvm-svn: 2115
2002-04-04 22:19:18 +00:00
Chris Lattner
39d7d981ed Make build work in release mode
llvm-svn: 2113
2002-04-04 19:35:24 +00:00
Chris Lattner
ffc9ef8be9 Make the release build work
llvm-svn: 2109
2002-04-04 19:26:26 +00:00
Chris Lattner
87cabdd757 * Add debug support for PATypeHolder
* PATypeHolder is now not a template

llvm-svn: 2108
2002-04-04 19:26:02 +00:00
Chris Lattner
a0a6c8d4a2 Make the release build compile
llvm-svn: 2107
2002-04-04 19:24:48 +00:00
Chris Lattner
1ee6bf5249 PATypeHolder is now not a template
llvm-svn: 2106
2002-04-04 19:24:34 +00:00
Chris Lattner
798be9a43a Add debug support
llvm-svn: 2105
2002-04-04 19:24:11 +00:00
Chris Lattner
78b786813b * Make PATypeHolder not take a type argument
* Eliminate by inlining the old newTH, newTH, and TypeDone functions
* OPAQUE is now just a token that gets returned by the lexer, not a type
  Parser now creates type, not lexer

llvm-svn: 2104
2002-04-04 19:23:55 +00:00
Chris Lattner
feeac9c7ea Lexer doesn't create typehandle gross stuff now, parser does.
llvm-svn: 2103
2002-04-04 19:22:17 +00:00
Chris Lattner
5cbfde5744 Call nodes are never equivalent
Shadow nodes are never critical.

llvm-svn: 2102
2002-04-04 19:21:51 +00:00
Chris Lattner
d4c7ce8d78 Add hack to get timing of analysis
llvm-svn: 2101
2002-04-04 19:21:27 +00:00
Chris Lattner
3b604e846a * Eliminate commented out code
* Do not demand a shadow node when resolving
* Raise arbitrary inline limit

llvm-svn: 2100
2002-04-04 19:21:06 +00:00
Chris Lattner
19689af3bb Support resolving function arguments/return values to pointers that index
into other objects.

llvm-svn: 2094
2002-04-01 22:20:48 +00:00
Vikram S. Adve
0035fcbea1 Case numbers were not updated when Sparc.burg.in was changed
to add separate label for bitwise NOT operator.

llvm-svn: 2091
2002-04-01 20:28:48 +00:00
Chris Lattner
0f0829f28d Add a new replaceWith method useful for replacing instructions
llvm-svn: 2088
2002-04-01 17:52:16 +00:00
Chris Lattner
2e3a4dece6 Allow scalars that point to multiple nodes when building the scalar map.
llvm-svn: 2087
2002-04-01 01:26:53 +00:00
Chris Lattner
99da111daf Add extra case here to avoid getting spurious output
llvm-svn: 2086
2002-04-01 00:45:33 +00:00
Chris Lattner
62756e4208 Avoid incorrectly adding null values to the scalar map!
llvm-svn: 2085
2002-04-01 00:45:09 +00:00
Chris Lattner
e66e651b68 Critical shadow nodes no do not know their parent explictly.
llvm-svn: 2084
2002-04-01 00:15:30 +00:00
Chris Lattner
61f6065cef Minor cleanups (use dyn_cast instead of testing manually)
Shadow nodes now don't explicitly know their parent.

llvm-svn: 2083
2002-04-01 00:14:41 +00:00
Chris Lattner
a68c92a3d4 Allow merging of identical call nodes. Make the shadow node pointed to
by the call node noncritical before the call is destroyed.

llvm-svn: 2082
2002-04-01 00:13:56 +00:00
Chris Lattner
f9097b54be Increase limit for perimeter
llvm-svn: 2081
2002-04-01 00:12:58 +00:00
Chris Lattner
42145d8a25 Unify the destruction code used for node pairs vs normal nodes. This was
causing a problem before because global values with incoming edges didn't
copy the incoming edges to the node they were being merged from, causing
the poolalloc pass to die.

llvm-svn: 2079
2002-03-31 19:57:44 +00:00
Vikram S. Adve
e665a992a9 1. Fix a leftover bug in generating memory instructions.
2. Fix type used for TmpInstruction holding the return address.

llvm-svn: 2075
2002-03-31 19:07:35 +00:00
Vikram S. Adve
257e4d18da Added function getCallInstIndirectAddrVal() to set call interference
for that value.

llvm-svn: 2074
2002-03-31 19:04:50 +00:00
Vikram S. Adve
8efa40ac63 Minor cleanup in printing constants. I think this included a bug
fix related to putting a read-write variable in a read-only section,
but I'm not sure now.

llvm-svn: 2073
2002-03-31 19:03:58 +00:00
Vikram S. Adve
44ee4184e4 Add method clearCallInterference().
llvm-svn: 2071
2002-03-31 18:58:14 +00:00
Vikram S. Adve
c2c33ba3fd Include temp. values when computing max. size of stack frame!
llvm-svn: 2070
2002-03-31 18:57:49 +00:00
Vikram S. Adve
1e6ab6f476 Fix a bug in previous bug fix.
llvm-svn: 2069
2002-03-31 18:56:51 +00:00
Vikram S. Adve
fbdd533059 Bug fix: address used by indirect call instruction should also
be marked as having a Call Interference, even though it may not
be live after the call.

llvm-svn: 2068
2002-03-31 18:54:37 +00:00
Chris Lattner
c620b825b6 Add debug output
llvm-svn: 2066
2002-03-31 07:17:46 +00:00
Chris Lattner
164b766137 * Fix nondeleted type handle which could cause type pool corruption (and
a memory leak)
* Fix memory leak of Argument nodes on function prototypes

llvm-svn: 2065
2002-03-31 07:16:49 +00:00
Chris Lattner
8528806b33 * Move the isEquivalentTo implementations here. They can probably be put
someplace nicer in the file though.
* Add new dump method for debugging

llvm-svn: 2064
2002-03-31 07:16:08 +00:00
Chris Lattner
d2c39a02f7 Print out the instruction instead of just the address!
llvm-svn: 2063
2002-03-31 07:15:20 +00:00
Chris Lattner
aba1ef6fc9 * Move isEquivalentTo implementations to NodeImpl
* Implement a new form of node folding to catch cases missed in Addtree
* Add removeIndistinguishableNodePairs to merge calls (todo) and globals

llvm-svn: 2062
2002-03-31 07:14:52 +00:00
Chris Lattner
f1a2a9c168 * Convert CallMap to be a vector, because the keys can change, and the map
doesn't resort!
* Be more generous with the cached matches that we allow now.
* Recursive calls should all work now!

llvm-svn: 2061
2002-03-31 07:13:27 +00:00
Vikram S. Adve
f057ff78fb Fix CreateUIntSetInstruction() to handle sign extensions correctly.
llvm-svn: 2059
2002-03-31 00:13:12 +00:00