Commit Graph

1345 Commits

Author SHA1 Message Date
Chris Lattner 3b7199e36c Add #includes to enable buiding in Release mode
llvm-svn: 1174
2001-11-07 13:49:45 +00:00
Chris Lattner 5e030830a3 Squelch warnings about not returning a value
llvm-svn: 1173
2001-11-07 13:49:12 +00:00
Vikram S. Adve b8157d5a29 Roll back all these changes that have broken Makefile.target again.
llvm-svn: 1172
2001-11-07 12:29:40 +00:00
Chris Lattner 28e969d689 Okay, so this is a huge hack. Fixme later
llvm-svn: 1171
2001-11-07 05:31:53 +00:00
Chris Lattner eaec4ede57 *Print Stack traces better.
* Use the cache writer for all it's problems.
* print arguments to methods in stack traces.
*Print the current stack from for up/down commands.

llvm-svn: 1170
2001-11-07 05:31:27 +00:00
Chris Lattner 1f01726487 * Use cached writer to speed up printing and get symbolic types more consistently
* When a segfault or bus error occurs, stop the program, print a stack trace, and dump the user in the debugger mode

llvm-svn: 1169
2001-11-07 04:23:00 +00:00
Chris Lattner 7db7958bd4 Implement CachedWriter class to allow module level printing of various components very quickly
llvm-svn: 1168
2001-11-07 04:21:57 +00:00
Chris Lattner 0758abd126 New class to provide high performance writing.
llvm-svn: 1167
2001-11-07 04:20:50 +00:00
Chris Lattner 51862ef777 Add %p format to printf, which MUST be used when printing pointer values.
llvm-svn: 1166
2001-11-07 02:57:33 +00:00
Chris Lattner c23094efb4 Implement log and drand48 for TSP bm
llvm-svn: 1165
2001-11-06 22:53:25 +00:00
Chris Lattner 74a4698aaa Minor fixes
llvm-svn: 1164
2001-11-06 22:53:17 +00:00
Chris Lattner 68289f0b89 Add notes
llvm-svn: 1163
2001-11-06 22:53:11 +00:00
Chris Lattner 5cc318819c Implement sqrt, implement printf better, simpler.
llvm-svn: 1161
2001-11-06 21:52:18 +00:00
Chris Lattner 6c4681ca28 Fix minor bug for shifts
llvm-svn: 1160
2001-11-06 21:51:48 +00:00
Chris Lattner 2f2d947f73 Print out the abridged form of the call instruction.
llvm-svn: 1159
2001-11-06 21:28:12 +00:00
Chris Lattner 82b7872326 Build .bc from .c better.
llvm-svn: 1158
2001-11-06 20:44:15 +00:00
Chris Lattner 21af446166 Don't forget to make the clean version.
llvm-svn: 1157
2001-11-06 20:23:50 +00:00
Vikram S. Adve 096a76aa92 Really fix Makefile to compile individual tests and Olden codes.
by using a better naming scheme.

llvm-svn: 1156
2001-11-06 17:09:49 +00:00
Vikram S. Adve 2f4b825ca1 Moved *.c files into subdirectory TestSources to avoid overwriting
corresponding *.ll files.

llvm-svn: 1155
2001-11-06 17:06:06 +00:00
Ruchira Sasanka 074d52d60d Fixed bug - added code in pushUnconstrainedIGNodes() to check whether a node
is already pushed to stack by a previous call to the same method.

llvm-svn: 1154
2001-11-06 15:25:38 +00:00
Chris Lattner 0c993260fe Reorder paramters to make the command line more easily modifiable
llvm-svn: 1153
2001-11-06 08:34:56 +00:00
Chris Lattner 0136101e37 Fix bugs
llvm-svn: 1152
2001-11-06 08:34:29 +00:00
Chris Lattner 4031cdde57 Fix many bugs. Implement PHI transforms & other cycles
llvm-svn: 1151
2001-11-06 08:34:17 +00:00
Chris Lattner 9d3292d327 Give me PHI's space back
llvm-svn: 1150
2001-11-06 08:33:46 +00:00
Vikram S. Adve 928833ecea Bug fix: uninitialized variable.
llvm-svn: 1147
2001-11-06 05:11:05 +00:00
Vikram S. Adve f5b4f47cff Bug fix: Printing AdIBef and AdIAft outside the scope where they
were declared, and in some cases when they were unintialized.

