Commit Graph

3057 Commits

Author SHA1 Message Date
Chris Lattner 6801fdf009 Seperate stats for DCE'd functions and vars
llvm-svn: 2961
2002-07-18 06:40:04 +00:00
Chris Lattner 8eedb941d3 * Code cleanups
* Fix a REALLY misleading error message

llvm-svn: 2960
2002-07-18 05:18:37 +00:00
Chris Lattner 6f21961d67 *** empty log message ***
llvm-svn: 2959
2002-07-18 04:43:20 +00:00
Chris Lattner 79b0c7d016 * s/method/function
llvm-svn: 2958
2002-07-18 04:43:16 +00:00
Chris Lattner f31527cd6f * s/method/function
* BIG CHANGE: The root of the call "graph" is considered to be the external
  node, not the "Root".  This means that users using graph iterators like
  df_begin() will start from the external node.

llvm-svn: 2957
2002-07-18 04:42:35 +00:00
Chris Lattner a6c6d78805 New testcase
llvm-svn: 2956
2002-07-18 04:25:11 +00:00
Chris Lattner 6c0ebfd065 New testcases for bug in globaldce
llvm-svn: 2955
2002-07-18 04:01:02 +00:00
Chris Lattner 72f9a86d1e 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.

llvm-svn: 2954
2002-07-18 03:01:24 +00:00
Chris Lattner f0cfe654d7 * Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec

llvm-svn: 2953
2002-07-18 02:31:03 +00:00
Chris Lattner 140153f357 The graph is more accurate when I don't completely ignore the return value.
llvm-svn: 2952
2002-07-18 01:58:24 +00:00
Chris Lattner dfe041880d * Correctly get prototype for void*malloc(size_t)
llvm-svn: 2951
2002-07-18 00:18:01 +00:00
Chris Lattner 4f6a098c84 Fixes to be LP64 correct
llvm-svn: 2950
2002-07-18 00:15:29 +00:00
Chris Lattner d9f4ac6680 * ConstExpr::getelementptr now takes a vector of Constants not Values
* Assert things instead of printing an error and returning null.

llvm-svn: 2949
2002-07-18 00:14:50 +00:00
Chris Lattner 980ddf5854 ConstExpr::getelementptr now takes a vector of Constants not Values
llvm-svn: 2948
2002-07-18 00:14:27 +00:00
Chris Lattner 7af3ee9840 Add a hack to check for a subset of true dominance properties
llvm-svn: 2947
2002-07-18 00:13:42 +00:00
Chris Lattner 0b0758f916 Implement linking of ConstExprs
llvm-svn: 2946
2002-07-18 00:13:08 +00:00
Chris Lattner 4c0d620a82 Lots of bug fixes, add BottomUpClosure, which has bugs, but is a start.
llvm-svn: 2945
2002-07-18 00:12:30 +00:00
Chris Lattner c63bbd9332 First cut at implementing bottom up analysis
llvm-svn: 2944
2002-07-18 00:11:28 +00:00
Chris Lattner 24684379fb Make getelementptr ConstExpr take a vector of constants not values
llvm-svn: 2943
2002-07-18 00:11:08 +00:00
Mehwish Nagda 98b9e48981 added check for Function with 0 BB
llvm-svn: 2942
2002-07-17 23:40:33 +00:00
Guochun Shi b65a78eaae *** empty log message ***
llvm-svn: 2941
2002-07-17 23:05:56 +00:00
Chris Lattner 99ac90bbc6 New testcase
llvm-svn: 2940
2002-07-17 22:19:30 +00:00
Chris Lattner 586afe7398 Fix prototype to make function.
llvm-svn: 2939
2002-07-17 21:34:20 +00:00
Chris Lattner 745f640c06 New testcase, unanalyzed.
llvm-svn: 2938
2002-07-17 20:04:07 +00:00
Chris Lattner 963b68afb8 Anand forgot to check in the makefile corresponding to his previous change
which eliminated the EmitFunctions directory

llvm-svn: 2937
2002-07-17 17:13:01 +00:00
Chris Lattner 60ebba51c4 * 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

llvm-svn: 2936
2002-07-17 17:11:33 +00:00
Chris Lattner 2b3cc2e69c New testcase finally identified!!
llvm-svn: 2935
2002-07-17 02:36:02 +00:00
Chris Lattner 5ec260a714 * 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.

llvm-svn: 2934
2002-07-16 23:49:24 +00:00
Chris Lattner 4cccad7555 Avoid !sized assertion failure if Ty is not a sized type
llvm-svn: 2933
2002-07-16 22:29:37 +00:00
Chris Lattner 811bd41229 Fix bug: test/Regression/Transforms/LevelRaise/2002-07-16-RaiseCrash2.ll
llvm-svn: 2932
2002-07-16 21:41:31 +00:00
Chris Lattner b744c9ba24 New testcase
llvm-svn: 2931
2002-07-16 21:33:27 +00:00
Chris Lattner e47dea14e1 Add testcase for raise opportunity missed.
llvm-svn: 2930
2002-07-16 19:10:00 +00:00
Anand Shukla 4e25609b87 Removed emitfuncs: now its part of instrument library
llvm-svn: 2929
2002-07-16 18:59:55 +00:00
Anand Shukla d5f25dc1eb Moved over EmitFunctions to this library
llvm-svn: 2928
2002-07-16 18:58:08 +00:00
Anand Shukla 09038eec7b removed this directory
llvm-svn: 2927
2002-07-16 18:56:29 +00:00
Anand Shukla 506f8516c6 Moved EmitFunctions.cpp up to instrumentation directory
llvm-svn: 2926
2002-07-16 18:55:55 +00:00
Chris Lattner 3e751859ec * 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

