Commit Graph

1804 Commits

Author SHA1 Message Date
Chris Lattner
56d27019e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:38 +00:00
Chris Lattner
f78a824b3c Convert over to new style makefile where libraries by default build .o files
unless they specify BUILD_ARCHIVE to also build a .a file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3001 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:24 +00:00
Chris Lattner
aa852bbb50 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2999 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:15:12 +00:00
Mehwish Nagda
6cf7849c1a moving to the Reoptimizer/Mapping dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2993 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 22:10:55 +00:00
Mehwish Nagda
5fb72ae7c3 moved from CodeGen to this dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2992 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 22:09:35 +00:00
Chris Lattner
eef796c767 Always create a shadow node for a store instruction, even if it's storing
a scalar value.  Likewise for load instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2990 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 16:35:53 +00:00
Chris Lattner
54ec7aed89 Minor bugfix, prevents error in LLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2989 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:21:57 +00:00
Chris Lattner
4689728cdf Hide extra argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2986 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:17:27 +00:00
Chris Lattner
5ff62e90d0 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:10:13 +00:00
Chris Lattner
21735d739b Convert Command Line option handling code to use the CommandLine 2.0 interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2983 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:08:59 +00:00
Chris Lattner
331de23705 Checkin CommandLine 2.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2982 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:07:59 +00:00
Chris Lattner
173e4244db Print the contents, not the pointer...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2981 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:06:50 +00:00
Anand Shukla
5585f53d7c comeented out debug printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2980 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-21 09:41:18 +00:00
Anand Shukla
3ee2ea8625 Adding code for outputing length in .s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2979 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-21 09:35:01 +00:00
Mehwish Nagda
cafc0d20bb changed size computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2974 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-19 22:54:08 +00:00
Chris Lattner
9eee58d0ba Ignore some common varargs functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2973 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-19 18:11:43 +00:00
Anand Shukla
e617f92741 minor corrections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2971 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 20:56:47 +00:00
Chris Lattner
e221976b37 * Inline CopyFunctionCallsList
* Don't clone OrigCallList
* Rename removeDeadNodes -> removeTriviallyDeadNodes
* Implement new removeDeadNodes method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2970 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 18:22:40 +00:00
Chris Lattner
2a2c490154 Rename removeDeadNodes to removeTriviallyDeadNodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2969 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 18:19:09 +00:00
Vikram S. Adve
c44e9bfa5c Add support for a top-down propagation pass:
-- Save a copy of the original call nodes in DSGraph before inlining bottom-up.
-- Also, save a list of the callers of each function in DSGraph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2966 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 16:13:52 +00:00
Vikram S. Adve
6aa0d62cb9 Add support for a top-down propagation pass.
Each DSGraph now keeps a list of pending callers that have not
been inlined into the function represented by that graph.
It also keeps a copy of the original call nodes before the BU pass
eliminates some of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2965 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 16:12:08 +00:00
Chris Lattner
055dc2c67e Implement cast nodes correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2964 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 15:54:42 +00:00
Chris Lattner
5796091dfd Seperate stats for DCE'd functions and vars
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2961 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 06:40:04 +00:00
Chris Lattner
f8dff732ae * Code cleanups
* Fix a REALLY misleading error message


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2960 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 05:18:37 +00:00
Chris Lattner
f0cd4722bf *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2959 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 04:43:20 +00:00
Chris Lattner
d99d4d7b70 * s/method/function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2958 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 04:43:16 +00:00
Chris Lattner
7f20ea7d7b Only functions with external linkage can be resolved to function declarations.
This change fixes programs that have multiple functions named the same thing,
where are least one of them is static/internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2954 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 03:01:24 +00:00
Chris Lattner
e306d94782 * Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2953 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 02:31:03 +00:00
Chris Lattner
d124c38993 The graph is more accurate when I don't completely ignore the return value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2952 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 01:58:24 +00:00
Chris Lattner
0b5909e6ae * Correctly get prototype for void*malloc(size_t)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2951 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:18:01 +00:00
Chris Lattner
6183b92b2c * ConstExpr::getelementptr now takes a vector of Constants not Values
* Assert things instead of printing an error and returning null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2949 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:14:50 +00:00
Chris Lattner
cc4b6ec2b9 ConstExpr::getelementptr now takes a vector of Constants not Values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2948 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:14:27 +00:00
Chris Lattner
3535c9b387 Add a hack to check for a subset of true dominance properties
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2947 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:13:42 +00:00
Chris Lattner
6cdf1971bd Implement linking of ConstExprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2946 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:13:08 +00:00
Chris Lattner
0d9bab8bac Lots of bug fixes, add BottomUpClosure, which has bugs, but is a start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2945 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:12:30 +00:00
Mehwish Nagda
e01166591f added check for Function with 0 BB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2942 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-17 23:40:33 +00:00
Chris Lattner
260fc14568 Anand forgot to check in the makefile corresponding to his previous change
which eliminated the EmitFunctions directory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2937 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-17 17:13:01 +00:00
Chris Lattner
b1b4262387 * Remove dead code from ExprTypeConvert.cpp
- I->use_empty() can never be true because of the IHolder's
* Fix bug: test/Regression/Transforms/LevelRaise/2002-07-16-SourceAndDestCrash.ll
   - Add a new NewCasts member to VMC to keep track of casts that have been
     created and to ensure there is always a reference to the cast.
   - Extend ValueHandle a bit so it can be used in an STL container
   - Make sure we destroy the ValueMapCache before verifying the function
     in LevelRaise.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2936 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-17 17:11:33 +00:00