llvm-svn: 1146
2001-11-06 05:01:54 +00:00
Chris Lattner 29644b3849 Print PHI nodes with zero operands even if they are illegal
llvm-svn: 1145
2001-11-06 01:48:45 +00:00
Chris Lattner 710c3861b5 Fix bug with ADD nodes and malloc promotion
llvm-svn: 1144
2001-11-05 21:13:30 +00:00
Chris Lattner 7bb67c8ab8 Fix makefile to compile olden and main benchmarks
llvm-svn: 1142
2001-11-05 19:43:24 +00:00
Chris Lattner 7e89a616e6 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 0ecba60d26 Use the expression map correctly.
llvm-svn: 1140
2001-11-05 18:30:53 +00:00
Chris Lattner ad480c5a34 Make the olden benchmarks compile again
llvm-svn: 1139
2001-11-05 18:25:37 +00:00
Vikram S. Adve 596721384b Modified graph construction to use one pass to find all defs.
Avoids having to handle some special cases that cause complex interactions
with instr. selection.

llvm-svn: 1138
2001-11-05 04:04:23 +00:00
Vikram S. Adve 59a13288a6 Make reg. numbers signed ints.
llvm-svn: 1137
2001-11-05 03:56:02 +00:00
Vikram S. Adve 6cb546970f Put it back!
llvm-svn: 1136
2001-11-05 00:48:27 +00:00
Vikram S. Adve daa6058a13 Removed by mistake; will add it back immediately.
llvm-svn: 1135
2001-11-05 00:48:05 +00:00
Vikram S. Adve d3be60db35 Make gcc generate assembly files (%.ll) until Chris has a stable
version of his gccas.  Plus another dumb bug fix (the bug, not the fix).

llvm-svn: 1134
2001-11-05 00:35:56 +00:00
Vikram S. Adve 4d04e00072 Delete rule to disassemble %.bc -- need to make it effective only when
%.ll is not a pre-existing file.

