Commit Graph

550 Commits

Author SHA1 Message Date
Chris Lattner 0837ed1d79 Don't die on call instructions, which reference methods
llvm-svn: 1593
2002-01-30 23:00:41 +00:00
Chris Lattner d121040e2b Check in GCC 3.02 compatiblity headers for GCC 2.95.3
llvm-svn: 1590
2002-01-30 16:27:12 +00:00
Chris Lattner 7209dc2446 Remove opt namespace
llvm-svn: 1587
2002-01-26 22:47:07 +00:00
Chris Lattner 1afb8f9669 * Expose new pass DeadInstElimination
* Add comments that describe the differences between the DCE passes

llvm-svn: 1553
2002-01-23 05:47:35 +00:00
Chris Lattner d97e1b8a49 Pull run() into Pass.cpp
llvm-svn: 1552
2002-01-23 05:46:22 +00:00
Chris Lattner 4f0f09757d Pull RaiseAllocations stuff out of the CleanGCC pass into it's own pass in
the ChangeAllocations.h header file.

llvm-svn: 1522
2002-01-22 00:13:51 +00:00
Chris Lattner d07471d6c3 LowerAllocations is really a BasicBlock pass. Make it so.
llvm-svn: 1521
2002-01-21 23:34:02 +00:00
Chris Lattner ee965abc36 Move stuff out of the Optimizations directories into the appropriate Transforms
directories.  Eliminate the opt namespace.

llvm-svn: 1520
2002-01-21 23:17:48 +00:00
Chris Lattner a877de2ef2 Fix for problem that caused both HUGE and INVALID latencies to be negative
llvm-svn: 1513
2002-01-21 22:42:49 +00:00
Chris Lattner 6bd33c8458 Include all header files individually instead of this one
llvm-svn: 1512
2002-01-21 21:45:44 +00:00
Chris Lattner d9f1ab2077 Pull stuff out of opt namespace
llvm-svn: 1511
2002-01-21 21:44:38 +00:00
Chris Lattner 2b2a8b1cac Moved header
llvm-svn: 1509
2002-01-21 07:41:55 +00:00
Chris Lattner 0686e435d1 Implement a more powerful, simpler, pass system. This pass system can figure
out how to run a collection of passes optimially given their behaviors and
charactaristics.

Convert code to use it.

llvm-svn: 1507
2002-01-21 07:31:50 +00:00
Chris Lattner e8d81d0819 Implement a more powerful, simpler, pass system. This pass system can figure
out how to run a collection of passes optimially given their behaviors and
charactaristics.

llvm-svn: 1506
2002-01-21 07:31:00 +00:00
Chris Lattner 7f74a56e24 Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Ruchira Sasanka 67ff729539 Added more comments
llvm-svn: 1495
2002-01-07 19:57:37 +00:00
Ruchira Sasanka 523f5e76e7 MachineRegInfo: Added a method to get the size of a register pushed on to stack.
llvm-svn: 1492
2002-01-07 19:17:41 +00:00
Ruchira Sasanka f20079dfed Added comments, destructors where necessary.
llvm-svn: 1491
2002-01-07 19:16:26 +00:00
Vikram S. Adve ecce65a4ba Eliminate function getIndicesBROKEN().
llvm-svn: 1486
2001-12-15 00:37:12 +00:00
Vikram S. Adve cb2335f13f Eliminate all uses of memInst->getIndicesBROKEN().
llvm-svn: 1485
2001-12-15 00:36:32 +00:00
Vikram S. Adve 721fee255c getIndexedOffset() shd take vector of Values, not of Constants!
llvm-svn: 1484
2001-12-15 00:35:48 +00:00
Chris Lattner 64a028b47a Initial checkin of instcombine
llvm-svn: 1479
2001-12-14 16:52:09 +00:00
Chris Lattner 7c84dc6abb Refactor trace values to work as a proper pass. Before it used to add
methods while the pass was running which was a no no.  Now it adds the
printf method at pass initialization

llvm-svn: 1456
2001-12-14 16:23:53 +00:00
Chris Lattner 8ddb00c804 * Remove support for unsized arrays.
* Free instruction does not accept a name
* MemAccessInst can now be used with cast/isa/dyn_cast/...

