Commit Graph

2337 Commits

Author SHA1 Message Date
Vikram S. Adve 40221aa74c Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.

llvm-svn: 2318
2002-04-25 04:46:28 +00:00
Vikram S. Adve 776df77d14 Don't pad spills and temp. stack areas for alignment.
Freeze auto vars and spill areas when their sizes are used
for computing other offsets.

llvm-svn: 2317
2002-04-25 04:43:45 +00:00
Vikram S. Adve a6d94c9a76 Major changes to how int and FP arguments are handled. Varargs
function calls were simply wrong; other functions were just not
using all available registers.

llvm-svn: 2316
2002-04-25 04:42:21 +00:00
Vikram S. Adve a77a8eee50 Added functions to compute which register, if any, to use
for a particular argument in a list of arguments.

llvm-svn: 2315
2002-04-25 04:40:24 +00:00
Vikram S. Adve dccabec1ea Insert copy operations for FP arguments to a varargs function,
to copy the FP arg. to an integer.  Necessary so that the
register allocator has two different live ranges for the FP value
and the int. argument.

llvm-svn: 2314
2002-04-25 04:37:51 +00:00
Vikram S. Adve b63c4886c4 Implementation of class MachineFrameInfo.
llvm-svn: 2313
2002-04-25 04:35:27 +00:00
Vikram S. Adve 7a4b381f80 Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.

llvm-svn: 2312
2002-04-25 04:34:15 +00:00
Vikram S. Adve d79d2c3892 Improve printing during dumps.
llvm-svn: 2311
2002-04-25 04:31:18 +00:00
Vikram S. Adve 7092772475 Optional args are no longer allocated as they are discovered.
(This can be improved to avoid making the initial pass over the method.)
Also, ensure automatic vars and reg. spills areas are not extended
if their sizes are used for computing some other offset.

llvm-svn: 2310
2002-04-25 04:30:43 +00:00
Chris Lattner d46bb6e933 * Abort program on verification errors
* Verify that load, store, and GEP instructions indices are correct, because
  they _continually_ bite me on this pool allocations stuff

llvm-svn: 2309
2002-04-24 19:12:21 +00:00
Chris Lattner 21ea83bb3e Add some basic checks of CallInst's.
Assert now returns from the current function on error.

llvm-svn: 2308
2002-04-18 22:11:52 +00:00
Chris Lattner 271255b087 Programs that actually free memory were broken
llvm-svn: 2307
2002-04-18 22:11:30 +00:00
Chris Lattner a7d90ceccb Changes to make print pass work!
llvm-svn: 2306
2002-04-18 22:11:12 +00:00
Chris Lattner 0e851daf53 * Convert the verifier to use an InstVisitor to be better structured
* Implement checking that a binary operator's two sides are the same type
* Actually check that an instruction does not have a name if it has a void
  return type.

llvm-svn: 2305
2002-04-18 20:37:37 +00:00
Chris Lattner d8cec98cc1 New testcase
llvm-svn: 2304
2002-04-18 20:30:58 +00:00
Chris Lattner c065ad850c Make sure that there is no case where a signal can occur leaving a partially
written output file.  This is important because crashing testcases often write
part of a file out, and the testing harness decides the file is up-to-date next
time the test is run.

llvm-svn: 2303
2002-04-18 19:55:25 +00:00
Chris Lattner 1c2329ade3 Add new api for basic signal handling for tools
llvm-svn: 2302
2002-04-18 19:53:53 +00:00
Chris Lattner 67f206acc7 New api for signal handling for LLVM tools
llvm-svn: 2301
2002-04-18 19:53:34 +00:00
Chris Lattner 1ce991d6b9 Move asmwriter/getStrValue cruft into AsmWriter.cpp file.
llvm-svn: 2300
2002-04-18 18:53:33 +00:00
Chris Lattner 1e19468e4a Pull all of the getStrValue implementation cruft out of Constants.cpp and
put it into the AsmWriter.  This code is kinda gross and could probably be
cleaned up, but not now.

llvm-svn: 2299
2002-04-18 18:53:13 +00:00
Chris Lattner 1c8d3f8996 Add a fixme so that we don't forget this is broken.
llvm-svn: 2298
2002-04-18 18:52:03 +00:00
Chris Lattner 9844d8868f Remove getStrValue method from Constant implementations. The AssemblyWriter
now knows how to write out a constant, not the constants themselves.  This is
fixed due to the move of the AsmWriter to the VMcore library.

llvm-svn: 2297
2002-04-18 18:51:39 +00:00
Chris Lattner c3728c281b * getAsString requires that the input array is string compatible, so
assert it.
* Use WriteAsOperand instead of getStringValue for constants

llvm-svn: 2296
2002-04-18 18:15:38 +00:00
Chris Lattner bc1f09299e Make debugging code not use getStrValue
llvm-svn: 2295
2002-04-18 18:14:56 +00:00
Chris Lattner a20370661f Just use << isntead of forcing getStrValue
llvm-svn: 2294
2002-04-18 18:14:40 +00:00
Chris Lattner a2cdf2fb10 Print argument scalars as ellipses instead of boxes
llvm-svn: 2293
2002-04-18 18:14:19 +00:00
Chris Lattner 260ab20422 Significantly rework InstructionCombining to work better and to be cleaner.
We now use an InstVisitor to delegate to different cases that we are
interested in handling.  We also fix the FIXME's by adding users to the
worklist when appropriate.