llvm-svn: 1133
2001-11-05 00:23:25 +00:00
Vikram S. Adve 491d8dde35 Replaced another HERE.
llvm-svn: 1132
2001-11-05 00:22:16 +00:00
Vikram S. Adve e943db9be9 Put common rules for compiling programs into Makefile.target.
llvm-svn: 1130
2001-11-05 00:18:30 +00:00
Chris Lattner db750679a3 New file for expression tree conversion
llvm-svn: 1128
2001-11-04 23:24:20 +00:00
Chris Lattner 3084cb65ff Refactor code to share stuff
llvm-svn: 1127
2001-11-04 23:24:06 +00:00
Chris Lattner cb3da314d9 * Relax restriction that prevented malloc promotion in certain cases
llvm-svn: 1125
2001-11-04 22:11:10 +00:00
Vikram S. Adve 80cf60687d Generate code for Rem instruction.
llvm-svn: 1124
2001-11-04 21:59:14 +00:00
Chris Lattner dc194d54f9 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 36c5a79153 * 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 40a2d9076b 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 ea5d1f5db8 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 33d9cb9903 Minor method rename
llvm-svn: 1119
2001-11-04 08:08:34 +00:00
Chris Lattner f00563d39d Add transformations for Load and GetElementPtr. Fix broken transform with shr.
llvm-svn: 1118
2001-11-04 07:42:17 +00:00
Chris Lattner eb7b620d58 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 471babe2d2 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 033324fc0c Avoid making a broken transformation!
llvm-svn: 1115
2001-11-03 21:30:22 +00:00
Chris Lattner ec83fc091e 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 34f8595c0b Add a helper function to PHI node
llvm-svn: 1113
2001-11-03 21:08:00 +00:00
Ruchira Sasanka 51fc1c2d72 Added support for correct spilling of %ccr
llvm-svn: 1112
2001-11-03 20:41:22 +00:00
Ruchira Sasanka 9d8950d240 Added code to support correct saving of %ccr across calls
llvm-svn: 1111
2001-11-03 19:59:59 +00:00
Chris Lattner 784c623efb * 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 cf5befef63 Expose method to merge identically named methods
llvm-svn: 1109
2001-11-03 19:49:54 +00:00
Ruchira Sasanka ca632ed71a Arranged stack frame - needs furhter organization
llvm-svn: 1108
2001-11-03 17:14:44 +00:00
Ruchira Sasanka 97b93aea81 Moved InsertCallerSaveInstr to the SparcRegInfo.cpp and made machine independent
llvm-svn: 1107
2001-11-03 17:14:13 +00:00
Ruchira Sasanka b7a397253f 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 629a15247a 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 d7c742f46a 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 629d7a7849 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 1f3947c1d1 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 3855f2c806 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 34ec31bb74 Remove debugging info
llvm-svn: 1093
2001-11-03 03:31:39 +00:00
Chris Lattner 4f1ca018aa Fix major bugs in type resolution
llvm-svn: 1092
2001-11-03 03:27:53 +00:00
Chris Lattner 1e60d6b762 Add extra code for debugging linker problems
llvm-svn: 1091
2001-11-03 03:27:29 +00:00
Chris Lattner c7724169bf 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 866cbddec8 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 f29b231c77 Improve some debugging code
llvm-svn: 1088
2001-11-02 07:46:26 +00:00
Chris Lattner 50f68acb37 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 e80af939da 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 9bc6b190cc * 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 71c842cddf 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 7567f6c15f 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 63ac2b335a Expose the low level DCE mechanism to external users
llvm-svn: 1082
2001-11-01 07:00:21 +00:00
Chris Lattner f652674162 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 9a13ececd8 * 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 04648a4cc6 Simplify DCE code a lot
llvm-svn: 1079
2001-11-01 05:55:29 +00:00
Chris Lattner 977f0044fc Implement constant propogation of null pointer values.
llvm-svn: 1078
2001-11-01 05:55:13 +00:00
Chris Lattner 3003edc9f1 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 3e8ef98515 Add new isNullValue method
llvm-svn: 1076
2001-11-01 05:53:56 +00:00
Chris Lattner 1267be2319 * 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 025f9fcf80 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 8ac538db47 Initial checkin of level raising code
llvm-svn: 1073
2001-11-01 02:41:52 +00:00
Chris Lattner e326957333 Move the Raise xform from opt to transforms
llvm-svn: 1072
2001-11-01 02:41:09 +00:00
Chris Lattner 246f157af4 Propogate name to the malloc itself instead of to the cast
llvm-svn: 1071
2001-11-01 02:40:36 +00:00
Chris Lattner d307537327 Move level change xfor into the transforms directory
llvm-svn: 1070
2001-11-01 02:39:49 +00:00
Chris Lattner d67f2a4493 Add some useful accessors
llvm-svn: 1069
2001-11-01 02:39:36 +00:00
Chris Lattner 9fb50fe167 crunch the output of GCC a bit to make it nicer
llvm-svn: 1068
2001-10-31 06:36:48 +00:00
Chris Lattner 55c72cb47a Start testing the new cleangcc pass
llvm-svn: 1067
2001-10-31 06:36:34 +00:00
Chris Lattner 7e6a0d8c17 Use the correct prototype for malloc and free
llvm-svn: 1066
2001-10-31 06:36:23 +00:00
Chris Lattner 20726ed31b 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 9db8b765cd Implemented constant propogation of cast instructions
llvm-svn: 1064
2001-10-31 05:07:57 +00:00
Chris Lattner ae6de303fc Fix dumb copy and paste typos
llvm-svn: 1063
2001-10-31 04:33:33 +00:00
Chris Lattner 34b9518c88 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 b3f4d1bc73 New GCC cleanup pass interface
llvm-svn: 1061
2001-10-31 04:32:53 +00:00
Chris Lattner 7a2d677332 Add hook for GCC cleanup pass
llvm-svn: 1060
2001-10-31 04:29:44 +00:00
Chris Lattner 129aac7468 Build new gccas tool
llvm-svn: 1059
2001-10-31 04:29:30 +00:00
Chris Lattner 1a30617664 Initial checkin of GCCAS
llvm-svn: 1058
2001-10-31 04:28:11 +00:00
Chris Lattner 49d9307ca6 Initial checkin of heapsort benchmark
llvm-svn: 1057
2001-10-31 02:28:25 +00:00
Chris Lattner 2a2b531294 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 0d5c295536 Implement memset memcpy, calloc
llvm-svn: 1055
2001-10-30 22:37:01 +00:00
Chris Lattner 7551ec25e7 Initial checkin of ary3 "benchmark" from prog lang shootout
llvm-svn: 1051
2001-10-30 22:17:57 +00:00
Chris Lattner 487b1b8cc1 Implement xor operator
llvm-svn: 1050
2001-10-30 20:54:36 +00:00
Chris Lattner 3f741a560a Initialize map for purify
llvm-svn: 1049
2001-10-30 20:28:46 +00:00
Chris Lattner 8bd5c77731 callExternalMethod now returns the return value of the function
llvm-svn: 1048
2001-10-30 20:28:23 +00:00
Chris Lattner 7fd51b54e5 Implement a gross function name map that must be used when linking statically
This is for use with purify

llvm-svn: 1047
2001-10-30 20:28:00 +00:00
Chris Lattner 5946b1150d * Add some assertions for checking internal error conditions
* Implement the 'rem' instruction
* Fix getelementptr to work right
* Copy the return result of an external function call into the receiving value
* Convert stuff to new style casts