llvm-svn: 1455
2001-12-14 16:22:56 +00:00
Chris Lattner 8e4131077a PointerType and ArrayType now subclass Sequential type, which contains addressability logic for indexing. Unsized arrays have been removed.
llvm-svn: 1454
2001-12-14 16:20:21 +00:00
Chris Lattner 156344c890 Swap operands now preserves the semantics of the binary operator by changing
the opcode of the instruction if possible.

llvm-svn: 1444
2001-12-13 00:43:03 +00:00
Chris Lattner 49e9f8e2d4 Implement some nice functions useful for looking at types
llvm-svn: 1442
2001-12-13 00:40:16 +00:00
Chris Lattner 15778ac793 Implement proper iterator tags
llvm-svn: 1441
2001-12-13 00:39:49 +00:00
Chris Lattner e0c16866c6 Subclasses can change the opcode of an instruction
llvm-svn: 1440
2001-12-13 00:39:33 +00:00
Chris Lattner e6a24c2f4d Constants KNOW they are of a derived type
llvm-svn: 1439
2001-12-13 00:38:57 +00:00
Ruchira Sasanka 565a5c423d Added comments are more documentation info
llvm-svn: 1434
2001-12-08 21:04:22 +00:00
Chris Lattner 2413b160ec Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()

llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Chris Lattner 3462ae3ad7 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h

llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner bca18d7d96 Simplify induction variables pass
llvm-svn: 1406
2001-12-03 18:05:13 +00:00
Chris Lattner fb5ae02e1a Split the PHINode class out from the iOther.h file into the iPHINode.h file
llvm-svn: 1405
2001-12-03 18:02:31 +00:00
Chris Lattner 66d9ceaaba Induction variables must be phi nodes
llvm-svn: 1402
2001-12-03 17:27:42 +00:00
Chris Lattner b4c677745e Move support directory
llvm-svn: 1401
2001-11-29 16:32:16 +00:00
Chris Lattner 5de2204fe8 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner f679703feb Move DataTypes.h from llvm/Support to just Support
llvm-svn: 1399
2001-11-26 23:04:08 +00:00
Chris Lattner a5f8480ba2 Remove unused method
llvm-svn: 1368
2001-11-26 18:50:26 +00:00
Chris Lattner 53710e74cf Expose constant prop of an instruction
llvm-svn: 1367
2001-11-26 18:50:11 +00:00
Chris Lattner 0393197f32 Fix field initialization order problem
llvm-svn: 1366
2001-11-26 18:49:54 +00:00
Chris Lattner a57cea2e2e Allow output of manipulators for GCC 2.96 compatibility
llvm-svn: 1365
2001-11-26 18:49:33 +00:00
Chris Lattner d9d9039e13 Add writer support for call graph nodes and loops and induction variables
llvm-svn: 1364
2001-11-26 18:47:46 +00:00
Chris Lattner e409c460bf Implement an entry node for the call graph
llvm-svn: 1363
2001-11-26 18:47:11 +00:00
Chris Lattner 44c3b4f841 Implement "internal vs external linkage" which corresponds to the C notion of static
llvm-svn: 1362
2001-11-26 18:46:40 +00:00
Chris Lattner bd422e6686 Implement DCE of global values
llvm-svn: 1360
2001-11-26 18:42:17 +00:00
Chris Lattner 6de9942b92 * Implement dominator based loop identification
* Implement cleaner induction variable identification

llvm-svn: 1359
2001-11-26 18:41:20 +00:00
Chris Lattner e1531446aa Rearrange code
llvm-svn: 1334
2001-11-26 16:49:49 +00:00
Chris Lattner fcda44a75d Allow array indexing
llvm-svn: 1333
2001-11-26 16:49:12 +00:00
Chris Lattner 678b377fae Be more const correct
llvm-svn: 1332
2001-11-26 16:48:56 +00:00
Chris Lattner f12d124f42 * Remove the indexVec stuff which gets out of sync with the operands of the
instruction.
* Change the indices to take a vector of Value's instead of ConstPoolVal's
  for array indexing