llvm-svn: 2292
2002-04-18 17:39:14 +00:00
Chris Lattner 7bfa8b6223 New testcase.
llvm-svn: 2291
2002-04-18 17:35:39 +00:00
Chris Lattner 86d9dbe8ca * Add a comment to the header giving a breif overview of how to return a
value from a visit function
* Define a (file local) DELEGATE macro to make the code easier to read/maintain
* Define per-opcode delegation functions so that users can override specific
  instances of BinaryOperator for example.

llvm-svn: 2290
2002-04-18 16:16:16 +00:00
Chris Lattner b69c81d36c * Make dtor virtual
* Add a new defaulted argument that allows the instruction visitation
  visitors to return a non-void value.

llvm-svn: 2289
2002-04-18 15:46:40 +00:00
Chris Lattner ccfebfbb36 Check in the first test: make sure getelementptr gets folded
llvm-svn: 2288
2002-04-18 15:39:50 +00:00
Chris Lattner 5afa50eb5b Test the instruction combiner
llvm-svn: 2287
2002-04-18 15:39:15 +00:00
Chris Lattner 6e56079654 Convert SCCP over to use InstVisitor instead of hand crafted switch
llvm-svn: 2286
2002-04-18 15:13:15 +00:00
Chris Lattner cc6733b40a Remove gep::isStructSelector
CTor's do not allow names anymore for StoreInst objects

llvm-svn: 2285
2002-04-18 14:44:53 +00:00
Chris Lattner 5873900709 GEP instructions can never be constant propogated.
llvm-svn: 2284
2002-04-18 14:44:13 +00:00
Chris Lattner f40379e403 Store instructions always return void, so they never get a name
llvm-svn: 2283
2002-04-18 14:43:54 +00:00
Chris Lattner 3e78deaafd Correctly transform dependant arguments, allowing the perimeter bm to work.
llvm-svn: 2282
2002-04-18 14:43:30 +00:00
Chris Lattner b1c0335fc7 * StoreInst's shouldn't take names (they are _always_ void type)
* Remove two methods that are not used

llvm-svn: 2281
2002-04-18 14:42:27 +00:00
Chris Lattner d6010abae8 Fix a bug printing out %c formated characters.
llvm-svn: 2277
2002-04-17 17:43:01 +00:00
Chris Lattner bda898420b Inline indirect function calls that are only capable of calling one function
llvm-svn: 2275
2002-04-17 03:42:51 +00:00
Chris Lattner 79db55028c Make data structure acurately get ALL edges, even loads of null fields of
nodes that are not shadow nodes

This fixes em3d to be _correct_ if not optimial

llvm-svn: 2274
2002-04-17 03:24:59 +00:00
Chris Lattner 116dfdd6e1 Make data structure acurately get ALL edges, even loads of null fields of
nodes that are not shadow nodes

llvm-svn: 2273
2002-04-17 03:24:47 +00:00
Chris Lattner cf73caa5e8 Add casts for documentation
llvm-svn: 2272
2002-04-16 22:10:52 +00:00
Chris Lattner 28a01b2069 * Clean up the code a bit
* Allow structs with negative offsets.  This enables the em3d benchmark to
  be made typesafe.  In this case, the struct had an array as the first
  element, so a negative index was ok (the expr was -8 + 8x)

llvm-svn: 2271
2002-04-16 22:10:36 +00:00
Chris Lattner de9c04cff3 Remove old frivolous uses of getStrValue in a debugging statement
llvm-svn: 2270
2002-04-16 21:36:59 +00:00
Chris Lattner 25bf874ff5 Remove unneccesary cast
llvm-svn: 2269
2002-04-16 21:36:29 +00:00
Chris Lattner d84bb63750 Changes to:
* Fix bug printing method types (oops when converting previous code)
* Move some of the code from Constant::getStrValue implementations here.
  This allows us to do a MUCH MUCH better job printing out complex constant
  values (think an array of structure pointers), because we print symbolic
  type names instead of structural.  The assistance when debugging is immense

Eventually, Constant::getStrValue should be removed (it existed before because
the asmwriter file was not in VMCore), and everyone should go through the
asmwriter that want's equivalent functionality.

llvm-svn: 2268
2002-04-16 21:36:08 +00:00
Chris Lattner e629eda6b9 Fix for buggy test
llvm-svn: 2267
2002-04-16 21:31:08 +00:00
Chris Lattner 071dea7362 * Remove the concept of a critical shadow node
* Make the function pointer argument explicit for a call nodes
* Eliminate unreachable global values
* Merge call nodes that are identical

llvm-svn: 2266
2002-04-16 20:39:59 +00:00
Chris Lattner de86c86f10 Remove the concept of a critical shadow node
llvm-svn: 2265
2002-04-16 20:39:23 +00:00