llvm-svn: 1046
2001-10-30 20:27:31 +00:00
Chris Lattner b20b290c5e Add easy way to enable purify support
llvm-svn: 1045
2001-10-30 20:24:08 +00:00
Chris Lattner c85ee99b42 Don't fail to load runtime if running LLI from the current directory
llvm-svn: 1044
2001-10-30 16:40:37 +00:00
Chris Lattner ff2a07f4df Initialize isRecursive. Found by Purify
llvm-svn: 1043
2001-10-30 16:39:16 +00:00
Chris Lattner 92fcd608cf Fix ordering problem. Found by purify. :)
llvm-svn: 1042
2001-10-30 16:38:49 +00:00
Chris Lattner cdb5936f45 Add testcase for missed SCCP optimization
llvm-svn: 1040
2001-10-30 03:22:59 +00:00
Chris Lattner 62d1fb6777 Print out a label if we step into the first instruction of a basic block
llvm-svn: 1038
2001-10-29 20:44:34 +00:00
Chris Lattner 490d2a8461 * Fix pow wrapper to actually work
* Implement rudimentary printf support for lli

llvm-svn: 1037
2001-10-29 20:27:45 +00:00
Chris Lattner 05fbeedde8 Implement getelementptr instruction as well as the load and store forms
that incorporate gep

llvm-svn: 1036
2001-10-29 19:32:19 +00:00
Chris Lattner eec6046adf I screwed up the macros, so of course strtol didn't work. *sigh*
llvm-svn: 1035
2001-10-29 17:47:10 +00:00
Chris Lattner cba9036e34 Fix broken assertion. Didn't allow for pointer case
llvm-svn: 1034
2001-10-29 17:27:38 +00:00
Chris Lattner 3e95c716aa 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
Chris Lattner 72f866eda3 Fix blatent bugs in checkin
llvm-svn: 1032
2001-10-29 16:40:32 +00:00
Chris Lattner b86620e9b1 Expose the WriteTypeSymbolic function from the library. Refactor code to make
this function explicit.  Cause WriteAsOperand to use symbolic types as available.

llvm-svn: 1031
2001-10-29 16:37:48 +00:00
Chris Lattner 790409a07a Expose some more printing functionality from the assembly writer library
llvm-svn: 1030
2001-10-29 16:36:49 +00:00
Chris Lattner 7bfee414aa Be careful to output symbolic type name if possible for a type. This makes
debugging the Olden/health benchmark actually possible.

llvm-svn: 1029
2001-10-29 16:05:51 +00:00
Chris Lattner 13babb6805 Remember to print out the next instruction if stepping over an external method call
llvm-svn: 1028
2001-10-29 16:05:19 +00:00
Chris Lattner 689049e1cd Fix problem next'ing over an external method
llvm-svn: 1027
2001-10-29 14:08:33 +00:00
Chris Lattner c6503e8a2f Oops, accidentally broke reading from stdin when doing command line arguments
llvm-svn: 1026
2001-10-29 14:00:48 +00:00
Chris Lattner 1711dcbd29 Test bitwise operations
llvm-svn: 1025
2001-10-29 13:56:42 +00:00
Chris Lattner 41a8289eb8 Check in to use moved stringizing code
llvm-svn: 1024
2001-10-29 13:39:38 +00:00
Chris Lattner e10ec076e9 Systems headers use <> not ""
llvm-svn: 1023
2001-10-29 13:29:50 +00:00
Chris Lattner 8c857b86fd Checkin of C string stuff. Fix several bugs, including most escape codes being
printed as '\\n' instead of their correct code.  Also print things in octal instead of hex.

llvm-svn: 1022
2001-10-29 13:28:00 +00:00
Chris Lattner 239a1bdfe1 Remove C string capability from VMCore library. Move to Support
llvm-svn: 1021
2001-10-29 13:27:09 +00:00
Chris Lattner 3bb79584d5 Include functionality to get a string array constant as a string
llvm-svn: 1020
2001-10-29 13:24:31 +00:00
Chris Lattner 0936089b67 Remove useCSyntax flag
llvm-svn: 1019
2001-10-29 13:22:49 +00:00
Chris Lattner 108d8d46b9 Initial checkin of name mangling code moved from linker
llvm-svn: 1018
2001-10-28 23:44:03 +00:00
Chris Lattner 84085ac517 Initial checkin of name mangling code. Moved from Linker.h
llvm-svn: 1017
2001-10-28 23:31:10 +00:00
Vikram S. Adve 66aea7a58c 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 fc361b1d55 Remove non linking related stuff
llvm-svn: 1015
2001-10-28 22:43:06 +00:00
Chris Lattner 328c9afafe Remove unneccesary function prototypes
llvm-svn: 1014
2001-10-28 22:40:59 +00:00
Chris Lattner 9cd1451b89 Fix some illegal uses of the ## operator
llvm-svn: 1013
2001-10-28 22:38:22 +00:00
Vikram S. Adve 5ff15721c9 Minor fix I omitted to check in.
llvm-svn: 1012
2001-10-28 22:19:06 +00:00
Vikram S. Adve eada6b128a Support printing control characters in standard C/assembly style,
if you specify useCSyntax = true.  The old style is still the default.