* Add new idx_ iterator support for iterating over indices

llvm-svn: 1331
2001-11-26 16:48:41 +00:00
Chris Lattner 7e26de46a3 New Method isLosslesslyConvertableTo
llvm-svn: 1330
2001-11-26 16:47:10 +00:00
Chris Lattner ee35c37a0a Add new CompositeType shared baseclass of ArrayType and StructType
llvm-svn: 1329
2001-11-26 16:46:45 +00:00
Chris Lattner 70af97db27 Add casts
llvm-svn: 1328
2001-11-26 16:46:09 +00:00
Chris Lattner f9aea74156 Fix protection probs
llvm-svn: 1321
2001-11-15 15:24:31 +00:00
Vikram S. Adve f8cb028326 Modify method AllocateLocalVar to take size argument.
llvm-svn: 1320
2001-11-15 15:23:02 +00:00
Vikram S. Adve 4cfdb79dce Bug fix for Chris.
llvm-svn: 1316
2001-11-15 15:00:48 +00:00
Chris Lattner 02c43c8609 -cleangcc pass now remove type names that are never referenced and type names for pointers to primitive types.
llvm-svn: 1312
2001-11-15 04:34:46 +00:00
Vikram S. Adve 7e833073e3 Add function returning which operand holds immediate constant
for a given opcode.

llvm-svn: 1307
2001-11-14 18:48:36 +00:00
Ruchira Sasanka f7a9a52e8d added isPseudoInstr()
llvm-svn: 1302
2001-11-14 15:35:51 +00:00
Chris Lattner 1237e86597 Remove much cruft from the MemAccessInst instruction
llvm-svn: 1298
2001-11-14 11:27:58 +00:00
Ruchira Sasanka eb98368c29 Changed for adding Phi Elimination code
llvm-svn: 1266
2001-11-12 14:46:00 +00:00
Ruchira Sasanka bbbc6a3b17 Made isPhi const
llvm-svn: 1251
2001-11-10 20:58:58 +00:00
Chris Lattner 49ec72411e Initail checking of structure swapper
llvm-svn: 1248
2001-11-10 07:28:25 +00:00
Chris Lattner b0de5f1cf2 Initial checkin of Structure mutator
llvm-svn: 1245
2001-11-10 07:26:22 +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
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 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 2a4e3cfab7 Remove unneeded forward decl
llvm-svn: 1216
2001-11-08 20:54:51 +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 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 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 83f1528061 Initial checkin of pointer safety checker
llvm-svn: 1181
2001-11-07 21:16:12 +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 0758abd126 New class to provide high performance writing.
llvm-svn: 1167
2001-11-07 04:20:50 +00:00
Vikram S. Adve 59a13288a6 Make reg. numbers signed ints.
llvm-svn: 1137
2001-11-05 03:56:02 +00:00
Chris Lattner 33d9cb9903 Minor method rename
llvm-svn: 1119
2001-11-04 08:08:34 +00:00
Chris Lattner 34f8595c0b Add a helper function to PHI node
llvm-svn: 1113
2001-11-03 21:08:00 +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 97b93aea81 Moved InsertCallerSaveInstr to the SparcRegInfo.cpp and made machine independent
llvm-svn: 1107
2001-11-03 17:14:13 +00:00
Chris Lattner 4f1ca018aa Fix major bugs in type resolution
llvm-svn: 1092
2001-11-03 03:27:53 +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 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 63ac2b335a Expose the low level DCE mechanism to external users
llvm-svn: 1082
2001-11-01 07:00:21 +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 8ac538db47 Initial checkin of level raising code
llvm-svn: 1073
2001-11-01 02:41:52 +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 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 b3f4d1bc73 New GCC cleanup pass interface
llvm-svn: 1061
2001-10-31 04:32:53 +00:00
Chris Lattner 92fcd608cf Fix ordering problem. Found by purify. :)
llvm-svn: 1042
2001-10-30 16:38:49 +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 e10ec076e9 Systems headers use <> not ""
llvm-svn: 1023
2001-10-29 13:29:50 +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 84085ac517 Initial checkin of name mangling code. Moved from Linker.h
llvm-svn: 1017
2001-10-28 23:31:10 +00:00
Chris Lattner 328c9afafe Remove unneccesary function prototypes
llvm-svn: 1014
2001-10-28 22:40:59 +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 e6298e3574 Support printing control characters in standard C/assembly style.
llvm-svn: 995
2001-10-28 21:06:48 +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
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
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 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 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
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
Ruchira Sasanka 24729a34ce Added support for both call/jmpl instructions
llvm-svn: 930
2001-10-21 16:43:41 +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
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 eaf039a94b Initial Checkin
llvm-svn: 896
2001-10-18 20:05:30 +00:00
Chris Lattner 689dccca31 Pull bytecode writing out of Module writer pass. Prepare to move to seperate file
llvm-svn: 895
2001-10-18 20:05:07 +00:00
Chris Lattner c063e73879 Add operator[] accessors
llvm-svn: 894
2001-10-18 20:04:40 +00:00
Vikram S. Adve 7c15313822 Add option to print per module instead of per method, so that
global declarations are also printed.

