1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

331 Commits

Author SHA1 Message Date
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
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
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
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
55aff5c433 Cleanup error message output a bit
llvm-svn: 1879
2002-03-15 20:21:29 +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
889b1e5b00 Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll
llvm-svn: 1858
2002-03-11 22:11:07 +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
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
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
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
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
Chris Lattner
12573def64 * Changes to compile successfully with GCC 3.0
* Eliminated memory leak in processGraph
* Pass vectors by const reference to moveDummyCode instead of by copy

llvm-svn: 1808
2002-02-26 19:40:28 +00:00
Anand Shukla
3644255181 Makefile for profile-paths
llvm-svn: 1807
2002-02-26 19:36:43 +00:00
Anand Shukla
b9e67e748a Initial checkin: functions on Graph used for path profile pass
llvm-svn: 1806
2002-02-26 19:02:16 +00:00
Anand Shukla
d3ce435557 Initial checkin: instrument code to get path execution frequency
llvm-svn: 1805
2002-02-26 19:00:48 +00:00
Anand Shukla
d5d415f609 Initial checkin: helper file to insert instrumentation code along edges
llvm-svn: 1804
2002-02-26 18:59:46 +00:00
Anand Shukla
4f842414ae Initial check in of graph.cpp: implements graph interface used in path profiles
llvm-svn: 1803
2002-02-26 18:58:39 +00:00
Anand Shukla
d7f2b91c9b New makefile to include ProfilePaths dir
llvm-svn: 1799
2002-02-26 18:20:27 +00:00
Chris Lattner
11d689e99a When inlining basic blocks and instructions, give them a name!
llvm-svn: 1796
2002-02-25 00:31:02 +00:00
Chris Lattner
b4e6953fc0 Namespaces
llvm-svn: 1791
2002-02-24 23:03:09 +00:00
Chris Lattner
3d83ea4268 Handle more cases in the linker
llvm-svn: 1771
2002-02-18 19:05:15 +00:00
Chris Lattner
a87f4f1b13 Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll
llvm-svn: 1767
2002-02-14 22:21:40 +00:00
Chris Lattner
6ae007b43e Implement conversion of method pointer parameter in Call instruction
to clean up MST benchmark.

llvm-svn: 1763
2002-02-14 19:44:09 +00:00
Chris Lattner
1ae58c1268 * Check in fix for: llvm/test/Regression/Other/2002-02-14-LevelRaiseInstDelete.ll
* Minor reformatting.

llvm-svn: 1760
2002-02-14 18:55:22 +00:00
Chris Lattner
8e9be000a7 * Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
  InstrTypes.h anymore

llvm-svn: 1750
2002-02-12 22:39:50 +00:00
Chris Lattner
b0a2c5546b Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h

llvm-svn: 1746
2002-02-12 21:07:25 +00:00
Chris Lattner
5276164ac4 Add neccesary #include
llvm-svn: 1742
2002-02-12 20:19:06 +00:00
Chris Lattner
20edcad40a I forgot to provide dominance frontier information. Now it's available.
Also add more comments.

llvm-svn: 1741
2002-02-12 18:27:41 +00:00
Chris Lattner
326b548cd4 Initial checkin of new memory -> register promotion pass
llvm-svn: 1739
2002-02-12 17:16:22 +00:00
Chris Lattner
43ed408912 General cleanup
llvm-svn: 1628
2002-02-01 04:53:48 +00:00
Chris Lattner
0d3eaa9575 Eliminate SimplifyCFG.h file, pull everything into the UnifyMethodExitNodes class
llvm-svn: 1613
2002-01-31 01:12:06 +00:00
Chris Lattner
dc15bb209d MethodPass's are now guaranteed to not be run on external methods!
llvm-svn: 1611
2002-01-31 00:51:24 +00:00
Chris Lattner
2e463f5dbe Convert xforms over to new pass structure.
llvm-svn: 1605
2002-01-31 00:45:11 +00:00
Chris Lattner
15c05486cc Convert analyses to new pass structure
llvm-svn: 1603
2002-01-31 00:42:27 +00:00
Chris Lattner
2cab187296 Remove extraneous #includes
llvm-svn: 1588
2002-01-26 22:47:32 +00:00
Chris Lattner
0fea9f487b Remove opt namespace
llvm-svn: 1587
2002-01-26 22:47:07 +00:00
Chris Lattner
71ee02c009 Implement new DeadInstElmination pass
remove old comment