llvm-svn: 1011
2001-10-28 21:48:05 +00:00
Vikram S. Adve 33ec4a3c23 Record constants that need to be emitted in the assembly code.
llvm-svn: 1010
2001-10-28 21:46:23 +00:00
Vikram S. Adve 979800ede8 Allow combinations of True/Anti/Output flags for each edge to
support, e.g., dependences on Call instructions.

llvm-svn: 1009
2001-10-28 21:45:02 +00:00
Vikram S. Adve df6913549a Add edges between call instructions and (a) load/store instructions, and
(b) any instructions that use or set CC registers.  Whether or not the
latter are needed really should be machine-dependent.

llvm-svn: 1008
2001-10-28 21:43:33 +00:00
Vikram S. Adve 2f72cdd756 Generate SETX for 64-bit integers!
llvm-svn: 1007
2001-10-28 21:41:46 +00:00
Vikram S. Adve a5619eb835 Add SETX instruction for 64-bit constants.
Add M_CC_FLAG for many instructions that use int or fp CC registers.

llvm-svn: 1006
2001-10-28 21:41:01 +00:00
Vikram S. Adve b31f9c3ea6 Need to subtract, not add, stack size in SAVE instruction!
llvm-svn: 1005
2001-10-28 21:39:47 +00:00
Vikram S. Adve 71b265a848 Major overhaul to print globals and constants.
llvm-svn: 1004
2001-10-28 21:38:52 +00:00
Vikram S. Adve 6e26c8b0fc Added name-mangling routines for future use.
llvm-svn: 1003
2001-10-28 21:38:02 +00:00
Vikram S. Adve 96f6ac9ffc 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
Vikram S. Adve ef3544314e Added printPointer.
llvm-svn: 1001
2001-10-28 21:34:59 +00:00
Vikram S. Adve 1b7cc1e33b Runtime routines implementing print<TYPE> for all basic types.
llvm-svn: 1000
2001-10-28 21:31:33 +00:00
Vikram S. Adve 8716cdfb52 Added a constant pool to record values that need to be emitted
in the assembly code.

llvm-svn: 999
2001-10-28 21:24:50 +00:00
Vikram S. Adve e3b575497d Add support for name mangling.
llvm-svn: 998
2001-10-28 21:23:44 +00:00
Vikram S. Adve 42ea891fb8 Switch useLLVMSyntax to useCSyntax.
llvm-svn: 997
2001-10-28 21:21:25 +00:00
Vikram S. Adve 4a6067f959 Add calls to print results in fib, simpleadd and sumarray.
indirectcall is the same as fib but uses function pointers.

llvm-svn: 996
2001-10-28 21:16:34 +00:00
Vikram S. Adve e6298e3574 Support printing control characters in standard C/assembly style.
llvm-svn: 995
2001-10-28 21:06:48 +00:00
Vikram S. Adve 578a840b29 Add methods print<TYPE> for String, Pointer, and each primitive type.
llvm-svn: 994
2001-10-28 20:52:27 +00:00
Vikram S. Adve 03fb2f3916 Added rules for building sparc executable with and without tracing,
and linking with local runtime library.

llvm-svn: 993
2001-10-28 20:18:11 +00:00
Ruchira Sasanka 9c38dbc249 Added support for spilling
llvm-svn: 992
2001-10-28 18:15:12 +00:00
Ruchira Sasanka cf28a7c7d3 Moved callerSaving code to machine specific classes since we have to handle
%ccr reg differently.

llvm-svn: 991
2001-10-28 18:14:15 +00:00
Ruchira Sasanka 321ed7be93 Added spill code support; moved insertCallerSaving to SparRegInfo since
we need to handle %ccr reg in a special way.

llvm-svn: 990
2001-10-28 18:12:02 +00:00
Chris Lattner 009f8108bc Implement a -trace command line option and a trace option in the interpreter.
llvm-svn: 989
2001-10-27 08:43:52 +00:00
Chris Lattner 0b00b31c78 * Make pointer values work better by treating them uniformly as 64 bit values.
This causes code that is generated by gcc to work better.
* Implement mul & div
* Export malloc, free, and pow
* add strtol, atoi, and atol to the runtime library

llvm-svn: 988
2001-10-27 08:28:11 +00:00
Chris Lattner 6642eec003 Provide argv for commands
llvm-svn: 987
2001-10-27 05:54:31 +00:00
Chris Lattner e81c409952 Provide option to enable eating of all arguments following a specific one
llvm-svn: 986
2001-10-27 05:54:17 +00:00
Chris Lattner 15157b88e9 * Implement exit() builtin function
* Implement linked in runtime library with puts(char*) in it
* implement builtin putchar(int) function