Chris Lattner
3378a5b591 * Add a bunch of debugging features to LevelRaise
- Verify the function every time it is exprconverted if DEBUG is on
  - Provide a way to start exprconversion AT a specific instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2934 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 23:49:24 +00:00
Chris Lattner
23014c9b00 Avoid !sized assertion failure if Ty is not a sized type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2933 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 22:29:37 +00:00
Chris Lattner
3fb2ddd368 Fix bug: test/Regression/Transforms/LevelRaise/2002-07-16-RaiseCrash2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2932 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 21:41:31 +00:00
Anand Shukla
e0b514259c Moved over EmitFunctions to this library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2928 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 18:58:08 +00:00
Anand Shukla
f080ec7dcd removed this directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2927 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 18:56:29 +00:00
Anand Shukla
11870879ec Moved EmitFunctions.cpp up to instrumentation directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2926 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 18:55:55 +00:00
Chris Lattner
8b1b4e20a9 * Make global variables with external linkage get emitted correctly
* Do NOT add a prefix to global variables that are external
* Add newline after emitting a constpointerref


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2925 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 18:35:16 +00:00
Chris Lattner
a66c7bfa51 Bugfix to previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2924 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 18:12:55 +00:00
Mehwish Nagda
3115540870 Now will profile all Basic Blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2922 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 17:48:27 +00:00
Chris Lattner
9713c4ef46 * Cleanup pass
* The global variable cannot be internal or else we cannot use it!
* Always add a function to the table, even if it only has a single basic
  block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2921 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 17:42:54 +00:00
Chris Lattner
131454e91d * Add assertion to ExprTypeConvert to detect error earlier than without it
* Fix bug in LevelRaise.cpp, correcting this problem:
    test/Regression/Transforms/LevelRaise/2002-07-16-RaiseCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2920 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 17:33:13 +00:00