llvm-svn: 2925
2002-07-16 18:35:16 +00:00
Chris Lattner 0610fc933c Bugfix to previous checkin
llvm-svn: 2924
2002-07-16 18:12:55 +00:00
Chris Lattner cd399a7f1d Bug fix to RUN line
llvm-svn: 2923
2002-07-16 18:02:43 +00:00
Mehwish Nagda 81264e6bed Now will profile all Basic Blocks
llvm-svn: 2922
2002-07-16 17:48:27 +00:00
Chris Lattner 6001a92926 * 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.

llvm-svn: 2921
2002-07-16 17:42:54 +00:00
Chris Lattner 036a134528 * 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

llvm-svn: 2920
2002-07-16 17:33:13 +00:00
Chris Lattner 4b933a253f New testcase distilled from olden-tsp.
llvm-svn: 2919
2002-07-16 17:32:17 +00:00
Chris Lattner 768846af41 New testcase
llvm-svn: 2918
2002-07-16 05:38:33 +00:00
Anand Shukla f7d7871656 added std:: to pair
llvm-svn: 2917
2002-07-16 00:04:57 +00:00
Anand Shukla 09da3b881f added std:: to vector
llvm-svn: 2916
2002-07-16 00:04:15 +00:00
Anand Shukla d862545ad2 added std:: to string
llvm-svn: 2915
2002-07-16 00:03:10 +00:00
Anand Shukla 991873fc5c added std:: to cerr and endl
llvm-svn: 2914
2002-07-16 00:02:17 +00:00
Mehwish Nagda 382f286ae7 Added the Mapping Pass to out put Mapping Info to .s file
llvm-svn: 2913
2002-07-15 23:58:21 +00:00
Mehwish Nagda bbe64808db *** empty log message ***
llvm-svn: 2912
2002-07-15 23:56:27 +00:00
Mehwish Nagda 6c9544a2a0 Initial checking : Writes LLVM - MI mappiing to the .s file
llvm-svn: 2911
2002-07-15 23:08:49 +00:00
Vikram S. Adve 47265143a9 Ensure ConstExpr constants are unique.
llvm-svn: 2910
2002-07-15 18:20:50 +00:00
Vikram S. Adve 4c48533b57 Ensure ConstExpr constants are unique using a
map of <opcode, operands> to ConstExpr.

llvm-svn: 2909
2002-07-15 18:19:33 +00:00
Vikram S. Adve 417ad4f124 Added duplicate constant expressions to test uniqueness support.
llvm-svn: 2908
2002-07-15 18:18:45 +00:00
Chris Lattner 8445b41ddd Fix bug: test/Regression/Assembler/2002-07-14-InternalLossage.llx
llvm-svn: 2907
2002-07-15 00:10:33 +00:00
Chris Lattner a831f61fab Check in tests that have been in my tree for a long time
llvm-svn: 2906
2002-07-14 23:48:42 +00:00
Chris Lattner 9afe4d03b2 Minor rename of output
llvm-svn: 2905
2002-07-14 23:25:23 +00:00
Chris Lattner 8cf7777267 New testcase to track opaque type bug
llvm-svn: 2904
2002-07-14 23:25:14 +00:00
Vikram S. Adve a6b6b0c7f8 Minor additions.
llvm-svn: 2903
2002-07-14 23:18:33 +00:00
Vikram S. Adve b952b5485f 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.

llvm-svn: 2902
2002-07-14 23:14:45 +00:00
Vikram S. Adve 4e537b27d8 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.

llvm-svn: 2901
2002-07-14 23:13:17 +00:00
Vikram S. Adve 8aee7962aa 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.

llvm-svn: 2900
2002-07-14 23:09:40 +00:00
Vikram S. Adve 590bc74ca4 Add support for writing ConstantExpr nodes.
llvm-svn: 2899
2002-07-14 23:08:30 +00:00
Vikram S. Adve c1b6474a60 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.

llvm-svn: 2898
2002-07-14 23:07:51 +00:00
Vikram S. Adve 827d91f257 Use a helper function outputConstantsInPlane in outputConstants.
llvm-svn: 2897
2002-07-14 23:05:53 +00:00
Vikram S. Adve a336afd5d9 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.)

llvm-svn: 2896
2002-07-14 23:05:09 +00:00
Vikram S. Adve 16bcca5ee4 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).

llvm-svn: 2895
2002-07-14 23:04:18 +00:00
Vikram S. Adve 7064eaf80b Added support for parsing expressions constructed from constant values.
(Major new non-terminal is ConstExpr.)

Add YYERROR_VERBOSE and print additional information on errors.

llvm-svn: 2894
2002-07-14 22:59:28 +00:00
Vikram S. Adve 9f835b82fc Declare globals llvmAsmtext and llvmAsmleng for use in the parser.
llvm-svn: 2893
2002-07-14 22:49:40 +00:00
Vikram S. Adve 249f9ad3dc 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.

llvm-svn: 2892
2002-07-14 22:48:20 +00:00
Vikram S. Adve 83500260ae 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.   This is why isConstantExpr() is needed.

llvm-svn: 2891
2002-07-14 22:47:54 +00:00
Vikram S. Adve eacabece8d Add a couple of virtual functions to support subclass ConstantExpr.
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.   This is why isConstantExpr() is needed.