llvm-svn: 985
2001-10-27 04:15:57 +00:00
Ruchira Sasanka 0863c161e9 Fixed load syntax in EmitAssembly
Fixed cpReg2Mem (store) operand oreder in SparcRegInfo.cpp

llvm-svn: 984
2001-10-24 22:05:34 +00:00
Chris Lattner f9e623e1f9 Add support for building a runtime library for LLI
llvm-svn: 983
2001-10-24 19:52:41 +00:00
Ruchira Sasanka 36bcd79050 Fixed logic for checking whether a LR received the correct color.
llvm-svn: 976
2001-10-24 15:56:58 +00:00
Chris Lattner ae31f5b65f Implement a -L command line argument to specify a search path. Implement minimal ar compatibility stuff
llvm-svn: 975
2001-10-24 06:23:00 +00:00
Chris Lattner d4617cdf41 Clean up error handling a bit. Add / as a seperator for command line arguments. This is just a big old ugly hack.
llvm-svn: 974
2001-10-24 06:21:56 +00:00
Chris Lattner e3fe1ac4ee Frivolous cleanups
llvm-svn: 973
2001-10-24 06:21:22 +00:00
Chris Lattner a065a732bf Dang it, do NOT check in code that enables debugging. Bad chris
llvm-svn: 972
2001-10-24 05:14:35 +00:00
Chris Lattner 7dacd514ca Two things:
1. Forward propogate a loaded constant to make debugging slightly less annoying
2. Fix an extremely nasty hard to find bug that really irritated me for the better
   part of 6 hours and was causing linking to die and bizarre and mysterious ways.
   Things should be much more stable now that this one liner has been fixed. GRR

llvm-svn: 971
2001-10-24 05:12:04 +00:00
Chris Lattner daebd7508d Changes to get some meaningful feedback from the bytecode reader. At some point this stuff should all be exception driven, but for now it is not.
llvm-svn: 970
2001-10-24 01:15:12 +00:00
Ruchira Sasanka 6a7f02082b Corrected a bug in SparcRegInfo.cpp - to add inserted instructions before a return
llvm-svn: 969
2001-10-23 21:40:39 +00:00
Ruchira Sasanka 33b0d85f65 added support to move "added instructions" after the delay slot
llvm-svn: 968
2001-10-23 21:38:42 +00:00
Ruchira Sasanka c300c6ba58 Added support to move "added instructions" after the delay slot
llvm-svn: 967
2001-10-23 21:38:00 +00:00
Chris Lattner ebaa78852c Add '-v' option to enable verbose output from the linker
llvm-svn: 966
2001-10-23 20:44:55 +00:00
Chris Lattner b046867a97 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 aeaec1ccb9 Remove unnamed prototypes that are created.
llvm-svn: 964
2001-10-23 15:30:18 +00:00
Chris Lattner adb4dbaef3 Negative FP constants... whodathunkit.
llvm-svn: 963
2001-10-23 04:13:01 +00:00
Chris Lattner 7540328e46 Oops, didn't mean to check in enabled debugging support. :(
llvm-svn: 962
2001-10-23 03:21:42 +00:00
Chris Lattner b5498aba50 Fixed a LONG standing, SCARY problem with bytecode encoding. It turns out to be an endian problem that only shows up with type 0 instructions in LARGE programs.
llvm-svn: 961
2001-10-23 03:21:10 +00:00
Chris Lattner 98960dce6d More symbol table bugfixes that are impossible to track down. Goody
llvm-svn: 960
2001-10-23 02:32:45 +00:00
Chris Lattner 0557f117dd Allow unresolved/opaque types to be read and written to bytecode files
llvm-svn: 959
2001-10-23 01:53:22 +00:00
Chris Lattner 61b665528e Fix another annoying bug that took forever to track down. This one involves abstract type resolution at a bad time that broke symbol tables.
llvm-svn: 958
2001-10-23 01:53:01 +00:00
Vikram S. Adve 4b9c7c23b2 Disable alloca code gen tests until size of extra args in stack frame
can be computed.

llvm-svn: 957
2001-10-22 22:33:08 +00:00
Vikram S. Adve 0009da41c6 Delete MachineCodeInfoForMethod object.
llvm-svn: 956
2001-10-22 22:32:11 +00:00
Chris Lattner 100884edad Fix a problem occuring with type unification of symbol table entries
llvm-svn: 955
2001-10-22 21:59:46 +00:00
Vikram S. Adve 4dedee5dc4 Simplify etags command.
llvm-svn: 954
2001-10-22 13:58:22 +00:00
Vikram S. Adve bdea601096 Added object of class MachineCodeForMethod.
llvm-svn: 953
2001-10-22 13:58:08 +00:00
Vikram S. Adve 21c3a754fc Added class MachineCodeForMethod to provide method-level information
about the generated native code (e.g., frame layout information).

