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

1155 Commits

Author SHA1 Message Date
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
Vikram S. Adve
843f32ad9b Generate code for Rem instruction.
llvm-svn: 1124
2001-11-04 21:59:14 +00:00
Chris Lattner
9010727e28 Fix obscure nasty bug with bytecode writing that could cause the last byte to be dropped.
llvm-svn: 1123
2001-11-04 21:32:41 +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
Vikram S. Adve
cb87df31db Fixed instruction information for RDCCR and WRCCR.
Fixed selection to create a TmpInstruction for each integer CC register
(since it is an implicit side-effect, unlike FP CC registers which are
explicit operands).

llvm-svn: 1120
2001-11-04 19:34:49 +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
Ruchira Sasanka
b5a9b22fa7 Added an assertion since it seems like AdjList returns an errornous size in method
IGNode::pushOnStack().

llvm-svn: 1116
2001-11-03 22:01:09 +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
1645e398fb Add a helper function to PHI node
llvm-svn: 1113
2001-11-03 21:08:00 +00:00
Ruchira Sasanka
77cc18917c Added support for correct spilling of %ccr
llvm-svn: 1112
2001-11-03 20:41:22 +00:00
Ruchira Sasanka
20c3c4be28 Added code to support correct saving of %ccr across calls
llvm-svn: 1111
2001-11-03 19:59: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
Chris Lattner
b7cb076c0e Expose method to merge identically named methods
llvm-svn: 1109
2001-11-03 19:49:54 +00:00
Ruchira Sasanka
116fbe7fc7 Arranged stack frame - needs furhter organization
llvm-svn: 1108
2001-11-03 17:14:44 +00:00
Ruchira Sasanka
cb3cfedff4 Moved InsertCallerSaveInstr to the SparcRegInfo.cpp and made machine independent
llvm-svn: 1107
2001-11-03 17:14:13 +00:00
Ruchira Sasanka
7673c5f6e0 Arranged stack frame - needs furhter organization
Moved InsertCallerSaveInstr to the SparcRegInfo.cpp

llvm-svn: 1106
2001-11-03 17:13:27 +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
38732a00f5 Be lenient on types so that programs that are not very typesafe will work
llvm-svn: 1104
2001-11-03 10:15:32 +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
a9bdcbf060 Remove debugging info
llvm-svn: 1093
2001-11-03 03:31:39 +00:00
Chris Lattner
d61e4631f5 Fix major bugs in type resolution
llvm-svn: 1092
2001-11-03 03:27:53 +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
dec971b881 Fix the linker. This bug was not fun to track down. grr
llvm-svn: 1090
2001-11-03 03:26:47 +00:00
Chris Lattner
e40fa529cd Dramatically simplify recursive type processing. Fixed a few bugs, a few still remain :(
Why does this stuff have to come up NOW?

llvm-svn: 1089
2001-11-02 07:51:31 +00:00
Chris Lattner
8573672b7f Improve some debugging code
llvm-svn: 1088
2001-11-02 07:46:26 +00:00
Chris Lattner
5ee08db6ce Support floating point numbers in expodential form so that small numbers don't get truncated, which broke the health benchmark
llvm-svn: 1087
2001-11-01 22:06:08 +00:00
Chris Lattner
d8c8439517 Print floating point numbers in expodential form so that small numbers don't get truncated, which broke the health benchmark
llvm-svn: 1086
2001-11-01 22:06:00 +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
aa5e794aaa Expose the low level DCE mechanism to external users
llvm-svn: 1082
2001-11-01 07:00:21 +00:00
Chris Lattner
2e9e90e235 Implement new simpler constructors for if you don't have a index list
llvm-svn: 1081
2001-11-01 05:58:42 +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
1942341fd4 Implement constant propogation of null pointer values.
llvm-svn: 1078
2001-11-01 05:55:13 +00:00
Chris Lattner
ddb95263c8 Add simpler to use ctors. Add getType() overload to specialize getelementptr's type
llvm-svn: 1077
2001-11-01 05:54:28 +00:00
Chris Lattner
13475b1a77 Add new isNullValue method
llvm-svn: 1076
2001-11-01 05:53:56 +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
4e4759adc0 Initial checkin of level raising code
llvm-svn: 1073
2001-11-01 02:41:52 +00:00
Chris Lattner
943810898d Move the Raise xform from opt to transforms
llvm-svn: 1072
2001-11-01 02:41:09 +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