llvm-svn: 2890
2002-07-14 22:46:32 +00:00
Vikram S. Adve a916f2c8a7 Test the handling of constant expressions.
llvm-svn: 2889
2002-07-14 22:39:02 +00:00
Chris Lattner 290ea13b34 Allow tests that use custom commands to run
llvm-svn: 2888
2002-07-14 22:32:59 +00:00
Chris Lattner a1efe55957 Test to make sure that 'internal' flags don't get dropped accidentally!
llvm-svn: 2887
2002-07-14 22:30:45 +00:00
Anand Shukla ede97432ae initial version: for emitfuncs pass
llvm-svn: 2886
2002-07-12 20:28:22 +00:00
Anand Shukla 1a26e82bd5 added emitfuncs pass, and disabled reassociate pass (needs fixing)
llvm-svn: 2885
2002-07-12 20:14:27 +00:00
Anand Shukla e9f685d397 Added emitfuncs pass
llvm-svn: 2884
2002-07-12 20:12:59 +00:00
Anand Shukla 9a3e4649d5 Added EmitFunctions directory
llvm-svn: 2883
2002-07-12 20:12:07 +00:00
Anand Shukla 5bdc8b6326 Initial makefile
llvm-svn: 2882
2002-07-12 20:11:24 +00:00
Anand Shukla 127412b0da Initial version: adds a function table to output code
llvm-svn: 2881
2002-07-12 20:10:50 +00:00
Chris Lattner 83ce4f9298 * 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

llvm-svn: 2880
2002-07-11 20:33:32 +00:00
Chris Lattner 228163059b * Nodes now keep track of any global variables in them
llvm-svn: 2879
2002-07-11 20:32:22 +00:00
Chris Lattner 7d0dafc0dc * 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.

llvm-svn: 2878
2002-07-11 20:32:02 +00:00
Chris Lattner 46e10fc3b9 * Nodes now keep track of any global variables contained within them
llvm-svn: 2877
2002-07-11 20:30:18 +00:00
Anand Shukla 3de6fcfdec added std:: to endl
llvm-svn: 2875
2002-07-11 00:17:17 +00:00
Anand Shukla cf764680ad added std:: to vector
llvm-svn: 2874
2002-07-11 00:16:28 +00:00
Chris Lattner 4734a1cd00 Rename DataStructure to LocalDataStructures
llvm-svn: 2873
2002-07-10 22:42:53 +00:00
Chris Lattner fdbd7241c9 New implementation of data structure analysis
This diff is completely meaningless because this is a replacement
implementation.

llvm-svn: 2872
2002-07-10 22:42:17 +00:00
Chris Lattner c0dab43c31 New implementation of data structure analysis. Only local analysis has been
implemented so far.

llvm-svn: 2871
2002-07-10 22:38:08 +00:00
Chris Lattner b2c5cb2525 Disable folding g-e-p instructions into loads and stores.
llvm-svn: 2870
2002-07-10 22:37:17 +00:00
Chris Lattner 87d180e7c6 Disable pool allocation stuff until data structure analysis is sorted back out
llvm-svn: 2869
2002-07-10 22:36:47 +00:00
Chris Lattner 3e35cef186 Reimplement data structure analysis
llvm-svn: 2868
2002-07-10 22:36:26 +00:00
Chris Lattner b723f9fc25 Fix broken test
llvm-svn: 2867
2002-07-10 22:31:09 +00:00
Vikram S. Adve 2a5085af8c Include Makefile.singlesrc in order to compile .c tests.
Some of these are not regression tests and this directory needs
to be reorganized, but the tests are important.

llvm-svn: 2866
2002-07-10 22:02:37 +00:00
Vikram S. Adve 253d9e40a2 Some of these are feature tests, not regression tests.
This directory needs to be reorganized and some of the tests
need changes to make them executable.  Also comments would help...

llvm-svn: 2865
2002-07-10 21:54:05 +00:00
Vikram S. Adve 72623d57e4 Bug fix: cast (bool) has higher precedence than %... who knew!
llvm-svn: 2864
2002-07-10 21:51:46 +00:00
Vikram S. Adve 546b6ac3e3 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.

llvm-svn: 2863
2002-07-10 21:50:57 +00:00
Vikram S. Adve a7f736eeea Added a few more methods for creating instructions.
llvm-svn: 2862
2002-07-10 21:49:38 +00:00
Vikram S. Adve 6a36c8f2b9 Fix print of BB name in dump().
llvm-svn: 2861
2002-07-10 21:45:30 +00:00
Vikram S. Adve f089faa7f6 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.

llvm-svn: 2860
2002-07-10 21:45:04 +00:00
Vikram S. Adve c5f8b52bd0 Changed interface to insertCallerSavingCode().
llvm-svn: 2859
2002-07-10 21:42:42 +00:00
Vikram S. Adve e997a11251 Stop using pseudo-instructions (SETX, SETUW, SETSW)
and generate actual machine instruction sequences directly.

llvm-svn: 2858
2002-07-10 21:42:13 +00:00
Vikram S. Adve 4e1ee14694 Add support to print %hh, %hm, %lm, or %lo in an operand field.
llvm-svn: 2857
2002-07-10 21:41:21 +00:00
Vikram S. Adve 58c904ace6 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.

llvm-svn: 2856
2002-07-10 21:39:50 +00:00
Vikram S. Adve 4aee77c70b 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.

llvm-svn: 2855
2002-07-10 21:36:00 +00:00
Vikram S. Adve 9423a4d0a5 Put caller-saving code *before* argument copying code!
(This file has a minor change required for this fix.)

llvm-svn: 2854
2002-07-10 21:30:17 +00:00
Vikram S. Adve 075ee8a836 Minor change in comments.
llvm-svn: 2853
2002-07-10 21:29:22 +00:00
Chris Lattner 5a9f63ef4e *** empty log message ***
llvm-svn: 2852
2002-07-10 16:48:17 +00:00
Chris Lattner fd5e6e0fb8 Allow specifying a module for context instead of a slot calculator directly
llvm-svn: 2851
2002-07-10 16:48:14 +00:00
Chris Lattner 54ef5ab8a0 Add a new testcase. It actually is not infinite looping. It just takes
FOREVER to run.  That's the bug.  :)