llvm-svn: 952
2001-10-22 13:57:39 +00:00
Vikram S. Adve 0f228750ec Added function interfaces for generating prolog and epilog code.
The functions must be implemented by the target-specific code generator.

llvm-svn: 951
2001-10-22 13:56:33 +00:00
Vikram S. Adve 5dab57de99 Added function IsLeafMethod to identify leaf methods.
This will use the CallGraph only if one is provided.

llvm-svn: 950
2001-10-22 13:55:46 +00:00
Vikram S. Adve 4e594bebba Added MachineCodeForMethod object in class Method.
llvm-svn: 949
2001-10-22 13:52:47 +00:00
Vikram S. Adve 901da32e64 Use class MachineCodeForMethod to print machine code.
llvm-svn: 948
2001-10-22 13:52:03 +00:00
Vikram S. Adve cc80b02834 Added class MachineCodeForMethod.
llvm-svn: 947
2001-10-22 13:51:33 +00:00
Vikram S. Adve 3686293bd2 Cosmetic changes only.
llvm-svn: 946
2001-10-22 13:51:09 +00:00
Vikram S. Adve 9a6457388f Modify code that processes delay slots so that it preserves any
useful instructions already inserted into delay slots.

llvm-svn: 945
2001-10-22 13:49:27 +00:00
Vikram S. Adve 18a9e39214 UNUSED.
llvm-svn: 944
2001-10-22 13:46:38 +00:00
Vikram S. Adve a0177cdca5 Split JMPL into JMPLCALL and JMPLRET.
llvm-svn: 943
2001-10-22 13:44:53 +00:00
Vikram S. Adve 9090b50ba9 Added a frame layout class, and code to insert prolog/epilog code.
llvm-svn: 942
2001-10-22 13:44:23 +00:00
Vikram S. Adve 5462dca9f1 Reordered registers slightly to simplify a new check.
Added a function to map between the caller's and callee's register windows.