llvm-svn: 1555
2002-01-23 05:48:24 +00:00
Chris Lattner
e12b9f9277 Don't insert a useless cast
llvm-svn: 1527
2002-01-22 03:30:06 +00:00
Chris Lattner
4cecd63a42 Rename LowerAllocations.h to ChangeAllocations.h since it now contains the
RaiseAllocations pass as well.

llvm-svn: 1525
2002-01-22 01:04:08 +00:00
Chris Lattner
83056c99ec Pull RaiseAllocations stuff out of the CleanGCC pass into it's own pass in
the ChangeAllocations.h header file.

llvm-svn: 1522
2002-01-22 00:13:51 +00:00
Chris Lattner
250d937680 LowerAllocations is really a BasicBlock pass. Make it so.
llvm-svn: 1521
2002-01-21 23:34:02 +00:00
Chris Lattner
4454cdc5c0 Move stuff out of the Optimizations directories into the appropriate Transforms
directories.  Eliminate the opt namespace.

llvm-svn: 1520
2002-01-21 23:17:48 +00:00
Chris Lattner
15f43a7af7 Elminate an unused variable
llvm-svn: 1518
2002-01-21 23:16:30 +00:00
Chris Lattner
bbb4dcdcd1 Rename SwapStructureContents -> IPO/SimpleStructMutation
Move MutateStructTypes.(cpp|h) -> IPO/MutateStructTypes.(cpp|h)

llvm-svn: 1510
2002-01-21 07:52:35 +00:00
Chris Lattner
2521ae1011 Implement a more powerful, simpler, pass system. This pass system can figure
out how to run a collection of passes optimially given their behaviors and
charactaristics.

Convert code to use it.

llvm-svn: 1507
2002-01-21 07:31:50 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
37ba4e2bb7 initial checkin
llvm-svn: 1480
2001-12-14 16:52:21 +00:00
Chris Lattner
98a6e485b0 * isFirstClassType is now provided by the Type class
* Add ReplaceInstWithInst

llvm-svn: 1468
2001-12-14 16:39:22 +00:00
Chris Lattner
553ec6b72f * add ReplaceInstWithInst
* Add support for pointer indexing
* Fix minor bugs that are majorly annoying

llvm-svn: 1467
2001-12-14 16:38:59 +00:00
Chris Lattner
9e6ccdd858 Remove unsized array support
llvm-svn: 1466
2001-12-14 16:38:04 +00:00
Chris Lattner
cd134c6891 * Support pointer indexing
* Unsized arrays are a thing of the past, remove DoInsertArrayCast family
* Remove cases were we would get into infinite loops because we would insert a cast
  which would then be removed, inserting a different cast, ad infinitum...
* Remove some code that should be redundant with ExprTypeConvert code

llvm-svn: 1465
2001-12-14 16:37:52 +00:00
Chris Lattner
1dc9744cc7 Many many changes and bugfixes:
* Remove support for unsized arrays
* Add pointer indexing support
* Allow more arbitrary malloc type changes (which are too generous currently
  and should be fixed in the future)
* Allow more and better conversions

llvm-svn: 1464
2001-12-14 16:35:53 +00:00
Chris Lattner
315df5b058 The proper prototype for malloc returns a pointer, not an unsized array
llvm-svn: 1463
2001-12-14 16:32:20 +00:00
Chris Lattner
6b2dc21b63 * Refactor trace values to work as a proper pass. Before it used to add
methods while the pass was running which was a no no.  Now it adds the
  printf method at pass initialization