Anand Shukla
3edfb64902 added std:: to pair
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2917 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:04:57 +00:00
Anand Shukla
18be6fb716 added std:: to vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2916 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:04:15 +00:00
Anand Shukla
6c5ed410b2 added std:: to string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2915 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:03:10 +00:00
Anand Shukla
4d2da0d7a7 added std:: to cerr and endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2914 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:02:17 +00:00
Mehwish Nagda
634cd1c4b4 Added the Mapping Pass to out put Mapping Info to .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2913 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 23:58:21 +00:00
Mehwish Nagda
b43086b4b7 Initial checking : Writes LLVM - MI mappiing to the .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2911 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 23:08:49 +00:00
Vikram S. Adve
d0b1bb01f2 Ensure ConstExpr constants are unique using a
map of <opcode, operands> to ConstExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2909 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 18:19:33 +00:00
Chris Lattner
5659dd1af8 Fix bug: test/Regression/Assembler/2002-07-14-InternalLossage.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2907 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 00:10:33 +00:00
Vikram S. Adve
b4dbb4445c Added support to write out ConstantExpr nodes.
Also, avoid asserting out when writing out an invalid tree
since the assembly writer is used when debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2902 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:14:45 +00:00
Vikram S. Adve
345e0cfb86 Added subclass ConstantExpr to represent expressions consructed from
constants using operators such as cast, getelementptr, add, shl, etc.
Note that a ConstantExpr can be of any type, so classof() in most
other subclasses (that discriminate by type) have to check that it
is also not a ConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2901 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:13:17 +00:00
Vikram S. Adve
c105645c16 Create a static version of Instruction::getOpcodeName(opCode) that
can be invoked with only an opcode (i.e., without an instruction).
Move all opCode->opCodeName translations there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2900 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:09:40 +00:00
Vikram S. Adve
a24a0bb0e2 Add support for writing ConstantExpr nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2899 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:08:30 +00:00
Vikram S. Adve
a7dac3db79 Write out the plane for types first, since values of primitive types
may be constructed by expressions of other types (and so the
contents of the primitive type planes must come after all types).
Use a helper function outputConstantsInPlane in outputConstants to
do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2898 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:07:51 +00:00
Vikram S. Adve
054bd689db Use a helper function outputConstantsInPlane in outputConstants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2897 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:05:53 +00:00
Vikram S. Adve
c668b7c3ae Add support for reading ConstantExpr nodes.
Add class ConstantFwdRefs to resolve forward references to constants
and to globals. (Hmm... this class could be renamed I guess.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2896 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:05:09 +00:00
Vikram S. Adve
c1e4a813a2 Add support for reading ConstantExpr nodes.
Add class ConstantFwdRefs to resolve forward references to constants
and to globals (unified old code for globals into this).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2895 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:04:18 +00:00
Vikram S. Adve
d3f7eb0aa4 Added support for parsing expressions constructed from constant values.
(Major new non-terminal is ConstExpr.)

Add YYERROR_VERBOSE and print additional information on errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2894 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 22:59:28 +00:00
Vikram S. Adve
f946bcdc23 Declare globals llvmAsmtext and llvmAsmleng for use in the parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2893 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 22:49:40 +00:00
Anand Shukla
135b75db49 Added EmitFunctions directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2883 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-12 20:12:07 +00:00
Anand Shukla
41059bc530 Initial makefile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2882 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-12 20:11:24 +00:00
Anand Shukla
09ba7b34c4 Initial version: adds a function table to output code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2881 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-12 20:10:50 +00:00
Chris Lattner
76d5b489e3 * Pass the DSGraph around instead of the Function to printing fns
* Print the globals list in the node
* Print the scalars in the scalar node
* Eliminate Scalar "label" edges in the graph
* Print fake edges lighter instead of dotted


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2880 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 20:33:32 +00:00
Chris Lattner
f9ae4c5cb6 * Nodes now keep track of any global variables in them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2879 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 20:32:22 +00:00
Chris Lattner
c314ac49d7 * Nodes now keep track of any global variables in them
* Only dead-node-eliminate nodes with no flags
* Don't merge scalars, only merge what they point to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2878 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 20:32:02 +00:00
Anand Shukla
e683f773a4 added std:: to endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2875 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 00:17:17 +00:00
Anand Shukla
24787fa2ed added std:: to vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2874 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 00:16:28 +00:00
Chris Lattner
c68c31b2d3 New implementation of data structure analysis. Only local analysis has been
implemented so far.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2871 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 22:38:08 +00:00
Chris Lattner
43199a036d Disable folding g-e-p instructions into loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 22:37:17 +00:00
Chris Lattner
11910cf7e3 Disable pool allocation stuff until data structure analysis is sorted back out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2869 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 22:36:47 +00:00
Chris Lattner
2b0f739d57 Reimplement data structure analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2868 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 22:36:26 +00:00
Vikram S. Adve
975f6d4f44 Bug fix: cast (bool) has higher precedence than %... who knew!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2864 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:51:46 +00:00
Vikram S. Adve
cd13e7a5ee Fix print of BB name in dump().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2861 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:45:30 +00:00
Vikram S. Adve
3bc9ef9317 Add support for marking each operand as a %hh, %hm, %lm or %lo.
Represent previous bools and these ones with flags in a single byte
per operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2860 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:45:04 +00:00
Vikram S. Adve
6a49a1e321 Changed interface to insertCallerSavingCode().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:42:42 +00:00
Vikram S. Adve
06019fc8ad Stop using pseudo-instructions (SETX, SETUW, SETSW)
and generate actual machine instruction sequences directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:42:13 +00:00
Vikram S. Adve
195a5d5093 Add support to print %hh, %hm, %lm, or %lo in an operand field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:41:21 +00:00
Vikram S. Adve
53fd400cdf Major overhaul to stop using pseudo-instructions (SETX, SETUW, SETSW)
and generate actual machine instruction sequences directly.

Also a couple of bug fixes in code for putting constants into registers:
-- Do *not* sign-extend unsigned constant that is shorter than int reg size
-- Fix handling of address constant (a GlobalValue) vs. constant that
   must be loaded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:39:50 +00:00
Vikram S. Adve
dcde95fbbc More important fixes:
-- FP argument to a function with no prototype going on stack
   was not being copied to the stack in colorCallArgs().
-- Put caller-saving code *before* argument copying code so that
   we don't trash a register before saving it!
-- Two other minor fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2855 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:36:00 +00:00
Chris Lattner
607dc6880e *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2852 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 16:48:17 +00:00
Anand Shukla
d58290ed3b changed mem_fun to std::mem_fun
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2847 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 19:18:56 +00:00
Anand Shukla
b0ad8b002d Added std:: to mem_fun for 64-bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2845 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 19:16:59 +00:00
Chris Lattner
743cd3e2b8 Implementing shift left & shift right on pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2844 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 18:42:36 +00:00
Vikram S. Adve
ec0de5cb4b Added support for printing constant global references to
assembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2842 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 12:30:29 +00:00
Vikram S. Adve
f86b4c1982 Fix iteration and InsertPos bugs introduced when Chris changed over to ilist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:37:07 +00:00
Vikram S. Adve
fe09fb22aa Numerous changes in interface to class SparcRegInfo corresponding to
changes in class MachineRegInfo (see MachineRegInfo.h for details).

Added {LD,ST}[X]FSR instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:34:10 +00:00
Vikram S. Adve
0b04064054 class MachineCodeForBasicBlock is now an annotation on BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2838 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:31:24 +00:00
Vikram S. Adve
b2debdc5a9 BA no longer has the unused CC operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2837 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:30:59 +00:00
Vikram S. Adve
6418eac2f1 Have to save a boolean (setCC) value whenever use is outside the current
basic block.

Mark setCCInstr used as dest. of conditional-move as both a def and a use.

BA instruction no longer has the unused CC argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2836 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:30:14 +00:00
Vikram S. Adve
97da3649dd BA has only one argument.
Added LDFSR, LDXFSR, STFSR and STXFSR.
Fixed operands info for RDCCR, WRCCR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2835 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:25:17 +00:00
Vikram S. Adve
76ee6f70ea Significant changes to correctly spill CC registers and to correctly
handle conditional move instructions:
-- cpMem<->Reg functions now support CC registers (int and FP) correctly.
   Also, cpMem<->Reg functions now return a vector of machine instructions.
-- Scratch registers must be explicitly provided to cpMem<->Reg when
   needed, since CC regs need one to be copied to/from memory.
-- CC regs are saved to a scratch register instead of stack.
-- All regs used by a instruction are now recorded in MachineInstr::regsUsed,
   since regs used to save values *across* an instruction are not obvious
   either from the operands or from the LiveVar sets.
-- An (explicit or implicit) operand may now be both a def and a use.
   This is needed for conditional move operations.
   So an operand may need spill code both before and after the instruction.

Other changes:
-- Added several get{Class,Type} functions.
-- Added unified-to-local register number conversion.
-- class MachineCodeForBasicBlock is now an annotation on BasicBlock.
-- Suggest/Color methods may modify the MachineInstr (and always did),
   so don't make that argument const!
-- Caller-saving code doesn't need its special purpose code for
   handling CC registers since cpMem<->Reg handle those correctly now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2834 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:23:12 +00:00
Vikram S. Adve
f5af636dbe Significant changes to correctly spill CC registers and to correctly
handle conditional move instructions:
-- cpMem<->Reg functions now support CC registers (int and FP) correctly.
-- Scratch registers must be explicitly provided to cpMem<->Reg when
   needed, since CC regs need one to be copied to/from memory.
-- CC regs are saved to a scratch register instead of stack.
-- All regs used by a instruction are now recorded in MachineInstr::regsUsed,
   since regs used to save values *across* an instruction are not obvious
   either from the operands or from the LiveVar sets.
-- An (explicit or implicit) operand may now be both a def and a use.
   This is needed for conditional move operations.
   So an operand may need spill code both before and after the instruction.
-- class MachineCodeForBasicBlock is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2833 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:15:32 +00:00
Vikram S. Adve
c9a0ca5171 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.
Also, class MachineCodeForBasicBlock is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2832 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:07:26 +00:00
Vikram S. Adve
45c3877b5c Rename static struct Initializer to avoid name conflict with BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2831 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:04:31 +00:00
Vikram S. Adve
432e1ca621 Fix printing of BB in dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2830 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:03:54 +00:00
Vikram S. Adve
1dcfd3c1a6 Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.h.
This class is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2829 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:03:10 +00:00
Vikram S. Adve
bf82a42d1c MachineInstr::dump() now takes no arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2828 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:01:46 +00:00
Vikram S. Adve
11991ac70f Implementation of class MachineCodeForBasicBlock.
Moved here from MachineInstr.cpp to make it an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2827 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:01:11 +00:00
Vikram S. Adve
0baf1c0911 A single MachineInstr operand may now be both a def and a use,
so additional dep. edges have to be added.
This was needed to correctly handle conditional move instructions!
MachineCodeForBasicBlock is now an annotation on BasicBlock.
Renamed "earliestForNode" to "earliestReadyTimeForNode".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2826 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:59:23 +00:00
Vikram S. Adve
9afa88c3a7 A single MachineInstr operand may now be both a def and a use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2825 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:56:34 +00:00
Vikram S. Adve
c2580ddb08 getUsableUniRegAtMI interface simplified slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2822 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:39:36 +00:00
Vikram S. Adve
7a4be9580e Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.{cpp,h}.
An (explicit or implicit) operand may now be both a def and a use.
Also add a set of regs used by each instruction.
dump() no longer takes an optional argument, which doesn't work in gdb.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2821 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:38:45 +00:00
Vikram S. Adve
1871b2f1c2 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2820 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:34:40 +00:00
Vikram S. Adve
08272fbdb2 Moved MachineCodeForBB to be an annotation on BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2818 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:31:11 +00:00
Anand Shukla
ec07c755fc changes BBsorting and oredering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2817 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 19:37:06 +00:00
Anand Shukla
82f40e8210 small corrections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2816 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 19:36:39 +00:00
Anand Shukla
d4d79067c0 changed function numbering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2815 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 19:36:01 +00:00
Chris Lattner
3e009942ed *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2813 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:25:25 +00:00
Chris Lattner
f739969911 Clean up anands patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2812 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:25:21 +00:00
Chris Lattner
f59391ab9e Remove diff-cluttering tags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2808 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:12:03 +00:00
Chris Lattner
000f60d1b1 Remove tag that just clutters diffs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2807 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:08:25 +00:00
Chris Lattner
e7f65d3b71 Fix anands changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2806 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:07:20 +00:00
Chris Lattner
194f0a56ac Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2805 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:04:37 +00:00
Chris Lattner
9fdaeb44b3 Fix anand's last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2804 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:01:15 +00:00
Anand Shukla
d05e22cb6f changes for 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2801 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 22:07:38 +00:00
Anand Shukla
60a786e9e9 added include<iostream> for cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2800 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 22:04:00 +00:00
Anand Shukla
e6f74a9ce8 added include<iostream> for cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2796 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 21:29:10 +00:00
Anand Shukla
3b5eabb24b changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2795 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 21:18:19 +00:00
Anand Shukla
5cafcfbab4 additions and bug fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2794 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 21:14:58 +00:00
Anand Shukla
881ed6bad4 added include<iostream> for cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2793 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 21:12:25 +00:00
Anand Shukla
5ba99bd124 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2792 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 21:07:58 +00:00
Anand Shukla
cfb22d3c14 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2791 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:55:50 +00:00
Anand Shukla
eea60fc59c changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2790 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:44:04 +00:00
Anand Shukla
a928403ca4 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2789 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:35:19 +00:00
Anand Shukla
add9643e92 minor change in removing endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2788 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:34:54 +00:00
Anand Shukla
4a9f933751 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2786 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:22:25 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
0b12b5f50e MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:21 +00:00
Chris Lattner
18961504fc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:12:52 +00:00
Chris Lattner
bb03efd7e5 * Update with MegaPatch
* Fix various bugs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2774 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 15:57:03 +00:00
Chris Lattner
24e845fa95 * Update to work with Megapatch
* Add two new checks:
  * PHI nodes must be the first thing in a basic block, all grouped together
  * All basic blocks should only end with terminator insts, not contain them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2773 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 15:56:27 +00:00
Chris Lattner
9234d03373 Remove DynamicConstantMerge pass, because it did not fit in with the Pass
system correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2772 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 15:55:29 +00:00
Chris Lattner
ce0141ec22 Remove "fixers" for problems in GCC generated code that cannot be generated
anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2771 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 15:55:03 +00:00
Anand Shukla
c43fa80e1f Relocating Graph.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2770 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 14:28:55 +00:00
Chris Lattner
db241dcf51 Fix constness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2762 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 18:11:37 +00:00
Chris Lattner
122787bcff Fix Constness problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2761 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 18:08:26 +00:00
Chris Lattner
9fcccb0f36 Fix constness problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2759 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 17:49:40 +00:00
Chris Lattner
a48836b195 Fix constness problems now that the cast operators preserve the constness
of their argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2758 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 17:38:28 +00:00
Chris Lattner
51727bee39 * Be more typesafe: cast<x> now no longer discards constness
* The newly installed version of Bison now really likes there to be ;'s
  after productions.  Add them to avoid tons of warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2757 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-04 21:58:56 +00:00
Chris Lattner
44014418f5 Disable debugging output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2756 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-04 03:09:57 +00:00
Chris Lattner
0f99555ce4 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2755 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-03 22:10:52 +00:00
Chris Lattner
84369b323e Avoid deleting individual instructions until AFTER dead blocks have dropped
their references.  This fixes bug:
    test/Regression/Transforms/ADCE/2002-05-28-Crash*.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2753 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-28 21:38:16 +00:00
Chris Lattner
16da494c81 Simplify the interface to local DCE and Constant prop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2749 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-26 20:18:18 +00:00
Chris Lattner
9e77f77687 Support opaque type printing a little bit at least
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2748 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-26 20:17:54 +00:00
Chris Lattner
bd8619d3ef Do not remove type names that contain a .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2747 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-26 20:17:35 +00:00
Chris Lattner
abe6c3d702 Fix "unimplemented features":
test/Regression/Transforms/FunctionResolve/retmismatch[12].ll

This makes it much more useful for running benchmarks that are missing
prototypes for some functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2745 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-24 21:33:26 +00:00
Chris Lattner
22ee3eb802 Split the FunctionResolution pass out of CleanGCCOutput.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2742 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-24 20:42:13 +00:00
Chris Lattner
d20a98e285 Fix comments to reflect reality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2741 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-24 20:41:51 +00:00
Chris Lattner
47e0f3a8a0 Support programs that do not #include <malloc.h> or give a full prototype
for malloc and free.  Lots of crufty benchmarks are using stuff like:
char *malloc();
void free();

to forward declare malloc and free.  Now we recognize and raise these forms


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2740 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-24 20:29:18 +00:00
Chris Lattner
c2b42b38f9 Fold add X, 0 for floating point types as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2734 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 17:11:38 +00:00
Chris Lattner
89d46b0f09 Fix bug: test/Regression/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
Which contains a description of why this is neccesary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2733 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 16:52:34 +00:00
Chris Lattner
85c5465e07 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2731 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 15:50:03 +00:00
Chris Lattner
0c51266082 Avoid creating the symbol table if we don't need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2728 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:53:05 +00:00
Chris Lattner
8ebccb7f0e Support function declarations with either %XXX or "XXX" style for now
"XXX" style should be considered deprecated, and will hopefully be removed
in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2727 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:33:00 +00:00
Chris Lattner
68e0278815 Print out function name with % style instead of "" style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2726 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:29:26 +00:00
Chris Lattner
f09c74c385 Convert code to use the DEBUG macro so that debug code can simply be
enabled with the -debug command line option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2721 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 21:56:32 +00:00
Chris Lattner
d9036a1aad Fix and implement ADCE to finally work!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2720 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 21:32:16 +00:00
Chris Lattner
b3abf9d0d8 Convert transforms over to standardize debugging output on -debug option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2714 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:27:12 +00:00
Chris Lattner
f016ea4ff8 Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2713 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:17:27 +00:00
Chris Lattner
70e60cbd4d Move debug options out of header files so that the header does not have
to #include CommandLine.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2712 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:08:27 +00:00
Chris Lattner
59dcbf9c03 Move the DEBUG_LV option out of the public header file into a private header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:07:26 +00:00
Chris Lattner
e87adaac31 Avoid #including CommandLine.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:06:56 +00:00
Chris Lattner
4435ac0097 Implement a new command line option, -debug, which is meant to unify all of
the random debugging macros scattered throughout llvm.

The new DEBUG(x) macro should be used instead of special purpose debug macros.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2709 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:06:20 +00:00
Chris Lattner
71fb71628a Add ability to update existing variables with values read from the command line
to certain classes.  This is nice because it means that in header files we can
just declare a value, and still have that value be set based on a command-line
argument.  The difference is now that the #include of CommandLine.h does not
need to go into the header file as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2708 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:03:05 +00:00
Chris Lattner
7f9412b50d Fix bug: test/Regression/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
Improperly handling edges... by not marking them alive properly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2707 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 16:07:20 +00:00
Chris Lattner
594b9fadb8 * Fix typeo
* Provide a #include of <malloc.h> so that the sun C compiler does not
  miscompile malloc function calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2702 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 21:10:04 +00:00
Chris Lattner
01d1ee3a4c Add implementation of SimplifyCFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2701 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 20:50:24 +00:00
Chris Lattner
573527bd5d New CFG Simplification pass: removed from the old DCE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2700 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 20:49:37 +00:00
Chris Lattner
76ae3445f8 Simplify interface to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2697 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 20:04:50 +00:00
Chris Lattner
87a09b10f8 Fix bug: test/Regression/Transforms/CFGSimplify/2002-05-21-PHIElimination.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 19:52:49 +00:00
Chris Lattner
963b70bbf8 Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2690 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 18:05:19 +00:00
Mehwish Nagda
8532fb0d13 Fixed the makefile to not die when compiling a new, empty, source directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 15:58:24 +00:00
Chris Lattner
2e0769ea16 * Change commandline options a bit to be nicer
* Insert accurate prototypes for functions
* Insert casts to use accurate prototypes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2677 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:43:59 +00:00
Chris Lattner
ad86b74baf Hide debugging options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2676 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:39:10 +00:00
Chris Lattner
1ee34a5a5b Remove explicit support for tracing code. It should be linked into the
executable just like everything else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2674 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:17:16 +00:00
Chris Lattner
0fe380c683 Remove tracing code hack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2673 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:16:46 +00:00
Chris Lattner
618b4a11bb Fix bug: test/Regression/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
That was causing a miscompilation of strtol/atoi plus others


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2669 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 20:48:03 +00:00
Chris Lattner
5245f853c5 Don't lose namespace qualifications on previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2664 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 17:38:26 +00:00
Chris Lattner
36346c7a1e Rename IsPowerOf2 to isPowerOf2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 21:20:19 +00:00
Vikram S. Adve
53835b8081 Link with test/Libraries/libinstr32.a for runtime routines
supporting tracing.  That should be moved to a "runtime" directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 16:00:28 +00:00
Vikram S. Adve
eb1a8453f9 Added external functions for hashing pointers to sequence numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2659 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:59:25 +00:00
Vikram S. Adve
0243ff9e62 InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:41:33 +00:00
Vikram S. Adve
1e2ddcf741 Hash pointer values to a sequence number to get identical results from
lli and llc.  This is controlled with options -tracehash on|off.

Also, added an option to specify which functions should be traced.
Particularly useful to reduce output volume in basic-block tracing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2646 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:39:02 +00:00
Vikram S. Adve
36f0a9e5a6 Better folding getelementptr operations with mixed
array and struct indexes.
Update operand values in CallArgsDescriptor (a new class)
when replacing constant values with immediates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:34:29 +00:00
Vikram S. Adve
629b70f274 cpValue2Value now needs a vector of MachineInstr to store return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2644 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:31:08 +00:00
Vikram S. Adve
7e684a956a Annotation class for MachineInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:30:21 +00:00
Vikram S. Adve
dabb41d93d Numerous bug fixes:
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2642 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:29:31 +00:00
Vikram S. Adve
f66723fc4b Add integer register size field.
Make all sizes and offsets uint64_t instead of uint.
Fixed GetIndexedOffset to handle mixed array and struct indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2641 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:28:02 +00:00
Vikram S. Adve
242a8086aa Numerous bug fixes:
-- correct sign extensions for integer casts and for shift-by-constant
   instructions generated for integer multiply
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect stack frame size when padding a section
-- folding getelementptr operations with mixed array and struct indexes
-- use uint64_t instead of uint for constant offsets in mem operands
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2640 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:25:51 +00:00
Chris Lattner
78771c886a Fix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by tracking
which global variables would have name collisions if they were not mangled,
and use this info to mangle them iff they would collide.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2639 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-17 04:55:35 +00:00
Chris Lattner
a36e6c8cd5 * Make debug output conditional on #define
* Add optimization to rank computation to not recursively search when
  unneccesary.
* More agressively negate expressions to open reassociation opportunities.
* Linearize (A+B)+(C+D) into ((A+B)+C)+D


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2637 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-16 04:37:07 +00:00
Chris Lattner
0f9fd5b0f8 * Fix bug: test/Regression/Transforms/GCSE/2002-05-14-OperandSwap.ll
By making sure to consider binary expressions identical if their operands
are backwards, but swappable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2629 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 19:57:25 +00:00