Commit Graph

1466 Commits

Author SHA1 Message Date
Ruchira Sasanka 7765ca8b25 Added support method for setting interference for pseudo instructions
llvm-svn: 1303
2001-11-14 15:37:13 +00:00
Ruchira Sasanka f7a9a52e8d added isPseudoInstr()
llvm-svn: 1302
2001-11-14 15:35:51 +00:00
Ruchira Sasanka b8be6f6856 Added M_PSEUDO_FLAG for SETX .. instr
llvm-svn: 1301
2001-11-14 15:35:13 +00:00
Ruchira Sasanka f1acecccb6 Added interference for args in pseudo instructions
llvm-svn: 1300
2001-11-14 15:33:58 +00:00
Chris Lattner af84e627fd Rename cruft
llvm-svn: 1299
2001-11-14 11:28:18 +00:00
Chris Lattner 1237e86597 Remove much cruft from the MemAccessInst instruction
llvm-svn: 1298
2001-11-14 11:27:58 +00:00
Chris Lattner afea660cb5 Fix link prob
llvm-svn: 1297
2001-11-14 11:03:17 +00:00
Chris Lattner abf40ba6e8 Better heuristics for handling arrays
llvm-svn: 1296
2001-11-14 11:02:49 +00:00
Ruchira Sasanka 33c400f6a7 commented out lines printing code after scheduling
llvm-svn: 1295
2001-11-13 23:12:53 +00:00
Ruchira Sasanka 36f13d1c2f Fixed a bug concering LR spilling. Earlier, added spilled code was not inserted
into the instruction stream correctly.

llvm-svn: 1294
2001-11-13 23:09:30 +00:00
Ruchira Sasanka 1a9a7f2ef1 Changed checking for invalid register number - earlier it was uisng a contant
llvm-svn: 1293
2001-11-13 23:08:19 +00:00
Chris Lattner 4f534e6b3a Only use one form of printVal per program to avoid spurious link errors
llvm-svn: 1292
2001-11-13 06:27:19 +00:00
Chris Lattner 9754aba7f0 Implement some more rand functions for em3d benchmark
llvm-svn: 1291
2001-11-13 05:46:08 +00:00
Chris Lattner c047f4eb02 Overwrite files when linked
Remove native files when cleaned

llvm-svn: 1289
2001-11-13 05:44:27 +00:00
Chris Lattner 0cd962fa61 * 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 99ed5fb28d Minor style cleanups
llvm-svn: 1287
2001-11-13 04:59:58 +00:00
Chris Lattner 4f8e9468cb Avoid assertion failure when taking size of unsized array. Todo item herE
llvm-svn: 1286
2001-11-13 04:59:41 +00:00
Vikram S. Adve dafc8b909e Do the same for allocating spills to get their alignment right too.
llvm-svn: 1285
2001-11-12 23:40:22 +00:00
Vikram S. Adve 6e9422e14c When allocating space on stack for writing a register,
use the size of the register, not the size of the Value type,
to get the right alignment.

llvm-svn: 1284
2001-11-12 23:26:35 +00:00
Vikram S. Adve 4b9c46da24 Bug fix in offset alignment computations: don't subtract the padding
value from size *before* subtracting size from offset!

llvm-svn: 1283
2001-11-12 23:26:23 +00:00
Vikram S. Adve 097b7cb52a Distinguish LOCAL_LDFLAGS and LOCAL_LCFLAGS from LOCAL_CFLAGS.
In particular, never put -lm in LOCAL_[L]CFLAGS because it
disables an implicit rule that has LOCAL_CFLAGS as a prerequisite.

