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