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

1646 Commits

Author SHA1 Message Date
Chris Lattner
bbd002a9ca The implementation keyword is no longer neccesary
llvm-svn: 2434
2002-05-02 19:11:29 +00:00
Chris Lattner
7af6cac869 The "implementation" is now allowed but not required by the parser. All type
definitions must still occur before function bodies, but the wierd keyword is
no longer neccesary.

llvm-svn: 2433
2002-05-02 19:11:13 +00:00
Chris Lattner
6212dd5c08 ExprTypeConvert will already do this transformation, no need to specialize
it here.

llvm-svn: 2431
2002-05-02 17:38:55 +00:00
Chris Lattner
2c44e5bca3 Be a little more efficient, do not generate loads and stores with indices in them.
llvm-svn: 2430
2002-05-02 17:38:14 +00:00
Chris Lattner
66f5b12141 Fix bug: test/Regression/Transforms/LevelRaise/2002-05-02-BadCastElimination.ll
llvm-svn: 2429
2002-05-02 17:37:34 +00:00
Chris Lattner
b7df910c1a * Add ability to eliminate a bunch of different cascading cast variations
* Allow elimination of getelementptr X, uint 0 (which is a noop)

llvm-svn: 2428
2002-05-02 17:06:02 +00:00
Chris Lattner
8a6104c3cb Fixed bug: test/Regression/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
llvm-svn: 2423
2002-05-01 15:38:23 +00:00
Chris Lattner
5879b0928b Remove unneccesary pass
llvm-svn: 2420
2002-04-30 20:52:49 +00:00
Chris Lattner
8eb37c77d6 Fix problem where subpasses would invalidate all analyses outstanding
llvm-svn: 2418
2002-04-30 18:50:17 +00:00
Chris Lattner
a6cb49c533 Add folding rules for mul X, 0 and mul X, 2
llvm-svn: 2417
2002-04-29 22:24:47 +00:00
Chris Lattner
5d1ac4dbc9 Significantly clean up SCCP pass. Now the two classes are merged and in
an anonymous namespace where they belong.

llvm-svn: 2415
2002-04-29 21:26:08 +00:00
Chris Lattner
48e73edf57 Range insertion now returns an iterator
llvm-svn: 2414
2002-04-29 21:25:34 +00:00
Chris Lattner
2716e9868c 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
5d17e49ad5 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
4968cc38aa Fix for problem when allocating something like this:
malloc(100-i);

llvm-svn: 2409
2002-04-29 20:09:21 +00:00
Chris Lattner
05a37c1dae Fix #include broken by iMemory.h not including DerivedTypes.h
llvm-svn: 2407
2002-04-29 18:56:45 +00:00
Chris Lattner
ba813cb36f Add neccesary #include
llvm-svn: 2406
2002-04-29 18:48:55 +00:00
Chris Lattner
f5d07697e6 changes because iMemory.h no longer #includes DerivedTypes.h
This only requires Type.h anyway

llvm-svn: 2405
2002-04-29 18:48:30 +00:00
Chris Lattner
a2c59f1302 Changes so that iMemory.h doesn't include DerivedTypes.h
llvm-svn: 2404
2002-04-29 18:46:50 +00:00
Chris Lattner
9468519f34 Fix bug: test/Regression/Other/2002-04-29-NameBinding.ll
llvm-svn: 2402
2002-04-29 18:25:33 +00:00
Chris Lattner
cfc512e714 Eliminate dead global variables
llvm-svn: 2400
2002-04-29 18:13:11 +00:00
Chris Lattner
96e0c48175 Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
3909059b6a Remove broken assertion.
llvm-svn: 2396
2002-04-29 16:20:25 +00:00
Chris Lattner
589debc4ba 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
6285ebca7d Add a new command line option for PassManager using utilities.
Now for llc, gccas, analyze, opt, etc you can specify the -time-passes
command line option that outputs a timing summary report that indicates
how long each pass takes to execute.