llvm-svn: 1281
2001-11-12 23:10:29 +00:00
Chris Lattner 7e42584354 Remove debug info :(
llvm-svn: 1280
2001-11-12 21:52:57 +00:00
Chris Lattner 7c627e7632 Fix bug in new assertion
llvm-svn: 1279
2001-11-12 21:48:38 +00:00
Ruchira Sasanka 20e105f4b1 Fixed a bug with pervious ColorCallArg
llvm-svn: 1278
2001-11-12 20:54:19 +00:00
Ruchira Sasanka 24e29431bc Canged ColorCallArg so that when a call arg is directly pushed on to stack
for argument passing, that instruction is directly added to the InstructionsBefore
set of the called machine instruction - i.e., it is not reordered.

llvm-svn: 1277
2001-11-12 20:31:47 +00:00
Chris Lattner f0cd13bc28 Add an assertion check
llvm-svn: 1276
2001-11-12 20:30:32 +00:00
Chris Lattner 4a797f461f I don't know what I was thinking
llvm-svn: 1275
2001-11-12 20:30:12 +00:00
Chris Lattner 747f016184 Print percentages for profiling info better
llvm-svn: 1274
2001-11-12 20:13:14 +00:00
Chris Lattner 1643e8ec7b Fix minor bug
llvm-svn: 1273
2001-11-12 20:13:04 +00:00
Ruchira Sasanka c189997516 For phi elimination, now we are generating only one instruction
using cpValue2Value instead of
passing vector to createCopyInstructionByType.

llvm-svn: 1272
2001-11-12 19:42:27 +00:00
Ruchira Sasanka cc3da8c107 Changed insert instructions only for CONSTANTS - back to original
llvm-svn: 1271
2001-11-12 19:32:04 +00:00
Vikram S. Adve 01daa32a92 Disable use of the Phi machine instruction which is no longer needed
for register allocation.

llvm-svn: 1270
2001-11-12 18:54:11 +00:00
Vikram S. Adve 03fae5e5db Eliminate most uses of the machine instruction vector for each LLVM instr,
since some m. instr. may be generated by LLVM instrs. in other blocks.
Handle non-SSA (anti and output) edges and true edges uniformly by
working with machine instructions alone.

llvm-svn: 1269
2001-11-12 18:53:43 +00:00
Chris Lattner a7482e05d0 Print profile info if exit() is called
llvm-svn: 1268
2001-11-12 16:28:48 +00:00
Chris Lattner e32deb455b Hack a structure profiling option together
llvm-svn: 1267
2001-11-12 16:19:45 +00:00
Ruchira Sasanka eb98368c29 Changed for adding Phi Elimination code
llvm-svn: 1266
2001-11-12 14:46:00 +00:00
Ruchira Sasanka fcdc2ff6e0 Added phi elimination code
llvm-svn: 1265
2001-11-12 14:45:33 +00:00
Ruchira Sasanka 9f246e65d3 Added phi elimination code - not final
llvm-svn: 1264
2001-11-12 14:44:50 +00:00
Vikram S. Adve 6e004c0818 Improved printing routines.
llvm-svn: 1263
2001-11-12 14:19:47 +00:00
Vikram S. Adve dff0a891c1 Major improvement to how nodes are built for a BB.
LLVM instruction is no longer recorded in each node, but BB is.

llvm-svn: 1262
2001-11-12 14:18:01 +00:00
Vikram S. Adve 3b02a35a80 Adjust all stack variable offsets to be aligned by size.
llvm-svn: 1261
2001-11-12 05:17:23 +00:00
Vikram S. Adve e7dc82ec0d Fix dumb bug in alignment adjustment code!
llvm-svn: 1260
2001-11-12 05:16:39 +00:00
Vikram S. Adve 68d00415b4 Fix bogus code that was eliminating needed args.
llvm-svn: 1259
2001-11-11 23:11:36 +00:00
Ruchira Sasanka 80fc434970 Fixed FP and SP usage. SP for outgoing args - for everything else FP
llvm-svn: 1258
2001-11-11 22:37:51 +00:00
Ruchira Sasanka 2d5c48fcc9 cahnged StackPointer accesses to FramePointer
llvm-svn: 1257
2001-11-11 21:49:37 +00:00
Vikram S. Adve 1d5c6e0939 Fix errors in computing downgrowing offsets, and in
computing size of extra outgoing args.

llvm-svn: 1256
2001-11-11 21:23:33 +00:00
Vikram S. Adve b3b55ae4b1 Down-growing offsets from FP should start at 0, not -1.
llvm-svn: 1255
2001-11-11 21:22:11 +00:00
Vikram S. Adve 6cd83556e6 Only add true dep. edges from an earlier to a later instruction.
This wasn't a problem until we started putting copies for Phi values
that produced cycles in the SchedGraph!

llvm-svn: 1254
2001-11-11 01:23:27 +00:00
Ruchira Sasanka d1d5e97431 Changed code to ignore Phi Nodes in PhyRegAlloc
llvm-svn: 1253
2001-11-10 21:21:36 +00:00
Ruchira Sasanka 0c0859846a Corrected reodering code for instructions inserted before calls
llvm-svn: 1252
2001-11-10 21:20:43 +00:00
Ruchira Sasanka bbbc6a3b17 Made isPhi const
llvm-svn: 1251
2001-11-10 20:58:58 +00:00
Vikram S. Adve b4489fb853 Use cc instead of gcc to compile *.native
llvm-svn: 1250
2001-11-10 14:23:54 +00:00
Chris Lattner 49ec72411e Initail checking of structure swapper
llvm-svn: 1248
2001-11-10 07:28:25 +00:00
Chris Lattner b98ec7f369 Testcase for structure field reordering
llvm-svn: 1247
2001-11-10 07:26:59 +00:00
Chris Lattner 5dada09565 Initial checkin of structure mutator
llvm-svn: 1246
2001-11-10 07:26:31 +00:00
Chris Lattner b0de5f1cf2 Initial checkin of Structure mutator
llvm-svn: 1245
2001-11-10 07:26:22 +00:00
Chris Lattner fc92c5fa1a Add hooks to call the new swap structcontents pass
llvm-svn: 1243
2001-11-10 07:16:10 +00:00
Chris Lattner dcad3cc848 add Yet Another Instance of a Static Library
llvm-svn: 1242
2001-11-10 07:15:53 +00:00
Chris Lattner 636539d48e Provide const version of function with the name the other will be eventually renamed to
llvm-svn: 1241
2001-11-10 06:48:14 +00:00
Chris Lattner 9b474fdf2b Refactor some functionality to expose more useful stuff
llvm-svn: 1240
2001-11-10 06:47:45 +00:00
Vikram S. Adve 295600c417 Several bug fixes in printing constants, particularly with unsized
arrays and multi-dimensional arrays.

llvm-svn: 1239
2001-11-10 02:03:06 +00:00
Vikram S. Adve 209d8e1c3b Must generate an instruction for GetElementPtr if single user is not
a memory instruction!

llvm-svn: 1238
2001-11-10 01:05:26 +00:00
Ruchira Sasanka 1812fc499d Disabled some debuggin messages
llvm-svn: 1237
2001-11-10 00:26:55 +00:00
Ruchira Sasanka 31305c0d57 Coalesing bug fix - now checks for the same regType instead of the same
regClass since FP class has two reg Types.

llvm-svn: 1236
2001-11-10 00:20:24 +00:00
Ruchira Sasanka d499a26116 No major change
llvm-svn: 1235
2001-11-09 23:49:42 +00:00
Ruchira Sasanka d0d294afde Added code for correct reordering of call arguments
llvm-svn: 1234
2001-11-09 23:49:14 +00:00
Chris Lattner 8657606b6e Add hooks for the FindUsedTypes pass
llvm-svn: 1233
2001-11-09 05:27:34 +00:00
Chris Lattner 7082e110f7 New pass to find types in use by a program
llvm-svn: 1232
2001-11-09 05:27:21 +00:00
Chris Lattner c0239b78ec New pass to figure out what types are in use by a program
llvm-svn: 1231
2001-11-09 05:27:10 +00:00
Vikram S. Adve 21cbb36e3d Added function LL__main.
llvm-svn: 1230
2001-11-09 02:21:38 +00:00
Vikram S. Adve 1c96dfd7af Added class MachineCacheInfo.
llvm-svn: 1229
2001-11-09 02:20:18 +00:00
Vikram S. Adve 2ccb900add Add support to print constant arrays and structures.
Align data larger than an L1 cache line on L1 cache line boundary.

llvm-svn: 1228
2001-11-09 02:19:29 +00:00
Vikram S. Adve bc23cf5521 Do the same for float->int that we did for int->float earlier.
Also check IsPointerType() in addition to IsIntegral() in several places.

llvm-svn: 1227
2001-11-09 02:18:16 +00:00
Vikram S. Adve e6642f93d4 Added function UltraSparcInstrInfo::CreateCodeToCopyFloatToInt.
llvm-svn: 1226
2001-11-09 02:16:40 +00:00
Vikram S. Adve f34fa6956d Added class UltraSparcCacheInfo.
llvm-svn: 1225
2001-11-09 02:16:04 +00:00
Vikram S. Adve 367f34f7cc Bug fix: Need to include the stack offset "bias" in assembly code itself.
Added class UltraSparcCacheInfo.
Added function to convert float to int by copying via memory.

llvm-svn: 1224
2001-11-09 02:15:52 +00:00
Vikram S. Adve 313a36f2d3 Use node->getOpCode() instead of node->getMachineInstr()->getOpCode().
Much nicer.

llvm-svn: 1223
2001-11-09 02:14:20 +00:00
Vikram S. Adve e76d3bcb31 Cache parameters for target machine.
llvm-svn: 1222
2001-11-09 02:11:25 +00:00
Vikram S. Adve 7977a283e6 Added class MachineCacheInfo.
Also added function to convert float to int by copying via memory.

llvm-svn: 1221
2001-11-09 02:11:03 +00:00
Chris Lattner 0043cc1109 Remove false optimization that basically broke everything
llvm-svn: 1219
2001-11-09 01:08:10 +00:00
Chris Lattner 54e9f453c9 * 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 2b48b9694c Add method decl
llvm-svn: 1217
2001-11-08 20:55:05 +00:00
Chris Lattner 2a4e3cfab7 Remove unneeded forward decl
llvm-svn: 1216
2001-11-08 20:54:51 +00:00
Chris Lattner 583e95e0b2 Improve raising significantly
llvm-svn: 1214
2001-11-08 20:19:56 +00:00
Chris Lattner cf66422978 Print the method that makes an instruction invalid
llvm-svn: 1213
2001-11-08 19:29:51 +00:00
Ruchira Sasanka dc709780aa corrected insertCode4Spilled ... bug.
llvm-svn: 1212
2001-11-08 19:11:30 +00:00
Vikram S. Adve b92658976a Eliminate cleaning step for individual %.bc files created by our gcc.
llvm-svn: 1211
2001-11-08 18:42:08 +00:00
Vikram S. Adve 7048762a3e Took out .clean.bc target.
llvm-svn: 1210
2001-11-08 18:25:05 +00:00
Vikram S. Adve 17bfd13a39 Run cleaning pass only when linking multiple files.
llvm-svn: 1209
2001-11-08 18:14:20 +00:00
Vikram S. Adve 04a251d785 Add cleaning pass after linking.
llvm-svn: 1208
2001-11-08 18:13:17 +00:00
Ruchira Sasanka 19a5165c29 Uncommented LR spill code insertion
llvm-svn: 1207
2001-11-08 16:43:25 +00:00
Vikram S. Adve 7543782956 Keep *.s files while we're debugging the native code.
Also, fix rule for $(LLCLIBS).

llvm-svn: 1206
2001-11-08 14:31:05 +00:00
Vikram S. Adve 56e61ec517 Bug fix: need to use .reserve for uninitialized data.
llvm-svn: 1205
2001-11-08 14:29:57 +00:00
Vikram S. Adve 7a3c4070d6 Add rule for %.clean.bc.
llvm-svn: 1204
2001-11-08 05:28:08 +00:00
Vikram S. Adve 3b193679f0 Bug fix: cannot modify Phi operands while iterating over them!
llvm-svn: 1203
2001-11-08 05:25:33 +00:00
Vikram S. Adve e4e91e3835 Add handle to object MachineFrameInfo.
llvm-svn: 1202
2001-11-08 05:23:45 +00:00
Vikram S. Adve e6ecf513a1 Include handle to TargetMachine in each Machine...Info class.
llvm-svn: 1201
2001-11-08 05:22:43 +00:00
Vikram S. Adve 06d8c600ea Add method CreateCodeToCopyIntToFloat.
Include handle to TargetMachine in each Machine...Info object.

llvm-svn: 1200
2001-11-08 05:22:15 +00:00
Vikram S. Adve 621b90440b Major change to how defs are found when adding dependences (they
are now found as part of the initial walk of the machine code).
Also memory load/store instructions can be generated for non-memory
LLVM instructions, which wasn't handled before.  It is now.

llvm-svn: 1199
2001-11-08 05:20:23 +00:00
Vikram S. Adve 80310bba37 MachineCodeForMethod is now an annotation on class Method.
llvm-svn: 1198
2001-11-08 05:18:18 +00:00
Vikram S. Adve c2f8911114 Add handle to TargetMachine object in all Machine...Info classes.
llvm-svn: 1197
2001-11-08 05:15:08 +00:00
Vikram S. Adve 81908213ae Added support for bitwise logical operators. Use different labels for
for these than for boolean logicals to avoid making Burg diverge.
See Burg manual for more information.

llvm-svn: 1196
2001-11-08 05:14:02 +00:00
Vikram S. Adve 03f12f521f Fixed function getEscapedString to follow the Sparc assembly rules
for symbol names!  (And renamed it to getValidSymbolName).
Fixed format for float and other constants.

llvm-svn: 1195
2001-11-08 05:12:37 +00:00
Vikram S. Adve f889a11590 Fix bugs in FITOS/D instruction generation.
The space for optional args in the stack frame is now being computed,
so finish the code generation for the variable `alloca'.
Finally, made a major overhaul of how stack frame is managed.

llvm-svn: 1194
2001-11-08 05:04:09 +00:00
Vikram S. Adve 503d3098fa Added new function UltraSparcInstrInfo::CreateCodeToCopyIntToFloat.
Also major overhaul of how stack frame is managed.

llvm-svn: 1193
2001-11-08 04:57:53 +00:00
Vikram S. Adve 7a1524f971 Removed class RegStackOffsets and used class MachineCodeForMethod
directly to manage stack frame.

llvm-svn: 1192
2001-11-08 04:56:41 +00:00
Vikram S. Adve 6fcb28924b Use MachineFrameInfo as base class of UltraSparcFrameInfo, and made
a major overhaul of this class and how stack frames are managed.

llvm-svn: 1191
2001-11-08 04:55:13 +00:00
Vikram S. Adve 1ef453c2ff Machine-independent interface to target's stack frame layout parameters.
llvm-svn: 1190
2001-11-08 04:52:27 +00:00
Vikram S. Adve e316915197 Use different op labels for bitwise logical operations and boolean logical
operations in BURG input trees.

llvm-svn: 1189
2001-11-08 04:51:39 +00:00
Vikram S. Adve 70dd1d4ee4 Added a second constructor for and improved class TmpInstruction.
llvm-svn: 1188
2001-11-08 04:50:33 +00:00
Vikram S. Adve bdbb802c2f Added two minor methods.
llvm-svn: 1187
2001-11-08 04:49:52 +00:00
Vikram S. Adve d9f8598104 Removed class RegStackOffsets and used class MachineCodeForMethod
directly to manage stack frame.

llvm-svn: 1186
2001-11-08 04:48:50 +00:00
Vikram S. Adve c53037205b Major overhaul of stack frame management.
llvm-svn: 1185
2001-11-08 04:47:06 +00:00
Vikram S. Adve 07900bde2d Old file which was moved to include/llvm/Target some time back.
llvm-svn: 1184
2001-11-08 04:46:08 +00:00
Vikram S. Adve b375b89e00 Removed MachineCodeForMethod object and made it an annotation.
llvm-svn: 1183
2001-11-08 04:38:58 +00:00
Chris Lattner c1c54a2a92 Add analysis pass.
llvm-svn: 1182
2001-11-07 21:16:29 +00:00
Chris Lattner 83f1528061 Initial checkin of pointer safety checker
llvm-svn: 1181
2001-11-07 21:16:12 +00:00
Chris Lattner b1f672812b Correct problem that allows indirect function calls
llvm-svn: 1179
2001-11-07 20:12:30 +00:00
Chris Lattner 31e9e4d219 * Switch to operation on pointers with PointerTy more consistently
* Fix misspeling
* Catch SIGFPE for traps
* info XXX now prints the raw contents of the GenericValue
* Switch to calloc instead of malloc (temporarily I hope) to bandaid Olden benchmarks
* Implement binary And & Or
* Convert expressions like this:
     PointerTy SrcPtr = getOperandValue(I->getPtrOperand(), SF).PointerVal;
  to:
    GenericValue SRC = getOperandValue(I->getPtrOperand(), SF);
    PointerTy SrcPtr = SRC.PointerVal;
  because the prior way confuses purify.
* Taint the initial values of the value planes
* Handling 'print bb4' in the interpreter without crashing
* Print nicer stack frames with concise return type
* printf doesn't suck nearly as badly as it used to

llvm-svn: 1177
2001-11-07 19:46:27 +00:00
Chris Lattner 75586e2ace 1. -Winline emits spurious warnings that aren't useful right now
2. Fix the "rebuild everything if I change one file" problem

llvm-svn: 1176
2001-11-07 14:50:58 +00:00
Chris Lattner e147d062fa Killing warnings
llvm-svn: 1175
2001-11-07 14:01:59 +00:00
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