* Revamp code to use printf calls instead of the old style print_<type>
  calls.
* Simplify code

llvm-svn: 1457
2001-12-14 16:26:05 +00:00
Chris Lattner
488f202019 Assertion could never fail because another one would in it's place. :)
llvm-svn: 1449
2001-12-13 00:45:40 +00:00
Chris Lattner
d76171a512 Implement more general conversions for getelementptr instructions
llvm-svn: 1432
2001-12-07 04:40:30 +00:00
Chris Lattner
9ae054fd1a Remove code that is superceeded by code in ExprTypeConvert.cpp
llvm-svn: 1431
2001-12-07 04:39:01 +00:00
Chris Lattner
e3b8fb7426 Don't insert scales of 1 :)
llvm-svn: 1430
2001-12-07 04:26:02 +00:00
Chris Lattner
e3b57cfe8f We can do cast-add elimination even on casts that reinterpret
llvm-svn: 1427
2001-12-06 18:06:13 +00:00
Chris Lattner
e23b6591f9 Fix bug that caused invalid transformations to be applied
llvm-svn: 1426
2001-12-06 18:05:55 +00:00
Chris Lattner
d89106f96b Actually return true when a change has been made
llvm-svn: 1425
2001-12-05 19:41:33 +00:00
Chris Lattner
8ca0f9efd6 Handle more complex array indexing expressions
llvm-svn: 1424
2001-12-05 19:41:16 +00:00
Chris Lattner
662a17ba5f Fix pessimizations on sized arrays
llvm-svn: 1423
2001-12-05 19:40:32 +00:00
Chris Lattner
57e64f9985 Fix a few bugs. Fix pessimization handling sized arrays
llvm-svn: 1422
2001-12-05 19:39:15 +00:00
Chris Lattner
d1a8ed7d8c Hrm, don't do debugging output when debugging is off. :(
llvm-svn: 1420
2001-12-05 06:40:17 +00:00
Chris Lattner
05fb7c607f Fixes to type conversion stuff to match induction variables more frequently
llvm-svn: 1417
2001-12-05 06:34:00 +00:00
Chris Lattner
7059b60173 Fix a bug introduced by "internal linkage" work.
llvm-svn: 1415
2001-12-04 18:01:49 +00:00
Chris Lattner
8ec5ceb110 Fix bugs, don't do external methods which causes segv.
llvm-svn: 1414
2001-12-04 08:13:06 +00:00
Chris Lattner
c1b018dcf4 Remove printouts
llvm-svn: 1413
2001-12-04 08:12:53 +00:00
Chris Lattner
bd85988c94 Implement induction variable simplification
llvm-svn: 1411
2001-12-04 04:32:29 +00:00
Chris Lattner
c4a5815033 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()

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

llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner
bcf2df7058 Split the PHINode class out from the iOther.h file into the iPHINode.h file
llvm-svn: 1405
2001-12-03 18:02:31 +00:00
Chris Lattner
a337749b35 Initial checkin of indvar stuff
llvm-svn: 1404
2001-12-03 17:28:42 +00:00
Chris Lattner
cf360e3fd8 Compile the scalar directory
llvm-svn: 1403
2001-12-03 17:28:15 +00:00
Chris Lattner
463cc31132 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner
7b91b28853 Turn off debug info
llvm-svn: 1396
2001-11-26 19:36:58 +00:00
Chris Lattner
84d72f9596 Make strings be internal
llvm-svn: 1384
2001-11-26 19:14:33 +00:00
Chris Lattner
2459d65720 Remove debugging output
llvm-svn: 1383
2001-11-26 19:14:16 +00:00
Chris Lattner
c56685dca6 Support internal linkage
llvm-svn: 1382
2001-11-26 19:14:03 +00:00
Chris Lattner
5753d430a6 Build IPO directory
llvm-svn: 1381
2001-11-26 18:59:30 +00:00
Chris Lattner
dce8511222 Implement support for internal methods
llvm-svn: 1380
2001-11-26 18:59:18 +00:00
Chris Lattner
4d2046a71e Include const prop as part of -raise
llvm-svn: 1379
2001-11-26 18:58:55 +00:00
Chris Lattner
d10d3f1015 Misc cleanups
llvm-svn: 1377
2001-11-26 18:57:38 +00:00
Chris Lattner
8fd567523c Expose constant propogation of an instruction in a clean way
llvm-svn: 1376
2001-11-26 18:57:12 +00:00
Chris Lattner
118f8023f8 Implement DCE of global values
llvm-svn: 1360
2001-11-26 18:42:17 +00:00
Chris Lattner
e996313daa Support array indexing
llvm-svn: 1345
2001-11-26 17:00:43 +00:00
Chris Lattner
4694a03e25 Support Composite's, not just structs
llvm-svn: 1344
2001-11-26 17:00:13 +00:00
Chris Lattner
ab740485ab losslessCastableTypes is moved to Type class
getStructOffsetType supports array indexing

llvm-svn: 1343
2001-11-26 16:59:47 +00:00
Chris Lattner
c1f0351928 Support selectable structure transformations
llvm-svn: 1342
2001-11-26 16:59:10 +00:00
Chris Lattner
98a6ef2594 Support mutation of array indexing
llvm-svn: 1341
2001-11-26 16:58:33 +00:00
Chris Lattner
95b74bb24f Clean up code, implement array indexing stuff
llvm-svn: 1340
2001-11-26 16:58:14 +00:00
Chris Lattner
a9084f9746 Implement array indexing reverse engineering
llvm-svn: 1339
2001-11-26 16:57:31 +00:00
Vikram S. Adve
44df059d4d Print incoming arguments and return values.
llvm-svn: 1315
2001-11-15 15:00:16 +00:00
Chris Lattner
e19d5b4615 -cleangcc pass now remove type names that are never referenced and type names for pointers to primitive types.
llvm-svn: 1312
2001-11-15 04:34:46 +00:00
Chris Lattner
4046596beb Remove much cruft from the MemAccessInst instruction
llvm-svn: 1298
2001-11-14 11:27:58 +00:00
Chris Lattner
f45cb25619 Better heuristics for handling arrays
llvm-svn: 1296
2001-11-14 11:02:49 +00:00
Chris Lattner
71a0797f80 * Change ExpressionConvertableToType to more closely match map behavior of
ConvertExpressionToType
* Make ValueHandle's remove instruction from maps when they are deleted so that
  no false map hits occur if a subsequent instruction is allocated to the same
  space in memory.  This was a VERY VERY VERY EVIL NASTY BUG to track down. :-P

llvm-svn: 1288
2001-11-13 05:01:36 +00:00
Chris Lattner
3b2e10698f Avoid assertion failure when taking size of unsized array. Todo item herE
llvm-svn: 1286
2001-11-13 04:59:41 +00:00
Chris Lattner
184137a419 Fix minor bug
llvm-svn: 1273
2001-11-12 20:13:04 +00:00
Ruchira Sasanka
3e193c7709 Changed insert instructions only for CONSTANTS - back to original
llvm-svn: 1271
2001-11-12 19:32:04 +00:00
Chris Lattner
053906abc0 Initail checking of structure swapper
llvm-svn: 1248
2001-11-10 07:28:25 +00:00
Chris Lattner
79fd0836bb Initial checkin of structure mutator
llvm-svn: 1246
2001-11-10 07:26:31 +00:00
Chris Lattner
de13795a04 Remove false optimization that basically broke everything
llvm-svn: 1219
2001-11-09 01:08:10 +00:00
Chris Lattner
7969ed3025 * Add better caching of data to avoid silly recusions
* Only check to see if uses of instructions can be converted for expressions... so we don't look at all of the uses of a constant.  This was making the code unnecessarily conservative