llvm-svn: 2394
2002-04-29 04:04:29 +00:00
Chris Lattner
56828a18c4 More cleanups
llvm-svn: 2392
2002-04-29 01:58:47 +00:00
Chris Lattner
a8688d69c5 Code cleanups
llvm-svn: 2391
2002-04-29 01:22:55 +00:00
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
Chris Lattner
4c4a273f43 * Catch and ignore (for now) return instructions in tranformed functions
* Add more debugging output
* Fix problems refering to wrong versions of various graphs
* Build the pool descriptor map!
* Clear the nodemapping map after building pool descriptor to avoid assert
* Transform the NEw function body, not the old one...
* Matrix.ll now works!

llvm-svn: 2058
2002-03-30 20:53:14 +00:00
Chris Lattner
410c6394d3 * Clean up data structures [AllocDSNode -> DSNode]
* TransformFunctionInfo now has call field form field mapping.  May be
  removed in the future.
* Moved the computation of "Scalars" into transformFunctionBody so
  transformFunction didn't have to recompute it.
* Implement the node mapping calculation in preparation to calculate
  PoolDescriptors to pass to transformFunctionBody
* Print out the node mapping [it looks right!]
* Other minor changes

llvm-svn: 2056
2002-03-30 09:12:35 +00:00
Chris Lattner
36d50d01ab Maintain enough information so that the pools for all of the nodes of
the graph can be passed around.

llvm-svn: 2053
2002-03-30 04:02:31 +00:00
Chris Lattner
a4b9a9f573 Implement the first batch of transformations to the methods. So far it:
* Converts malloc instructions to poolalloc
 * Converts free instructions to poolfree
 * Convert calls to call the new cloned hacked up versions

Note that this does not modify hacked up stuff yet, just the top level
function

llvm-svn: 2052
2002-03-29 21:25:19 +00:00
Chris Lattner
c7df07c3f8 * s/Method/Function
* Implement a check to make sure a function is not internal and external
  at the same time

llvm-svn: 2050
2002-03-29 19:06:18 +00:00
Chris Lattner
9166ac0b3f Correctly clone the function with the extra argument types. Now we need
to modify the function next.

This also properly recycles functions so that we don't get exponential
code blowup in the common case.

llvm-svn: 2049
2002-03-29 19:05:48 +00:00
Chris Lattner
b6b7c3fe60 s/Method/Function
llvm-svn: 2048
2002-03-29 19:04:45 +00:00
Chris Lattner
57dd5ed245 New clone function routine
llvm-svn: 2045
2002-03-29 19:03:54 +00:00
Chris Lattner
6b1ce137c2 Find out which calls in the function we need to transform and how.
Next step is to start hacking functions up.

llvm-svn: 2044
2002-03-29 17:13:46 +00:00
Chris Lattner
5df9c977e1 s/Method/Function
llvm-svn: 2043
2002-03-29 17:08:29 +00:00
Chris Lattner
3a9f1dd66a Modularize code a bit
llvm-svn: 2040
2002-03-29 06:21:38 +00:00
Chris Lattner
7c2529076a Implement the first step of pool allocation - Creating, initialization, and
destruction of the pools.

llvm-svn: 2039
2002-03-29 05:50:20 +00:00
Chris Lattner
18cc6a9277 Add an insert method to VAlueHolder to allow batch insertion
llvm-svn: 2038
2002-03-29 05:49:37 +00:00
Chris Lattner
474495e742 Add new addTypeName method to Module class
llvm-svn: 2037
2002-03-29 04:48:40 +00:00
Chris Lattner
dc0566e721 s/Method/Function
llvm-svn: 2036
2002-03-29 03:57:15 +00:00
Chris Lattner
8c98acc07f s/Method/Function
llvm-svn: 2035
2002-03-29 03:51:11 +00:00
Chris Lattner
084601e6f4 s/Method/Function
llvm-svn: 2034
2002-03-29 03:44:36 +00:00
Chris Lattner
c32e9901b1 Implement new getFunction and getOrInsertFunction methods
llvm-svn: 2033
2002-03-29 03:44:18 +00:00
Chris Lattner
a2d3c99dfc Simplify code a bit by using Module::getOrInsertFunction
llvm-svn: 2032
2002-03-29 03:43:24 +00:00
Chris Lattner
815e2f4daa Flesh out a bunch more code, print allocations that are poolable.
llvm-svn: 2031
2002-03-29 03:40:59 +00:00
Chris Lattner
e46e35806a s/method/function
llvm-svn: 2030
2002-03-29 03:40:25 +00:00
Chris Lattner
4ca6fd00f2 s/Method/Function/g
llvm-svn: 2029
2002-03-29 03:39:36 +00:00
Chris Lattner
b7f4043df7 Simplify code a lot by using the Module::getFunction & getOrInsertFunction
llvm-svn: 2028
2002-03-29 03:38:05 +00:00
Chris Lattner
ab9cc61ceb Remove the reduceApply functions they are obsolete things from the days before
we had a reasonable pass system