llvm-svn: 2850
2002-07-09 19:58:06 +00:00
Vikram S. Adve acceb1edff Disabling reassociate pass until it is fixed.
llvm-svn: 2849
2002-07-09 19:53:09 +00:00
Chris Lattner 2c13d473ef New testcase for problem effecting mst
llvm-svn: 2848
2002-07-09 19:41:21 +00:00
Anand Shukla 046fe57511 changed mem_fun to std::mem_fun
llvm-svn: 2847
2002-07-09 19:18:56 +00:00
Anand Shukla 4ddf053a63 added std:: to hash_set
llvm-svn: 2846
2002-07-09 19:18:16 +00:00
Anand Shukla 7e882db2f4 Added std:: to mem_fun for 64-bit gcc
llvm-svn: 2845
2002-07-09 19:16:59 +00:00
Chris Lattner f6d3cb95cf Implementing shift left & shift right on pointers
llvm-svn: 2844
2002-07-09 18:42:36 +00:00
Chris Lattner d6e237ff52 Include header in the compiler-neutral location
llvm-svn: 2843
2002-07-09 16:50:24 +00:00
Vikram S. Adve a3697666eb Added support for printing constant global references to
assembly.

llvm-svn: 2842
2002-07-09 12:30:29 +00:00
Vikram S. Adve 24132e8983 Add makefile-mode flag for emacs.
llvm-svn: 2841
2002-07-09 12:04:21 +00:00
Vikram S. Adve 4b581be494 Fix iteration and InsertPos bugs introduced when Chris changed over to ilist.
llvm-svn: 2840
2002-07-08 23:37:07 +00:00
Vikram S. Adve 5eb69429aa Numerous changes in interface to class SparcRegInfo corresponding to
changes in class MachineRegInfo (see MachineRegInfo.h for details).

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

llvm-svn: 2839
2002-07-08 23:34:10 +00:00
Vikram S. Adve 1ce4096033 class MachineCodeForBasicBlock is now an annotation on BasicBlock.
llvm-svn: 2838
2002-07-08 23:31:24 +00:00
Vikram S. Adve 3bb830d337 BA no longer has the unused CC operand.
llvm-svn: 2837
2002-07-08 23:30:59 +00:00
Vikram S. Adve 82190d3e73 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.

llvm-svn: 2836
2002-07-08 23:30:14 +00:00
Vikram S. Adve c564520c5c BA has only one argument.
Added LDFSR, LDXFSR, STFSR and STXFSR.
Fixed operands info for RDCCR, WRCCR.

llvm-svn: 2835
2002-07-08 23:25:17 +00:00
Vikram S. Adve aee6701e63 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.

llvm-svn: 2834
2002-07-08 23:23:12 +00:00
Vikram S. Adve 7228f0c404 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.

llvm-svn: 2833
2002-07-08 23:15:32 +00:00
Vikram S. Adve 1dfb4079b7 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.

llvm-svn: 2832
2002-07-08 23:07:26 +00:00
Vikram S. Adve 35bac4a658 Rename static struct Initializer to avoid name conflict with BB.
llvm-svn: 2831
2002-07-08 23:04:31 +00:00
Vikram S. Adve 4180fe41c2 Fix printing of BB in dump.
llvm-svn: 2830
2002-07-08 23:03:54 +00:00
Vikram S. Adve 2bd7ae169d Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.h.
This class is now an annotation on BasicBlock.

llvm-svn: 2829
2002-07-08 23:03:10 +00:00
Vikram S. Adve a9c93af49f MachineInstr::dump() now takes no arguments.
llvm-svn: 2828
2002-07-08 23:01:46 +00:00
Vikram S. Adve f0b84cefb0 Implementation of class MachineCodeForBasicBlock.
Moved here from MachineInstr.cpp to make it an annotation on BasicBlock.

llvm-svn: 2827
2002-07-08 23:01:11 +00:00
Vikram S. Adve 19c55db0d9 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".

llvm-svn: 2826
2002-07-08 22:59:23 +00:00
Vikram S. Adve ae219e24ba A single MachineInstr operand may now be both a def and a use.
llvm-svn: 2825
2002-07-08 22:56:34 +00:00
Vikram S. Adve 00ee3ee0d3 cpMem<->Reg functions now support CC registers (int and FP) correctly.
A scratch register has to be provided when needed to do the copy.
Also, cpMem<->Reg functions now return a vector of machine instructions.

Added several get{Class,Type} functions.

Suggest/Color methods may modify the MachineInstr (and always did),
so don't make that argument const!

llvm-svn: 2824
2002-07-08 22:44:14 +00:00
Vikram S. Adve dc21fb7775 Interface to class MachineCodeForBasicBlock.
Moved here from MachineInstr.h to make it an annotation on BasicBlock.

llvm-svn: 2823
2002-07-08 22:40:34 +00:00
Vikram S. Adve beb364051b getUsableUniRegAtMI interface simplified slightly.
llvm-svn: 2822
2002-07-08 22:39:36 +00:00
Vikram S. Adve 6c013a9689 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.

llvm-svn: 2821
2002-07-08 22:38:45 +00:00
Vikram S. Adve ff045b2e18 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.