llvm-svn: 1218
2001-11-08 22:06:31 +00:00
Chris Lattner
fdc70e08d0 Improve raising significantly
llvm-svn: 1214
2001-11-08 20:19:56 +00:00
Vikram S. Adve
a0da8fc9c5 Bug fix: cannot modify Phi operands while iterating over them!
llvm-svn: 1203
2001-11-08 05:25:33 +00:00
Chris Lattner
e33afc1d46 Add #includes to enable buiding in Release mode
llvm-svn: 1174
2001-11-07 13:49:45 +00:00
Chris Lattner
a688655cba Fix minor bug for shifts
llvm-svn: 1160
2001-11-06 21:51:48 +00:00
Chris Lattner
fcf608c1a7 Fix bugs
llvm-svn: 1152
2001-11-06 08:34:29 +00:00
Chris Lattner
da8737d88a Fix many bugs. Implement PHI transforms & other cycles
llvm-svn: 1151
2001-11-06 08:34:17 +00:00
Chris Lattner
688f944802 Fix bug with ADD nodes and malloc promotion
llvm-svn: 1144
2001-11-05 21:13:30 +00:00
Chris Lattner
d376cb5113 Don't print spurious linking warnings about methods that are never used.
Cleanup ExprTypeConvert a bit.

llvm-svn: 1141
2001-11-05 19:43:10 +00:00
Chris Lattner
a346367992 Use the expression map correctly.
llvm-svn: 1140
2001-11-05 18:30:53 +00:00
Chris Lattner
68180b2837 New file for expression tree conversion
llvm-svn: 1128
2001-11-04 23:24:20 +00:00
Chris Lattner
5d261d7928 Refactor code to share stuff
llvm-svn: 1127
2001-11-04 23:24:06 +00:00
Chris Lattner
f358050083 * Relax restriction that prevented malloc promotion in certain cases
llvm-svn: 1125
2001-11-04 22:11:10 +00:00
Chris Lattner
84715d0d46 * Disable debug output
* fix minor bug with taking datasize of unsized array type
* Insert code to support speculative changes later

llvm-svn: 1122
2001-11-04 21:32:11 +00:00
Chris Lattner
50508dde95 Convert backward conversion of expression trees into a new more powerful bidirectional approach. Add transforms for more instructions.
llvm-svn: 1121
2001-11-04 20:21:12 +00:00
Chris Lattner
ea63d43a07 Minor method rename
llvm-svn: 1119
2001-11-04 08:08:34 +00:00
Chris Lattner
1b0ded767a Add transformations for Load and GetElementPtr. Fix broken transform with shr.
llvm-svn: 1118
2001-11-04 07:42:17 +00:00
Chris Lattner
42cf9aaa3a Fix cast instructions that end up in bad places in GCC output
llvm-svn: 1117
2001-11-04 07:40:51 +00:00
Chris Lattner
82c7401f23 Avoid making a broken transformation!
llvm-svn: 1115
2001-11-03 21:30:22 +00:00
Chris Lattner
2b011e7b50 Add new cleanup pass:
//  1. PHI nodes with multiple entries for the same predecessor.  GCC sometimes
//     generates code that looks like this:
//
//  bb7:  br bool %cond1004, label %bb8, label %bb8
//  bb8: %reg119 = phi uint [ 0, %bb7 ], [ 1, %bb7 ]
//
//     which is completely illegal LLVM code.  To compensate for this, we insert
//     an extra basic block, and convert the code to look like this:
//
//  bb7: br bool %cond1004, label %bbX, label %bb8
//  bbX: br label bb8
//  bb8: %reg119 = phi uint [ 0, %bbX ], [ 1, %bb7 ]
//

llvm-svn: 1114
2001-11-03 21:08:59 +00:00
Chris Lattner
bcdf581aec * Export method to merge identically named methods
* Add code to fix PHI nodes that are missing arguments.  These PHI nodes can
  be generated by GCC if there is an uninitialized variable flowing into a merge
  point.  For example:

int foo(int y) {
  int X;
  if (y) X = 1;
  return X;
}

llvm-svn: 1110
2001-11-03 19:51:56 +00:00
Ruchira Sasanka
ee84dc6f89 Commented out code so that copies are inserted for all phi args
CahedCopyMap was disabled to insert phi elimination code for all phi args

llvm-svn: 1105
2001-11-03 17:09:59 +00:00
Chris Lattner
30050d95ae Changes to compile the TSP benchmark successfully. Favor warning instead of assertion failures.
llvm-svn: 1103
2001-11-03 10:04:22 +00:00
Chris Lattner
fb0626b9ed Add code to link method together with the same name if one is vararg and the other isn't.
This resolves definitions like this:
   %list * "foo"(...)
   %list * "foo"(int)

together which can often occur because C programmers don't put prototypes in like they should.  GRR

llvm-svn: 1102
2001-11-03 09:19:00 +00:00
Chris Lattner
b778b5bd90 Don't forget to link type names together too. Fix for Olden/mst benchmark
llvm-svn: 1094
2001-11-03 05:18:24 +00:00
Chris Lattner
b995f1c44f Add extra code for debugging linker problems
llvm-svn: 1091
2001-11-03 03:27:29 +00:00
Chris Lattner
7682955ac0 * Add comments for peepholes
* Implement new peephole:
     // Peephole optimize the following instructions:
     // %t1 = cast {<...>} * %StructPtr to <ty> *
     //
     // Into: %t2 = getelementptr {<...>} * %StructPtr, <0, 0, 0, ...>
     //       %t1 = cast <eltype> * %t1 to <ty> *

  This peephole eliminated 9 evil casts in the health benchmark, and
  completely turned the addList method around.  :)

llvm-svn: 1085
2001-11-01 17:05:27 +00:00
Chris Lattner
06e4402e71 Add DCE as integral part of the level raising to avoid processing instructions that are dead
llvm-svn: 1084
2001-11-01 07:00:51 +00:00
Chris Lattner
a621bac2a6 Expose the low level DCE mechanism to external users
Refactor code to support it

llvm-svn: 1083
2001-11-01 07:00:27 +00:00
Chris Lattner
8b30d77212 * Implement expression type conversion for constant values
* Fix a problem setting a name on a constant value that died because no symbol table was passed in
* Add some comments describing the passes
* Implement a new peephole:
     // Peephole optimize the following instructions:
     // %t = cast <T1>* %P to <T2> * ;; If T1 is losslessly convertable to T2
     // store <T2> %V, <T2>* %t
     //
     // Into:
     // %t = cast <T2> %V to <T1>
     // store <T1> %t2, <T1>* %P

llvm-svn: 1080
2001-11-01 05:57:59 +00:00
Chris Lattner
3b2c78da03 Simplify DCE code a lot
llvm-svn: 1079
2001-11-01 05:55:29 +00:00
Chris Lattner
261785f670 * Convert getelementptr/store pairs into a single store
* Convert getelementptr/load pairs into a single load

llvm-svn: 1075
2001-11-01 03:12:34 +00:00
Chris Lattner
01dc694896 Initial checkin of level raising code, after move and cleanup and expands from the opt directory
llvm-svn: 1074
2001-11-01 02:42:08 +00:00
Chris Lattner
cd8bcd33aa Propogate name to the malloc itself instead of to the cast
llvm-svn: 1071
2001-11-01 02:40:36 +00:00
Chris Lattner
986e273442 Use the correct prototype for malloc and free
llvm-svn: 1066
2001-10-31 06:36:23 +00:00
Chris Lattner
009d9de81c Implement code to convert %malloc and %free FUNCTION CALLS into the instruction equivalent
llvm-svn: 1065
2001-10-31 06:35:59 +00:00