llvm-svn: 941
2001-10-22 13:43:08 +00:00
Vikram S. Adve 8498277e77 Split JMPL into JMPLCALL and JMPLRET so that IsCall and IsReturn can
be used to distinguish those uses of the `jmpl' instruction.

llvm-svn: 940
2001-10-22 13:41:12 +00:00
Vikram S. Adve 52e41008e3 Added functions to generate prolog and epilog code.
Use JMPLRET instead of RETURN for method returns so that

llvm-svn: 939
2001-10-22 13:36:31 +00:00
Vikram S. Adve 6b492ddc15 Added SAVE and RESTORE. Duplicated JMPL into JMPLCALL and JMPLRET,
which have the same opcode and operands but different flags.

llvm-svn: 938
2001-10-22 13:32:55 +00:00
Vikram S. Adve 7c1a8d6d53 Reordered a couple of registers to simplify some new checks.
Added code to map between caller's and callee's register windows.
Added frame layout class.

llvm-svn: 937
2001-10-22 13:31:53 +00:00
Chris Lattner e6b470c3f1 Remove ugly subclass of Opaque type
llvm-svn: 936
2001-10-22 06:01:08 +00:00
Chris Lattner d50fa5aa36 Fix bug with
%list = type {%list *}
%list = type {%list *}

not being accepted (broken testmisc.ll)

llvm-svn: 935
2001-10-22 05:56:09 +00:00
Chris Lattner fb864a35aa Fix bug exposed by this testcase:
declare int "call_operand"      (%rtx_def*, int)        ;; Prototype for: call_operand
declare int "restore_operand"   (%rtx_def*, int)        ;; Prototype for: restore_operand

%rtx_def = type opaque
%rtx_def = type int
implementation

llvm-svn: 934
2001-10-22 04:55:44 +00:00
Chris Lattner 6265d798d4 Two changes:
1. Delete type handle regardless of whether a collision occured
2. Remove a MAJOR pessimization of runtime performance (thought be be an optimization at the time).

This second one was causing a 105k llvm file (from gcc) to parse in 58 seconds... without the
'optimization' it now parses in 3.64 seconds.  I suck.

llvm-svn: 933
2001-10-21 23:02:41 +00:00
Chris Lattner b57ac6f4bd Fix erroneous assertion failure on the following code:
declare int "malloc"(...)

...

%reg112 = call int (...) * %malloc( uint %cast1007 )

llvm-svn: 932
2001-10-21 21:54:51 +00:00
Chris Lattner 28a63e2972 Fix bug caused by:
%list = type opaque
%list = type %list

llvm-svn: 931
2001-10-21 21:43:25 +00:00
Ruchira Sasanka 24729a34ce Added support for both call/jmpl instructions
llvm-svn: 930
2001-10-21 16:43:41 +00:00
Chris Lattner 18e81933c7 Fix problem with a cast instruction that must be expanded to type 0
llvm-svn: 929
2001-10-21 00:14:44 +00:00
Vikram S. Adve 9bc488984f Fixed printing of offset operand for RETURN instruction.
llvm-svn: 928
2001-10-20 21:33:50 +00:00
Vikram S. Adve 5731249137 Use CALL for direct function calls; JMPL for indirect ones.
llvm-svn: 927
2001-10-20 20:57:06 +00:00
Vikram S. Adve 72ebb454d0 Minor bug fix in printing operands of JMPL.
llvm-svn: 926
2001-10-20 20:56:40 +00:00
Chris Lattner b6fe2345f1 Fix shift printing when using a ubyte LHS
llvm-svn: 925
2001-10-20 09:33:10 +00:00
Chris Lattner c27b1d7bf3 Add support for And, XOR, and Or
llvm-svn: 924
2001-10-20 09:32:59 +00:00
Chris Lattner f96ef663e0 It is valid to have unsigned arrays as constants... the linker may initialize them later
llvm-svn: 923
2001-10-20 06:43:05 +00:00
Ruchira Sasanka 53516cd05b Added code to support unusable Suggested Colors.
llvm-svn: 922
2001-10-19 21:42:06 +00:00
Ruchira Sasanka 6a073498ba Added code so that colorIGNode does not unnecessarily reserve unusable
Suggested colors for neighbors.

llvm-svn: 921
2001-10-19 21:41:16 +00:00
Ruchira Sasanka 01c55ba00c Added code to PhyRegAlloc to mark unusable suggested regs
Added initialization to AdjList to IGNode constructor - major bug fix

llvm-svn: 920
2001-10-19 21:39:31 +00:00
Ruchira Sasanka 1437395c9f Added code to Initialize (MachineOperand) to initialize regNum to -1 -- Ruchira
llvm-svn: 919
2001-10-19 18:17:49 +00:00
Ruchira Sasanka d77a1bbc2f Corrected call interference bug - suggested color not allocated if
volatile and there are call interferences

llvm-svn: 918
2001-10-19 17:23:43 +00:00
Ruchira Sasanka 6275a04aac Changed Call interference info
llvm-svn: 917
2001-10-19 17:21:59 +00:00
Ruchira Sasanka 09d7a2a496 Corrected call interference bug
llvm-svn: 916
2001-10-19 17:21:03 +00:00
Chris Lattner 3923967f1e Fix to reference the right header
llvm-svn: 915
2001-10-19 15:39:14 +00:00
Ruchira Sasanka 6b1d2691c6 no major change
llvm-svn: 914
2001-10-18 23:58:08 +00:00
Vikram S. Adve c00a4343be *** empty log message ***
llvm-svn: 913
2001-10-18 22:47:50 +00:00
Ruchira Sasanka 59e864eb92 Added implict operand printing for operator( ostream, MachineInstr&)
llvm-svn: 912
2001-10-18 22:40:02 +00:00
Ruchira Sasanka 5f629318fa Added support for condition code loading/stroing in methods cpReg2Reg etc.
llvm-svn: 911
2001-10-18 22:38:52 +00:00
Ruchira Sasanka 0a2990a7c6 removed some debug messages
llvm-svn: 910
2001-10-18 22:36:26 +00:00
Chris Lattner d299dbac0e Enhancements to pass argc & argv to main if required
llvm-svn: 909
2001-10-18 21:55:32 +00:00
Chris Lattner cbe05f258e Check in new testcase based on .c file. Adapted to run with lli
llvm-svn: 908
2001-10-18 21:55:07 +00:00
Chris Lattner 90c912acaa Fix null termination issue
llvm-svn: 907
2001-10-18 21:54:42 +00:00
Chris Lattner bc647f6a01 Add new testcase from C source
llvm-svn: 906
2001-10-18 21:50:39 +00:00
Chris Lattner 1a9680f708 Remove unneccesary retcode var
llvm-svn: 905
2001-10-18 20:33:21 +00:00
Chris Lattner 95f87b4e5d Refactor Assembly/Bytecode writer code into Assembly & bytecode libraries
llvm-svn: 904
2001-10-18 20:32:07 +00:00
Chris Lattner 4ee7648815 Refactor code into Assembly & bytecode libraries
llvm-svn: 903
2001-10-18 20:31:54 +00:00
Chris Lattner 9e06a47525 initial checkin
llvm-svn: 902
2001-10-18 20:31:42 +00:00
Chris Lattner 2b4a64a31b move llvm/Transforms/Pass.h to the top level llvm/Pass.h file
llvm-svn: 901
2001-10-18 20:19:09 +00:00
Chris Lattner 75c9f9f958 Expose more xforms to the opt utility
llvm-svn: 900
2001-10-18 20:06:45 +00:00