1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

112 Commits

Author SHA1 Message Date
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
Chris Lattner
91fc057638 Implemented constant propogation of cast instructions
llvm-svn: 1064
2001-10-31 05:07:57 +00:00
Chris Lattner
a9dacc1925 Initial version of GCC cleanup pass: just removes extraneous global symbol table entries for types
llvm-svn: 1062
2001-10-31 04:33:19 +00:00
Chris Lattner
98ce708757 Fix bug when inlining a method that refers to a global variable
llvm-svn: 1056
2001-10-31 02:27:26 +00:00
Chris Lattner
37164a34d5 Fix broken assertion. Didn't allow for pointer case
llvm-svn: 1034
2001-10-29 17:27:38 +00:00
Chris Lattner
d8958859d9 Pull method symbols over when linking. Otherwise the result of the link will appear stripped
llvm-svn: 1033
2001-10-29 16:55:41 +00:00
Vikram S. Adve
3af80d1a15 Make newlines be newlines! This should now work in both lli and native code.
llvm-svn: 1016
2001-10-28 22:44:02 +00:00
Chris Lattner
42883552ec Remove non linking related stuff
llvm-svn: 1015
2001-10-28 22:43:06 +00:00
Vikram S. Adve
2c1193dfdd Added name-mangling routines for future use.
llvm-svn: 1003
2001-10-28 21:38:02 +00:00
Vikram S. Adve
767c1505bc Use separate functions for printing values of each type.
Put trace code before condition-generating instruction in basic blocks
that end in a conditional branch.

llvm-svn: 1002
2001-10-28 21:37:25 +00:00
Chris Lattner
307595fd40 Fix problem linking in a method prototype when a method body exists
llvm-svn: 965
2001-10-23 20:43:42 +00:00
Chris Lattner
a83d6a2ee9 Refix bugs, stop using deprecated strstream header
llvm-svn: 898
2001-10-18 20:06:03 +00:00
Chris Lattner
5c29b9fafd Initial checkin
llvm-svn: 897
2001-10-18 20:05:37 +00:00
Vikram S. Adve
0b908c75a6 Only print values live at BB or method exit, and insert loads at each
BB exit to read and print values stored in that BB.   Note that only
these stored values are live at method exit!.  Also, print messages at
method entry and exit.

llvm-svn: 892
2001-10-18 18:16:11 +00:00
Vikram S. Adve
487da75338 Handle multiple exit blocks correctly.
Restore string variable cache.
Resurrect code to use formatted printing instead of PrintVal
but leave it turned off for now.

llvm-svn: 888
2001-10-18 13:49:22 +00:00
Chris Lattner
b0066e78ac Convert to be compatible with lli.
Need to eliminate duplicate \n entries

llvm-svn: 883
2001-10-18 06:03:05 +00:00
Chris Lattner
a8ed40026f Massive hacks to try to fix subtle logic bugs. I think it's all working now,
at least what used to.  I should disable method exit code completely because
it's broken (doesn't insert just post dominating values)

llvm-svn: 881
2001-10-18 05:28:08 +00:00
Chris Lattner
40372ce62d Convert to new simpler pass itf
llvm-svn: 880
2001-10-18 05:27:33 +00:00
Chris Lattner
4429216038 Convert optimizations to the pass infrastructure
llvm-svn: 873
2001-10-18 01:32:34 +00:00
Chris Lattner
9bfad5b7b1 Add new Pass infrastructure and some examples
llvm-svn: 836
2001-10-15 17:31:51 +00:00