llvm-svn: 2022
2002-03-28 22:49:49 +00:00
Chris Lattner
cab0ce8244 Implement getEscapingAllocations & getNonEscapingAllocations
llvm-svn: 2021
2002-03-28 19:33:00 +00:00
Chris Lattner
513ecd7256 * Rename UnlinkUndistinguishableShadowNodes & RemoveUnreachableShadowNodes
to reflect that they can eliminate arbitrary nodes.
* Rename the ShadowNodeEliminate.cpp file to EliminateNodes.cpp for the
  same reason

llvm-svn: 2020
2002-03-28 19:16:48 +00:00
Chris Lattner
fa67ad938c Ooops, I did such a great job pruning nodes, that I accidentally deleted
ALL allocation nodes... hrm... bad.

llvm-svn: 2018
2002-03-28 18:38:38 +00:00
Chris Lattner
0336a78488 Initial checkin of Noop pass that will be the pool allocator
llvm-svn: 2014
2002-03-28 18:08:31 +00:00
Chris Lattner
55186e7abf Many changes
* Simplify a lot of the inlining stuff.  There are still problems, but not
  many
* Break up the Function representation to have a vector for every different
  node type so it is fast to find nodes of a particular flavor.
* Do more intelligent merging of call values
* Allow elimination of unreachable shadow and allocation nodes
* Generalize indistinguishability testing to allow merging of identical calls.
* Increase shadow node merging power

llvm-svn: 2010
2002-03-28 17:56:03 +00:00
Cameron Buschardt
49c09d5b24 * Move classes around
* rename constructor function
* Move stuff into anonymous namespaces