llvm-svn: 891
2001-10-18 18:13:49 +00:00
Vikram S. Adve fe2f987d5e Add option to print as bytecode instead of assembly.
llvm-svn: 887
2001-10-18 13:47:49 +00:00
Chris Lattner fb742a58ee Convert to new simpler Pass structure
Componentize better

llvm-svn: 879
2001-10-18 05:22:27 +00:00
Chris Lattner b0b04facf0 Convert to new simpler Pass structure
llvm-svn: 878
2001-10-18 05:22:15 +00:00
Chris Lattner 92f1951e5b Convert to new simpler pass structure
llvm-svn: 877
2001-10-18 05:21:56 +00:00
Chris Lattner e3ad91c7ae Simplify Pass by removing silly subclasses
Fix an iterator problem

llvm-svn: 876
2001-10-18 05:20:53 +00:00
Chris Lattner 487374cffb Fix minor bug, update comments
llvm-svn: 875
2001-10-18 01:49:48 +00:00
Chris Lattner f71b827441 Pass's return true if they make a modification, not if they fail
llvm-svn: 872
2001-10-18 01:32:17 +00:00
Chris Lattner 8874d31d91 Convert optimizations to use the Pass infrastructure
llvm-svn: 871
2001-10-18 01:31:58 +00:00
Vikram S. Adve 505130cb30 Added virtual function to generate an instruction sequence to
load a constant into a register.

llvm-svn: 862
2001-10-18 00:02:06 +00:00
Vikram S. Adve af854b59c2 1. Add a bottom-up pass on BURG trees that is used to fix constant operands.
Needs to be bottom up because constant values may be forward-substituted
   to their uses (i.e., into the parent in the BURG tree).
2. Move most of the constant-fixup code into machine-indepedent file
   InstrSelectionSupport.cpp.

llvm-svn: 860
2001-10-17 23:59:09 +00:00
Vikram S. Adve 21db313d7d Remove extra assert in dyn_cast_or_null.
llvm-svn: 856
2001-10-17 22:39:50 +00:00
Ruchira Sasanka f42b65d898 added initializing regNum to -1 in both constructors of MachineOperand
llvm-svn: 851
2001-10-16 16:36:34 +00:00
Ruchira Sasanka 5b8971f418 Added support for caller saving
llvm-svn: 847
2001-10-16 01:23:19 +00:00
Chris Lattner 24872c8838 Print Debug Code to stderr instead of stdout so that it doesn't mess up the assembly output
llvm-svn: 841
2001-10-15 18:30:06 +00:00
Chris Lattner 8761d50df7 ConcretePass should not be a templated class!
llvm-svn: 838
2001-10-15 17:47:13 +00:00
Chris Lattner 1bb5f8e4ee Add new Pass infrastructure and some examples
llvm-svn: 836
2001-10-15 17:31:51 +00:00
Chris Lattner 6991ab1e5e Convert to use Pass infrastructure
llvm-svn: 834
2001-10-15 17:30:18 +00:00
Chris Lattner 578e83df34 File moved to: llvm/Transforms/HoistPHIConstants.h
llvm-svn: 833
2001-10-15 17:30:06 +00:00