llvm-svn: 2820
2002-07-08 22:34:40 +00:00
Vikram S. Adve 50684c092d Added two more helper functions for instruction creation.
llvm-svn: 2819
2002-07-08 22:33:45 +00:00
Vikram S. Adve 6e792fca91 Moved MachineCodeForBB to be an annotation on BasicBlock.
llvm-svn: 2818
2002-07-08 22:31:11 +00:00
Anand Shukla 2d3d20b09f changes BBsorting and oredering
llvm-svn: 2817
2002-07-08 19:37:06 +00:00
Anand Shukla ff72c798ac small corrections
llvm-svn: 2816
2002-07-08 19:36:39 +00:00
Anand Shukla 11f4262874 changed function numbering
llvm-svn: 2815
2002-07-08 19:36:01 +00:00
Anand Shukla bc7054b466 Add new << to allow printing modules by reference.
llvm-svn: 2814
2002-07-03 16:52:15 +00:00
Chris Lattner 33422fedc2 *** empty log message ***
llvm-svn: 2813
2002-06-30 16:25:25 +00:00
Chris Lattner a3a1ba1d6a Clean up anands patch
llvm-svn: 2812
2002-06-30 16:25:21 +00:00
Chris Lattner e3e86f7027 Strip the symbols out of the bytecode to inflate generated executables less.
llvm-svn: 2811
2002-06-30 16:25:07 +00:00
Chris Lattner c19be16c7b YEs, we really do want to sort.
llvm-svn: 2810
2002-06-30 16:20:02 +00:00
Chris Lattner f119a2b1df Yes, we REALLY DO want to run the reassociate pass.
llvm-svn: 2809
2002-06-30 16:19:14 +00:00
Chris Lattner c28c7b9ccf Remove diff-cluttering tags
llvm-svn: 2808
2002-06-30 16:12:03 +00:00
Chris Lattner dec26513ad Remove tag that just clutters diffs
llvm-svn: 2807
2002-06-30 16:08:25 +00:00
Chris Lattner e8b6196f28 Fix anands changes
llvm-svn: 2806
2002-06-30 16:07:20 +00:00
Chris Lattner 0a30bda280 Convert tabs to spaces
llvm-svn: 2805
2002-06-30 16:04:37 +00:00
Chris Lattner 9e5b6904e5 Fix anand's last checkin
llvm-svn: 2804
2002-06-30 16:01:15 +00:00
Chris Lattner 03b18721be Fix comment
llvm-svn: 2803
2002-06-30 15:50:09 +00:00
Chris Lattner 0a0c5341da Cleanup
llvm-svn: 2802
2002-06-28 22:06:39 +00:00
Anand Shukla 8c37789a33 changes for 64bit gcc
llvm-svn: 2801
2002-06-25 22:07:38 +00:00
Anand Shukla 949659c0e2 added include<iostream> for cerr
llvm-svn: 2800
2002-06-25 22:04:00 +00:00
Anand Shukla fef3241cc6 Changes for 64bit gcc
llvm-svn: 2799
2002-06-25 21:57:48 +00:00
Anand Shukla dfe130c161 correcting makefile: incorrectly checked in wrong version earlier
llvm-svn: 2798
2002-06-25 21:44:44 +00:00
Anand Shukla 68c9977d7f Changes for 64bit gcc
llvm-svn: 2797
2002-06-25 21:43:28 +00:00
Anand Shukla 7e9d0710e6 added include<iostream> for cerr
llvm-svn: 2796
2002-06-25 21:29:10 +00:00
Anand Shukla 2ac04a0083 changes to make it compatible with 64bit gcc
llvm-svn: 2795
2002-06-25 21:18:19 +00:00
Anand Shukla 21906891d7 additions and bug fixes
llvm-svn: 2794
2002-06-25 21:14:58 +00:00
Anand Shukla af26b39bc5 added include<iostream> for cerr
llvm-svn: 2793
2002-06-25 21:12:25 +00:00
Anand Shukla 2bc6419a82 changes to make it compatible with 64bit gcc
llvm-svn: 2792
2002-06-25 21:07:58 +00:00
Anand Shukla 458496c060 changes to make it compatible with 64bit gcc
llvm-svn: 2791
2002-06-25 20:55:50 +00:00
Anand Shukla eaa2e7204e changes to make it compatible with 64bit gcc
llvm-svn: 2790
2002-06-25 20:44:04 +00:00
Anand Shukla ff4c42b7c3 changes to make it compatible with 64bit gcc
llvm-svn: 2789
2002-06-25 20:35:19 +00:00
Anand Shukla 4fc92edcc6 minor change in removing endl
llvm-svn: 2788
2002-06-25 20:34:54 +00:00
Chris Lattner 2d38db3b45 We must with with GCC 2.95 :(
llvm-svn: 2787
2002-06-25 20:33:28 +00:00
Anand Shukla f1c0d920e3 changes to make it compatible with 64bit gcc
llvm-svn: 2786
2002-06-25 20:22:25 +00:00
Chris Lattner 55d3b0d266 Avoid calling LLVM "Strongly typed"
llvm-svn: 2785
2002-06-25 20:20:08 +00:00
Anand Shukla f1aafa4236 Added setSuccessor() method to terminator instructions
llvm-svn: 2784
2002-06-25 20:17:40 +00:00
Chris Lattner 268e8dd791 New testcase
llvm-svn: 2783
2002-06-25 19:53:12 +00:00
Chris Lattner daf228fe8b Add borders to truth tables
llvm-svn: 2782
2002-06-25 18:06:50 +00:00
Chris Lattner d8f8ede5eb Minor tuning and fleshing out of the language reference.
llvm-svn: 2781
2002-06-25 18:03:17 +00:00
Chris Lattner 7965113d22 Build all subdirectories
llvm-svn: 2780
2002-06-25 16:16:20 +00:00
Chris Lattner 113f4f4609 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner 7076ff29ed MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner fda72b1aad *** empty log message ***
llvm-svn: 2777
2002-06-25 16:12:52 +00:00
Chris Lattner 6e3c5fada6 Description of a large patch that I checked in
llvm-svn: 2776
2002-06-25 16:09:22 +00:00
Chris Lattner 5aa3a0779e Simplify the code that adds passes so compilation can stop after any step
llvm-svn: 2775
2002-06-25 15:57:43 +00:00
Chris Lattner f8b0668cc1 * Update with MegaPatch
* Fix various bugs

llvm-svn: 2774
2002-06-25 15:57:03 +00:00
Chris Lattner 069a795940 * 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

llvm-svn: 2773
2002-06-25 15:56:27 +00:00
Chris Lattner 2ae9cda097 Remove DynamicConstantMerge pass, because it did not fit in with the Pass
system correctly.

llvm-svn: 2772
2002-06-25 15:55:29 +00:00
Chris Lattner 6eeda027c7 Remove "fixers" for problems in GCC generated code that cannot be generated
anymore.

llvm-svn: 2771
2002-06-25 15:55:03 +00:00
Anand Shukla 8c1c854022 Relocating Graph.h
llvm-svn: 2770
2002-06-25 14:28:55 +00:00
Chris Lattner 08dd46a661 Test more thoroughly
llvm-svn: 2769
2002-06-24 21:37:08 +00:00
Chris Lattner 0da785168b Expose the analyzer
llvm-svn: 2768
2002-06-24 21:35:50 +00:00
Chris Lattner e2d7896d9b Basic test of the inlinr
llvm-svn: 2767
2002-06-24 17:46:05 +00:00
Chris Lattner c917d106aa Testcase for unimplemented feature
llvm-svn: 2766
2002-06-24 17:45:37 +00:00
Chris Lattner 0df3511df9 Checkin descriptive note
llvm-svn: 2765
2002-06-24 16:49:55 +00:00
Chris Lattner 5d5824b77a Mark some stuff as done
llvm-svn: 2764
2002-06-10 21:15:48 +00:00
Chris Lattner 18b412df5e New testcases for verifier
llvm-svn: 2763
2002-06-08 17:33:16 +00:00
Chris Lattner 2152e03bfd Fix constness
llvm-svn: 2762
2002-06-05 18:11:37 +00:00
Chris Lattner c0b158b94d Fix Constness problems
llvm-svn: 2761
2002-06-05 18:08:26 +00:00
Chris Lattner 0a5aca621a Fix const problems
llvm-svn: 2760
2002-06-05 17:55:27 +00:00
Chris Lattner 64802e4db8 Fix constness problem
llvm-svn: 2759
2002-06-05 17:49:40 +00:00
Chris Lattner b469cf8361 Fix constness problems now that the cast operators preserve the constness
of their argument

llvm-svn: 2758
2002-06-05 17:38:28 +00:00
Chris Lattner 8cb1dfbdc9 * 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.

llvm-svn: 2757
2002-06-04 21:58:56 +00:00
Chris Lattner 070cf77a40 Disable debugging output
llvm-svn: 2756
2002-06-04 03:09:57 +00:00
Chris Lattner 2db70cea7c *** empty log message ***
llvm-svn: 2755
2002-06-03 22:10:52 +00:00
Chris Lattner e7779b56a0 Allow const bb's to be checked for containment in a loop
llvm-svn: 2754
2002-06-03 22:10:48 +00:00
Chris Lattner 194138cd08 Avoid deleting individual instructions until AFTER dead blocks have dropped
their references.  This fixes bug:
    test/Regression/Transforms/ADCE/2002-05-28-Crash*.ll

llvm-svn: 2753
2002-05-28 21:38:16 +00:00
Chris Lattner 7817cd6833 New testcase that is a distilled form of the other one
llvm-svn: 2752
2002-05-28 21:29:28 +00:00
Chris Lattner d4eaa7e14c New testcase that crashes ADCE
llvm-svn: 2751
2002-05-28 21:22:46 +00:00
Chris Lattner 6457590f1b Simplify the interface to local dce and constprop
llvm-svn: 2750
2002-05-26 20:18:35 +00:00
Chris Lattner ab038d44b0 Simplify the interface to local DCE and Constant prop
llvm-svn: 2749
2002-05-26 20:18:18 +00:00
Chris Lattner 2904f44693 Support opaque type printing a little bit at least
llvm-svn: 2748
2002-05-26 20:17:54 +00:00
Chris Lattner eef79f1af4 Do not remove type names that contain a .
llvm-svn: 2747
2002-05-26 20:17:35 +00:00
Chris Lattner 1eb9e6cc47 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.

llvm-svn: 2745
2002-05-24 21:33:26 +00:00
Chris Lattner b9e7186ade Testcases to show what -funcresolve does.
llvm-svn: 2744
2002-05-24 21:27:41 +00:00
Chris Lattner a17c1f1735 Run FuncResolve tests
llvm-svn: 2743
2002-05-24 21:21:36 +00:00
Chris Lattner 5aa9e3e702 Split the FunctionResolution pass out of CleanGCCOutput.cpp.
llvm-svn: 2742
2002-05-24 20:42:13 +00:00
Chris Lattner e80124df80 Fix comments to reflect reality
llvm-svn: 2741
2002-05-24 20:41:51 +00:00
Chris Lattner e3da2980ad 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

llvm-svn: 2740
2002-05-24 20:29:18 +00:00
Chris Lattner 88a600a5fd New testcase, to be inspected by hand
llvm-svn: 2739
2002-05-23 20:58:45 +00:00
Chris Lattner f08d7436ca No need to run dce with adce right behind!
llvm-svn: 2738
2002-05-23 19:27:50 +00:00
Chris Lattner 450d928d3a New testcase
llvm-svn: 2737
2002-05-23 18:51:27 +00:00
Chris Lattner c17c38f3cc Make sure the extracted function has external linkage, so that it doesn't
get eliminated by globaldce!

llvm-svn: 2736
2002-05-23 18:36:25 +00:00
Chris Lattner 3f3cf8c9e2 New testcase
llvm-svn: 2735
2002-05-23 18:27:08 +00:00
Chris Lattner 9c2765d4aa Fold add X, 0 for floating point types as well
llvm-svn: 2734
2002-05-23 17:11:38 +00:00
Chris Lattner 5cd012d58c Fix bug: test/Regression/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
Which contains a description of why this is neccesary.

llvm-svn: 2733
2002-05-23 16:52:34 +00:00
Chris Lattner 2a9150be90 New testcase
llvm-svn: 2732
2002-05-23 16:51:25 +00:00
Chris Lattner abe98198a8 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.

llvm-svn: 2731
2002-05-23 15:50:03 +00:00
Chris Lattner 54474c75ec Add a new setSuccessor method to terminator instructions
llvm-svn: 2730
2002-05-23 15:48:41 +00:00
Chris Lattner d99d9d5aef Implement DataTypes.h in terms of inttypes.h
llvm-svn: 2729
2002-05-23 15:48:12 +00:00
Chris Lattner e8c7d75dd6 Avoid creating the symbol table if we don't need it.
llvm-svn: 2728
2002-05-22 22:53:05 +00:00
Chris Lattner f4c7dd9c22 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.

llvm-svn: 2727
2002-05-22 22:33:00 +00:00
Chris Lattner 143e5a47c0 Print out function name with % style instead of "" style
llvm-svn: 2726
2002-05-22 22:29:26 +00:00
Chris Lattner bc42e52d9a Remove spaces from function names
While I was at it, I converted functions to new style % name

llvm-svn: 2725
2002-05-22 22:28:27 +00:00
Chris Lattner de32295d8c New testcase
llvm-svn: 2724
2002-05-22 22:17:54 +00:00
Chris Lattner b5f3a7d1c0 Run profile paths tests
llvm-svn: 2723
2002-05-22 22:02:24 +00:00
Chris Lattner 76792c5190 Test cases for profile paths pass
llvm-svn: 2722
2002-05-22 22:02:14 +00:00
Chris Lattner e1fc2d965f Convert code to use the DEBUG macro so that debug code can simply be
enabled with the -debug command line option.

llvm-svn: 2721
2002-05-22 21:56:32 +00:00
Chris Lattner 559f0ee9c9 Fix and implement ADCE to finally work!
llvm-svn: 2720
2002-05-22 21:32:16 +00:00
Chris Lattner 702eacab25 Add the ADCE pass to gccas finally!
llvm-svn: 2719
2002-05-22 21:30:24 +00:00
Chris Lattner 3c1d79d091 New testcase
llvm-svn: 2718
2002-05-22 20:46:30 +00:00
Chris Lattner 3df8d3e5d6 Build the extract utility
llvm-svn: 2717
2002-05-22 20:27:15 +00:00
Chris Lattner 055de1876a Initial checkin of the "extract" utility
llvm-svn: 2716
2002-05-22 20:27:00 +00:00
Chris Lattner 5f1ddb0d94 Add more testcases for ADCE
llvm-svn: 2715
2002-05-22 19:22:45 +00:00
Chris Lattner acd4599e57 Convert transforms over to standardize debugging output on -debug option
llvm-svn: 2714
2002-05-22 17:27:12 +00:00
Chris Lattner 71cbd42b98 Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
llvm-svn: 2713
2002-05-22 17:17:27 +00:00
Chris Lattner afc86e9a35 Move debug options out of header files so that the header does not have
to #include CommandLine.h.

llvm-svn: 2712
2002-05-22 17:08:27 +00:00
Chris Lattner 6264c1c0ab Move the DEBUG_LV option out of the public header file into a private header.
llvm-svn: 2711
2002-05-22 17:07:26 +00:00
Chris Lattner d5ed3694ae Avoid #including CommandLine.h
llvm-svn: 2710
2002-05-22 17:06:56 +00:00
Chris Lattner 5184bdc596 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.

llvm-svn: 2709
2002-05-22 17:06:20 +00:00
Chris Lattner 8f7b500fff 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.

llvm-svn: 2708
2002-05-22 17:03:05 +00:00
Chris Lattner a482d52ff4 Fix bug: test/Regression/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
Improperly handling edges... by not marking them alive properly

llvm-svn: 2707
2002-05-22 16:07:20 +00:00
Chris Lattner 4dd6620dae Must run cfgsimplify to eliminate dead blocks
llvm-svn: 2706
2002-05-22 15:49:14 +00:00
Chris Lattner 279aa6eb45 New testcase
llvm-svn: 2705
2002-05-21 22:23:38 +00:00
Chris Lattner c839a2574e * Fix typeo
* Provide a #include of <malloc.h> so that the sun C compiler does not
  miscompile malloc function calls

llvm-svn: 2702
2002-05-21 21:10:04 +00:00
Chris Lattner 466a049b67 Add implementation of SimplifyCFG
llvm-svn: 2701
2002-05-21 20:50:24 +00:00
Chris Lattner fa7dad8cd5 New CFG Simplification pass: removed from the old DCE pass
llvm-svn: 2700
2002-05-21 20:49:37 +00:00
Chris Lattner 5972e5cc5c Expose cfg simplification pass
llvm-svn: 2699
2002-05-21 20:05:16 +00:00
Chris Lattner 8c1d9485cd Simplify CFG after code generation is done
llvm-svn: 2698
2002-05-21 20:05:08 +00:00
Chris Lattner 4b009adc77 Simplify interface to ConstantFoldTerminator
llvm-svn: 2697
2002-05-21 20:04:50 +00:00
Chris Lattner c18f65fdae Expose CFG simplification pass
llvm-svn: 2696
2002-05-21 20:04:15 +00:00
Chris Lattner 9ec59c48ce New testcase
llvm-svn: 2695
2002-05-21 20:03:42 +00:00
Chris Lattner f7373e4bec Fix bug: test/Regression/Transforms/CFGSimplify/2002-05-21-PHIElimination.ll
llvm-svn: 2694
2002-05-21 19:52:49 +00:00
Chris Lattner 317cb8d8c9 Update run line
llvm-svn: 2693
2002-05-21 19:33:17 +00:00
Chris Lattner 753dae6fff This testcase was very broken! The block could not be merged because then
there would be a broken PHI node

llvm-svn: 2692
2002-05-21 19:32:58 +00:00
Chris Lattner d29c9f9a5f New testcase
llvm-svn: 2691
2002-05-21 19:22:10 +00:00
Chris Lattner e7c7df07f3 Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll
llvm-svn: 2690
2002-05-21 18:05:19 +00:00
Chris Lattner 14829efdc5 New TEstcase
llvm-svn: 2689
2002-05-21 18:04:58 +00:00
Mehwish Nagda 4dbcec4295 Fixed the makefile to not die when compiling a new, empty, source directory
llvm-svn: 2688
2002-05-21 15:58:24 +00:00
Chris Lattner dc682da4fc Remove unneccesary path from link line now
llvm-svn: 2679
2002-05-20 21:47:40 +00:00
Chris Lattner 4b52d7fbac Allow libraries to specify other libraries to link to
llvm-svn: 2678
2002-05-20 21:45:44 +00:00
Chris Lattner ace7b8d3bd * Change commandline options a bit to be nicer
* Insert accurate prototypes for functions
* Insert casts to use accurate prototypes

llvm-svn: 2677
2002-05-20 21:43:59 +00:00
Chris Lattner 99bd13b415 Hide debugging options
llvm-svn: 2676
2002-05-20 21:39:10 +00:00
Chris Lattner 4955d3e1c2 Fix tracing code support to link in the tracing routines if neccesary.
This is required because trace code can insert calls to functions that
are (now) in an LLVM library, not a native library.

This change makes it easier to use the tracing code because the native
link options don't have to change, and it fits in a lot better with the
LLVM model.

llvm-svn: 2675
2002-05-20 21:20:08 +00:00
Chris Lattner 1319429f4d Remove explicit support for tracing code. It should be linked into the
executable just like everything else.

llvm-svn: 2674
2002-05-20 21:17:16 +00:00
Chris Lattner 13e8979767 Remove tracing code hack
llvm-svn: 2673
2002-05-20 21:16:46 +00:00
Chris Lattner f7b31cceec Tracelib is now an LLVM library just like all other libraries in this
directory.

If the test code needs to be resurrected in the future, it should be moved
into the test/Programs directory, linking with tracelib.

llvm-svn: 2672
2002-05-20 21:16:19 +00:00
Chris Lattner 008db290b8 * If hashing a pointer, cast it to a 64 bit number so gcc doesn't warn
* Don't put extra stuff after #endif

llvm-svn: 2671
2002-05-20 21:15:30 +00:00
Chris Lattner 6132157ab8 New testcase for bug
llvm-svn: 2670
2002-05-20 20:48:24 +00:00
Chris Lattner b710b1fb22 Fix bug: test/Regression/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
That was causing a miscompilation of strtol/atoi plus others

llvm-svn: 2669
2002-05-20 20:48:03 +00:00
Chris Lattner 2df953ba74 Use literal newline instead of endl
llvm-svn: 2668
2002-05-20 19:49:24 +00:00
Chris Lattner 6c1e5c4d3b Drop something that link will never support, use gccld instead
llvm-svn: 2667
2002-05-20 19:48:55 +00:00
Chris Lattner 0c1b51e622 Implement the printf function, used by assert
llvm-svn: 2666
2002-05-20 19:11:23 +00:00
Chris Lattner 9af99f8c74 Don't lose namespace qualifications on previous patch.
llvm-svn: 2664
2002-05-20 17:38:26 +00:00
Chris Lattner 7f99b6f58c Rename IsPowerOf2 to isPowerOf2
llvm-svn: 2663
2002-05-19 21:20:19 +00:00
Chris Lattner 84dc8633e8 Cleanups, rename IsPowerOf2 to isPowerOf2
llvm-svn: 2662
2002-05-19 21:19:55 +00:00
Vikram S. Adve cf3c90d4c8 Add libsparc.a a second time to resolve link errors.
llvm-svn: 2661
2002-05-19 16:01:03 +00:00
Vikram S. Adve b810407ddb Link with test/Libraries/libinstr32.a for runtime routines
supporting tracing.  That should be moved to a "runtime" directory.

llvm-svn: 2660
2002-05-19 16:00:28 +00:00
Vikram S. Adve a77150b977 Added external functions for hashing pointers to sequence numbers.
llvm-svn: 2659
2002-05-19 15:59:25 +00:00
Vikram S. Adve be31fcf252 Runtime routines to support tracing.
Currently includes code to hash pointers to sequence numbers.
The hash table should be separated out into a separate file
since that is generic.  The rest of this code is pretty small.

llvm-svn: 2655
2002-05-19 15:49:58 +00:00
Vikram S. Adve 423960a8a9 Fix libs and includes for compiling with llc.
llvm-svn: 2654
2002-05-19 15:47:52 +00:00
Vikram S. Adve e363307e49 Added log2 for log-base-2 and also modified IsPower2 to use it.
llvm-svn: 2653
2002-05-19 15:46:52 +00:00
Vikram S. Adve 18d5a88024 Added parameter IntRegSize for standard general-purpose register size.
llvm-svn: 2652
2002-05-19 15:44:07 +00:00
Vikram S. Adve c479fd5cd9 New function CreateSignExtensionInstructions.
Methods now take MachineCodeForInstruction& as an argument and record
temporary values in it directly, instead of return the temps.
Really simplifies callers.

llvm-svn: 2651
2002-05-19 15:43:31 +00:00
Vikram S. Adve 58d578957d Many functions that returned a single MachineInstr now take a
vector of MachineInstr* to return multiple ones.

llvm-svn: 2650
2002-05-19 15:42:21 +00:00
Vikram S. Adve 5d78db2afb InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.

llvm-svn: 2649
2002-05-19 15:41:33 +00:00
Vikram S. Adve d379fe042a Better interface to generating machine instr for common cases
(many places still need to be updated to use this interface).

llvm-svn: 2648
2002-05-19 15:40:41 +00:00
Vikram S. Adve a98ff36ec1 MachineInstr now inherits from Annotable.
llvm-svn: 2647
2002-05-19 15:39:59 +00:00
Vikram S. Adve 47f37c3404 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.

llvm-svn: 2646
2002-05-19 15:39:02 +00:00