Commit Graph

484 Commits

Author SHA1 Message Date
Chris Lattner
deed7a5ae3 * Continue cleanup of type printing code
* Print a newline after a malloc instruction
* Convert unprintable characters to x_ instead of _x so that we don't
  generate identifiers that start with underscores


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2577 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 15:18:52 +00:00
Chris Lattner
3ef6dc7bdd Gut the type printing code so there is only one copy of it instead of 3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2576 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 14:40:11 +00:00
Chris Lattner
2d05a1acb0 * Remove dead "constant printing" code
* Mangle names with only a prefix so that they are easier on the eyes.
* Put spaces around binary operators with low precedence to make them easier to read
* Don't prefix function names with &, although it's correct, it's unnecesary and
  easier to read without it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2575 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 05:16:40 +00:00
Chris Lattner
2a7ab2e46d Remove gross "Operand" instance variable
Remove lots of unneccesary arguments to methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2574 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 04:39:00 +00:00
Chris Lattner
2f49902374 Simplify and clean up function calls.
Now indirect function calls work, except that function pointer types are not correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2573 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 04:21:21 +00:00
Chris Lattner
2f5eb4e9a5 * Remove dead function
* Print C strings correctly
* Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2572 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 03:56:52 +00:00
Chris Lattner
4440826cae Make Getelementptr, load & store all work the right way.
Handle global variables correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2571 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 03:50:42 +00:00
Chris Lattner
2f5f51a852 Many random fixes:
* Use binary operator logic for shifts instead of cloning code
 * Unary not is '~' not '!'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2570 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 03:28:37 +00:00
Chris Lattner
f34ee81c5e Incorporate and purge function before and after printing them so unnamed values
have some hope of working right.

Function calls do not try to emit an lvalue if they return void.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2569 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 03:12:34 +00:00
Chris Lattner
b5af06a0ec Factor out the code to print a value to ONE place.
It turns out that unnamed values DO NOT work at all, that's next on the list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2568 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 03:06:06 +00:00
Chris Lattner
16c7bb2c8f First wave of cleanups, looks like the first of many.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2567 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 02:28:59 +00:00
Sumant Kowshik
9ddc86c6e5 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2552 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-08 18:09:58 +00:00
Chris Lattner
a163fdfc80 Extend TargetData::getIndexedOffset to support arrays and pointers!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2535 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 20:00:33 +00:00
Chris Lattner
9b625030c8 Replace all usages of Type::isPointerType with isa<PointerType>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
86e9187dcc Add neccesary #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2406 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:48:55 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
96c466b06a Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 14:57:45 +00:00
Chris Lattner
97e52e4336 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:27:06 +00:00
Chris Lattner
d50b671280 Add #include that was removed from TargetMachine.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2381 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:40:59 +00:00
Chris Lattner
97453d60c6 Include appropriate file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2379 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:40:16 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
bfeec103e1 Simplify and update code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2376 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:20:10 +00:00
Chris Lattner
1b7f7dc4b4 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:21:30 +00:00
Chris Lattner
8fc2f2072d Remove all contents of the cfg namespace to the global namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2369 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:19:42 +00:00
Chris Lattner
fd63f25fbd Simplify code
Remove unneccesary getID variant for module's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2353 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 04:50:54 +00:00
Chris Lattner
483e14ee04 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 07:27:19 +00:00
Chris Lattner
f57b845547 * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 06:56:12 +00:00
Chris Lattner
35504209a0 Use the cast<> operator in favor of C style casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2331 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 03:14:39 +00:00
Chris Lattner
1a18b7cf80 Change Constant::getNullConstant to Constant::getNullValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:25:14 +00:00
Chris Lattner
87e873bd3d Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2322 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:24:17 +00:00
Vikram S. Adve
d23a229c4c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2318 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:46:28 +00:00
Vikram S. Adve
0bc0516078 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2317 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:43:45 +00:00
Vikram S. Adve
31f78c4f6b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2316 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:42:21 +00:00
Vikram S. Adve
6d78311fd2 Added functions to compute which register, if any, to use
for a particular argument in a list of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2315 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:40:24 +00:00
Vikram S. Adve
dbc4fad577 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2314 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:37:51 +00:00
Vikram S. Adve
a4a943dd5a Implementation of class MachineFrameInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2313 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:35:27 +00:00
Vikram S. Adve
4876209aa6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2312 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:34:15 +00:00
Chris Lattner
4b1de8eb99 * getAsString requires that the input array is string compatible, so
assert it.
* Use WriteAsOperand instead of getStringValue for constants


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2296 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 18:15:38 +00:00
Chris Lattner
6228106e9f Just use << isntead of forcing getStrValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2294 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 18:14:40 +00:00
Chris Lattner
e4a94f2b0f Only print debug message if DEBUG_RA is on
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2254 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 22:41:48 +00:00
Chris Lattner
167b9629e1 Only emit message if DEBUG_RA is on
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2252 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 20:36:15 +00:00
Chris Lattner
f678dc6469 Handle the FP format problem, where outputed FP constants were not precise
enough.  This fixes compilation of the health benchmark.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2228 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-11 21:44:02 +00:00
Chris Lattner
73e214244f Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:48:49 +00:00
Chris Lattner
b62fc4a9b1 Eliminate unneccesary extraneous iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2215 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:46:27 +00:00
Chris Lattner
0ac5429ff0 Add explicit #includes of Function.h to make up for the removed #include
in iOther.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2209 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:08:28 +00:00
Chris Lattner
cc5933c47e iUse new form of pop_back to make code more concise
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2202 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 18:02:02 +00:00
Chris Lattner
9bbf99de5f No need to reserve space, erasing does not change the size of the container.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2201 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 18:01:21 +00:00
Chris Lattner
73c8d7520f Delete NOP instructions as they are eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2199 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 15:05:04 +00:00
Chris Lattner
af50d00829 * Add a file header with some information
* Delete the DelaySlotInfo objects created by the SchedulingManager class.
  These leaked objects were accounting for 3/4 of the memory leaked by the
  backend, so this is a relatively major win.
* Reorganize SchedulingManager::getDelaySlotInfoForInstr so that it has
  better code locality (making it easier to read).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2197 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 05:45:58 +00:00
Chris Lattner
1d21f3eb1d * Add a useful file comment
* Move InsertPrologEpilogCode class to PrologEpilogCodeInserter.cpp
   -> Among other things, this eliminates the need for the minstrVec static
      global array.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2195 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 05:21:26 +00:00