llvm-svn: 2007
2002-03-27 23:28:40 +00:00
Cameron Buschardt
bcff69b0f4 Implemented promote mem->reg pass.
llvm-svn: 2005
2002-03-27 23:17:37 +00:00
Chris Lattner
d771725ed1 * Add #define to enabled debug messages
* Move removeEdgesTo to be a member of DSNode
* Implement (but #ifdef out) the new, spiffier, method of determining
  shadow node equivalence.  This cannot be enabled until more is
  implemented.

llvm-svn: 2004
2002-03-27 19:48:03 +00:00
Chris Lattner
4c6e9cda3f * Implement DSNode::removeAllIncomingEdges
* Implement Critical Shadow node handling
* Implement routines to determine whether an allocation node is a malloc
  or alloca

llvm-svn: 2003
2002-03-27 19:46:05 +00:00
Chris Lattner
a16c85b43d * Add critical node support
* Optimize graph after building it.  This should be unneccesary in the future

llvm-svn: 2002
2002-03-27 19:45:12 +00:00
Chris Lattner
9aff5a8047 * Destroy alloca nodes when a graph gets inlined
* Add links to all subtrees when a shadow node gets resolved
* Add critical node handling

llvm-svn: 2001
2002-03-27 19:44:33 +00:00
Chris Lattner
2a3d6c83ff * Optimizers return true on change
* Implement indistinguishable shadow node elimination

llvm-svn: 1999
2002-03-27 00:55:13 +00:00
Chris Lattner
ae0192e2f6 Fix long line
llvm-svn: 1998
2002-03-27 00:54:31 +00:00
Chris Lattner
8a44f81684 * Because of optimization, the shadow nodes between arguments might get
removed.  Check to see if they are there.
* Repeat optimizations while changing

llvm-svn: 1997
2002-03-27 00:53:57 +00:00
Chris Lattner
d5b115e687 Initial checkin of Datastructure analysis.
Has bugs, but shouldn't crash in theory.

llvm-svn: 1994
2002-03-26 22:39:06 +00:00
Chris Lattner
18073550b8 Change from Method to Function
llvm-svn: 1992
2002-03-26 18:02:30 +00:00
Chris Lattner
849c762b02 Change references from Method to Function
change references from MethodARgument to FunctionArgument

llvm-svn: 1991
2002-03-26 18:01:55 +00:00
Chris Lattner
8972179a78 Convert to use new style casts instead of direct checking
llvm-svn: 1990
2002-03-26 17:58:12 +00:00
Chris Lattner
57efd6ffd1 change refs to Method to Function
Change references to MEthodArgument to FunctionArgument

llvm-svn: 1989
2002-03-26 17:55:33 +00:00
Vikram S. Adve
bd1e4e8bd8 Moved to directory Scalar/ and renamed.
llvm-svn: 1977
2002-03-24 03:55:06 +00:00
Vikram S. Adve
3dfd5b888b Destroy MethodLiveVarInfo after register allocation.
llvm-svn: 1976
2002-03-24 03:54:03 +00:00
Vikram S. Adve
fa2ed7e6b1 Use deterministic iterator for SchedGraphs. This is actually not
useful right now when we only do local scheduling.

llvm-svn: 1975
2002-03-24 03:53:03 +00:00
Vikram S. Adve
058ec11ea3 Bug fix: nextToTry was not being initialized in one case.
llvm-svn: 1974
2002-03-24 03:46:15 +00:00
Vikram S. Adve
37d44e7de9 Add option to disable scheduling.
llvm-svn: 1973
2002-03-24 03:45:35 +00:00
Vikram S. Adve
0cdcf40121 Add option to disable scheduling.
Destroy live-variable information after scheduling so it is
recomputed before later phases (e.g., reg. allocation).
Use deterministic iterator to enumerate sched graphs.

llvm-svn: 1972
2002-03-24 03:44:55 +00:00
Vikram S. Adve
d18a1cc9fb Minor changes.
llvm-svn: 1971
2002-03-24 03:40:59 +00:00
Vikram S. Adve
e06cac463f Re-fix bug: Put back MachineCodeForInstruction::dropAllReferences.
llvm-svn: 1970
2002-03-24 03:40:11 +00:00
Vikram S. Adve
b347d2796c Fix padding for variables allocated on stack.
llvm-svn: 1969
2002-03-24 03:39:26 +00:00
Vikram S. Adve
34306e0e1c Major overhaul to FoldGetElemPtr to handle mixed array and struct refs.
llvm-svn: 1968
2002-03-24 03:37:53 +00:00
Vikram S. Adve
8493ae74b2 Use deterministic iterator for treeRoots.
llvm-svn: 1967
2002-03-24 03:36:52 +00:00
Vikram S. Adve
8ada4c031e Bug re-fix: put back MachineCodeForInstruction::get(*I).dropAllReferences().
Also re-enable instr. scheduling pass.

llvm-svn: 1966
2002-03-24 03:35:16 +00:00
Vikram S. Adve
7b84ec22d8 Change latencies for Load, Store and Branch instructions.
llvm-svn: 1965
2002-03-24 03:33:53 +00:00
Vikram S. Adve
57d735db7a Major enhancements to how array and structure indices are handled.
Improve checking for constants in Multiply.
Simpler method to keep track of when a node is folded into its parent.
Several other bug fixes.

llvm-svn: 1964
2002-03-24 03:33:02 +00:00
Vikram S. Adve
a141a7190b Change treeRoots data structure to make enumeration deterministic.
llvm-svn: 1962
2002-03-24 03:24:00 +00:00
Vikram S. Adve
1f5e8f93cc Major overhaul to support arbitrary mixed array and structure indices.
Also moved to the Scalar/ directory and renamed to "MultiDim".

llvm-svn: 1961
2002-03-24 03:21:18 +00:00
Chris Lattner
c481e92886 Rename Method to Function
llvm-svn: 1957
2002-03-23 22:51:58 +00:00
Vikram S. Adve
3294262573 New pass to decompose multi-dimensional array references into
a sequence of 1-D references, using a sequence of getElementPtrs.

llvm-svn: 1948
2002-03-23 20:43:39 +00:00
Chris Lattner
0b9734b293 Add an assertion that would hopefully catch a problem that was tripping
cameron up

llvm-svn: 1944
2002-03-22 18:01:58 +00:00
Chris Lattner
2ed4beefea Fix bug test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise3.ll
llvm-svn: 1943
2002-03-21 23:02:37 +00:00
Chris Lattner
ad241cc3ea Fix test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll
llvm-svn: 1941
2002-03-21 22:39:59 +00:00
Chris Lattner
8051e7c953 * AllocationInst ctor moved here from iMemory.h
* AllocationInst now always has an array size operand

llvm-svn: 1939
2002-03-21 22:37:48 +00:00
Chris Lattner
a80b65c208 Fix test/Regression/Other/2002-03-21-LevelRaiseMiss.ll
llvm-svn: 1933
2002-03-21 21:21:13 +00:00
Chris Lattner
c2b5cb5619 Make ConvertableToGEP handle cases where the user is indexing into the
first element of a structure type.  Before this would not be handled because
getStructOffset would either stop immediately (because StopEarly was true
and Offset = 0), or blast past the level we wanted.

Now ConvertableToGEP steps down through the type one level at a time, checking
the Offset and Scale conditions at each step

llvm-svn: 1931
2002-03-21 06:27:20 +00:00
Chris Lattner
559c71f6f4 Implement the new InsertInstBeforeInst function
llvm-svn: 1930
2002-03-21 06:24:00 +00:00
Chris Lattner
14fe793707 Fix the: test/Regression/Other/2002-03-20-LevelRaiseCrash.ll bug. It turned
out that almost always the result of the add was the same as the GEP that
would be generated.  In this case, however, it wasn't, so bad things happened.

llvm-svn: 1929
2002-03-21 06:22:23 +00:00
Chris Lattner
e9ec6058e4 Declare the new InsertInstBeforeInst function
llvm-svn: 1927
2002-03-21 06:15:53 +00:00
Chris Lattner
ceb4e429a2 Add an assertion to catch a misuse of replaceAllUsesWith
llvm-svn: 1924
2002-03-21 05:38:15 +00:00
Chris Lattner
72367834b0 1. Fix bug test/Regression/Other/2002-03-20-LevelRaiseBadCodegen.ll
2. Allow negative scales in ConvertableToGEP, so that this loop from
   alloc_tree in the Olden health benchmark is correctly raised:

       for (i = 3; i >= 0; i--)
         fval[i] = alloc_tree(level - 1, label*4 + i + 1, new);

   Stepping through the array backwards caused a negative scale.

llvm-svn: 1922
2002-03-21 03:04:38 +00:00
Chris Lattner
db90f5f6ea Namespace qualify debugging code
llvm-svn: 1921
2002-03-21 03:02:07 +00:00
Vikram S. Adve
92fb8b1f9c Fixed several problems with handling arguments to Phis.
llvm-svn: 1910
2002-03-18 03:47:26 +00:00
Vikram S. Adve
cd6cb1962f Big bug fix: killed uses were being inserted instead of erased!
Also added a set of debug options.

llvm-svn: 1909
2002-03-18 03:45:41 +00:00
Vikram S. Adve
308f672ac8 Just a comment.
llvm-svn: 1908
2002-03-18 03:40:25 +00:00
Vikram S. Adve
5f910def00 New pass to decompose multi-dimensional array references into
a sequence of 1-D references, using a sequence of getElementPtrs.

llvm-svn: 1907
2002-03-18 03:39:09 +00:00
Vikram S. Adve
8553fc5d21 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!

llvm-svn: 1906
2002-03-18 03:37:19 +00:00
Vikram S. Adve
855ed3d941 Added function computeOffsetforLocalVar to check how big the
offset-from-FP will be before allocating space for a local variable.

llvm-svn: 1905
2002-03-18 03:36:30 +00:00
Vikram S. Adve
edc1adae11 Bug fix in setting CC register.
Also use distinct names for the three types of SetMachineOperand
to avoid painful overloading problems and errors.

llvm-svn: 1904
2002-03-18 03:35:24 +00:00
Vikram S. Adve
b26ed73c33 Constants are now added to the constant pool only when a load
instruction is actually generated for them.
Rename the different versions of SetMachineOperand.

llvm-svn: 1903
2002-03-18 03:33:43 +00:00
Vikram S. Adve
3fe5a9e913 Use vector for machine instructions returned by GetInstructionsByRule.
Fix constants in instructions generated for Phi elimination.

llvm-svn: 1902
2002-03-18 03:31:54 +00:00
Vikram S. Adve
125cd33f99 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!
Also added a function to get a register class by ID.

llvm-svn: 1901
2002-03-18 03:26:48 +00:00
Vikram S. Adve
7f139ccf85 Add support for code generation for array references.
Also, use distinct names for the three types of SetMachineOperand to
avoid painful overloading problems and errors.
Bug fix in converting-int-to-float.  Other minor stuff.

llvm-svn: 1896
2002-03-18 03:15:35 +00:00
Vikram S. Adve
217f7b1fe1 Bug fixes for not using unified reg. numbers, and for using the
wrong register class for saving CC registers.
Also, use distinct names for the three types of SetMachineOperand.

llvm-svn: 1895
2002-03-18 03:12:16 +00:00
Vikram S. Adve
6a74ad7030 Use distinct names for the three types of SetMachineOperand to
avoid painful overloading problems and errors.

llvm-svn: 1893
2002-03-18 03:09:15 +00:00
Vikram S. Adve
f7d5ad2124 Minor fixes.
llvm-svn: 1892
2002-03-18 03:08:07 +00:00
Vikram S. Adve
23d4011ea1 Handling of global names was severely broken when converting to 2 passes.
Different labels were generated for the same name in different passes.
Use an annotation to hold a fixed table of names.

llvm-svn: 1891
2002-03-18 03:07:26 +00:00
Vikram S. Adve
d311d0d546 Several sundry bug fixes.
llvm-svn: 1890
2002-03-18 03:02:42 +00:00
Chris Lattner
240209eb5b Make an assertion provide a more helpful error message
llvm-svn: 1883
2002-03-17 21:16:01 +00:00
Chris Lattner
88ccdcd73e Remove code designed to compensate for a bug in GCC. The bug has since
been fixed.

llvm-svn: 1881
2002-03-15 20:35:21 +00:00
Chris Lattner
ba358e8e65 Checkin new test for problem anand ran into
llvm-svn: 1880
2002-03-15 20:25:09 +00:00
Chris Lattner
55aff5c433 Cleanup error message output a bit
llvm-svn: 1879
2002-03-15 20:21:29 +00:00
Chris Lattner
8cc6186707 Fix test/Regression/Other/2002-03-14-ValueToLarge.ll. Note that this
fix could be better, but we don't have the infrastructure to find out what
size types are yet.

llvm-svn: 1876
2002-03-14 22:35:50 +00:00
Chris Lattner
1a4aac1060 Add a check to ensure that only PHI nodes are self referential. Code
input to instruction combination was broken, which caused it to explode.

llvm-svn: 1870
2002-03-14 16:53:48 +00:00
Chris Lattner
2ecc9a337c Fix bug: test/Regression/Other/2002-03-14-LevelRaiseHang.ll
llvm-svn: 1869
2002-03-14 16:37:04 +00:00
Chris Lattner
b0128957b1 Fix bug: test/Regression/Other/2002-03-11-InstCombineHang.ll
llvm-svn: 1864
2002-03-11 23:28:45 +00:00
Chris Lattner
ba4660ff3d update comments
llvm-svn: 1862
2002-03-11 22:21:04 +00:00
Chris Lattner
0f8d0257f9 * Fix bug: test/Regression/Other/2002-03-11-LevelRaiseIterInvalidate.ll
* Use more concise form of ReplaceInstWithInst to make code simpler
* Output nicer message for dead code eliminated when debugging

llvm-svn: 1861
2002-03-11 22:19:48 +00:00
Chris Lattner
23379a852e Implement TODO for better diagnostic output
llvm-svn: 1859
2002-03-11 22:12:39 +00:00
Chris Lattner
889b1e5b00 Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll
llvm-svn: 1858
2002-03-11 22:11:07 +00:00
Chris Lattner
35c1c7353b Bugfix for test/Regression/Other/2002-03-11-ExprAssertion.ll
llvm-svn: 1856
2002-03-11 20:50:24 +00:00
Chris Lattner
558efd4bf0 Remove runtime library in favor of users linking against real libraries.
llvm-svn: 1853
2002-03-11 17:57:13 +00:00
Chris Lattner
32669e6211 Do not link in runtime library anymore, assume that user manually links in
libraries.  Code should be generalized to allow lli to take -lc -lm arguments
in the future (todo)

llvm-svn: 1852
2002-03-11 17:52:43 +00:00
Chris Lattner
34eab0d19c Fix bug: test/Regression/Other/2002-03-11-LevelRaiseCalls.ll
llvm-svn: 1844
2002-03-11 17:27:34 +00:00
Chris Lattner
e71c9ba6d0 Implement a bunch of new functions to support the SPECINT mcf
benchmark

llvm-svn: 1841
2002-03-08 22:51:07 +00:00
Chris Lattner
b44f81b987 * Add new method localLookup
* SymbolTable::remove(Value *N) checks to see if we are internally
  inconsistent before looking for a type plane (caused a crash)
* insertEntry now does a local lookup instead of a global lookup, which was
  causing an infinite loop in the renamer logic.
* Added assertions to make sure stuff stays happy
* Now the linker correctly links the SPECINT2000 mcf benchmark

llvm-svn: 1840
2002-03-08 20:26:17 +00:00
Chris Lattner
d9558891af Fix bug: test/Regression/2002-03-08-NameCollision2.ll
llvm-svn: 1839
2002-03-08 19:11:42 +00:00
Chris Lattner
c49eff8d4b Fix minor memory leak
llvm-svn: 1837
2002-03-08 18:57:56 +00:00
Chris Lattner
49c5f320ff Fix for: test/Regression/Assembler/2002-03-08-NameCollision.ll
llvm-svn: 1836
2002-03-08 18:41:32 +00:00
Chris Lattner
60cb774b66 We were not correctly burrowing down multiple levels to get to a leaf. Fix this now
llvm-svn: 1833
2002-03-07 21:18:00 +00:00
Chris Lattner
09424811e9 Support changing the pointer type of a store for the case where we are
storing into the first element of the structure type.

llvm-svn: 1832
2002-03-07 21:17:35 +00:00
Chris Lattner
0c7a32d2f4 Initial checkin
llvm-svn: 1831
2002-03-07 20:16:38 +00:00
Chris Lattner
0f0ed63279 Clean up call graph, add comments, and fix test/Regression/Other/2002-01-31-CallGraph.ll
llvm-svn: 1828
2002-03-06 20:19:35 +00:00
Chris Lattner
cc1fa55c61 Pull interprocedural analyses out of Analysis library into their own lib
llvm-svn: 1827
2002-03-06 18:44:29 +00:00
Chris Lattner
ed067d6d91 Move call graph printing support out of Writer.h into Callgraph.h
remove dead global function

llvm-svn: 1825
2002-03-06 18:00:49 +00:00
Chris Lattner
962e012ad5 Take CallGraph out of the CFG namespace. It has nothing to do with CFGs
llvm-svn: 1820
2002-03-06 17:16:43 +00:00
Vikram S. Adve
17ec828187 Fix include error.
llvm-svn: 1819
2002-03-03 20:46:32 +00:00
Chris Lattner
e2383e8592 Change over to use new style pass mechanism, now passes only expose small
creation functions in their public header file, unless they can help it.

llvm-svn: 1816
2002-02-26 21:46:54 +00:00
Chris Lattner
00ef917e01 Expose more entry points to the verifier
llvm-svn: 1815
2002-02-26 21:45:33 +00:00
Chris Lattner
1b9b843452 Move ProfilePaths class into ProfilePaths library, only expose a creation function
llvm-svn: 1812
2002-02-26 20:04:59 +00:00
Chris Lattner
6693158d06 Pass stuff by reference instead of by copy. Copying entire graphs seems like
a bad idea

llvm-svn: 1810
2002-02-26 19:49:45 +00:00
Chris Lattner
6145c5df9d Move processGraph down lower in the file so all of the forward declarations
can be eliminated.

llvm-svn: 1809
2002-02-26 19:43:49 +00:00