Commit Graph

591 Commits

Author SHA1 Message Date
Chris Lattner
e9754ef595 * Break the two different behaviors of SimpleStructMutation into two subclasses
* Register the passes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3013 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:03:11 +00:00
Chris Lattner
33494521d3 * Make the ctor take a TargetData even though it's not using it yet
* Register the pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3012 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:02:23 +00:00
Chris Lattner
72c27e2ae5 * Remove lots of dead stuff
* Register Pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3011 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:01:39 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Chris Lattner
86c25fd556 Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2627 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 16:44:07 +00:00
Chris Lattner
b3bc8fa755 Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll
"This testcase caused instcombine to fail because it got the same instruction on
it's worklist more than once (which is ok), but then deleted the instruction.
Since the inst stayed on the worklist, as soon as it came back up to be
processed, bad things happened, and opt asserted."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2623 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 15:24:07 +00:00
Chris Lattner
c99428f3c9 Fix a major source of "type unsafety", where a cast is neccesary, but can
be put either before or after a load.  We chose to cast the value loaded
instead of the pointer to load from.

Fixes bug: test/Regression/Transforms/LevelRaise/2002-05-10-LoadPeephole.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2621 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 05:23:45 +00:00
Chris Lattner
18fb2a6682 Implement elimination of loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2620 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 05:02:40 +00:00
Chris Lattner
2172db04e7 Trivial cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2617 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-13 22:04:46 +00:00
Chris Lattner
e0e734eea0 Initial checkin of LICM pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2615 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 22:44:58 +00:00
Chris Lattner
3dec1f2722 Add support for printing out statistics information when -stats is added to
the command line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:38:35 +00:00
Chris Lattner
55547274bc Fix some bugs, straighten stuff out, more work needs to be done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2600 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:37:35 +00:00
Chris Lattner
3c0193742a * Add support for the -stats command line option to report how much is changed
* Make cast-of-self-ty DCE the dead cast instruction immediately instead of
  waiting for it to be DCE'd by another sweep over the function.  This speeds
  this up noticably.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2597 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:29:25 +00:00
Chris Lattner
87fea85934 Initial checkin of the PiNodeInsertion pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2593 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 05:41:34 +00:00
Chris Lattner
53a5b57737 Handle setcc <global*>, 0 instructions, Global pointers are never null!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2582 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 20:11:54 +00:00
Chris Lattner
0aa7cd605d Give the longer name to the instruction that will probably be eliminated later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2581 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 20:11:23 +00:00
Chris Lattner
403717156b Add ability to transform (x - (y - z)) into (x + (z - y))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2566 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 01:29:19 +00:00
Chris Lattner
5c4afb9034 * Combine: A-(-B) -> A + B
* Bugfix:  A + -B and -A + B


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2561 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-08 22:46:53 +00:00
Chris Lattner
4fd56003ab Initial checkin of expression reassociation pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2559 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-08 22:19:27 +00:00
Chris Lattner
8ca21c245c Give the unified exit node a name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2550 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 22:14:45 +00:00
Chris Lattner
ea54ab9cd2 Fix bug: test/Regression/Transforms/ADCE/2002-01-31-UseStuckAround.ll
Cleanup code a lot


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2547 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 22:11:39 +00:00
Chris Lattner
022103b3f3 Merge all individual .h files into a single Scalar.h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2537 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 20:03:00 +00:00
Chris Lattner
a869b8dbd3 This doesn't use DCE!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2536 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 20:02:44 +00:00
Chris Lattner
fc514f40a6 Move UnifyFunctionExitNodes to Utils library: final resting place this time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2531 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 19:18:48 +00:00
Chris Lattner
65e96e57c5 fix comments and documentation in file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2530 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 19:04:39 +00:00
Chris Lattner
ade686e79b Split ChangeAllocations.cpp into Raise & LowerAllocations.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2529 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 19:02:48 +00:00
Chris Lattner
b444a1fff4 Cleanup implementation a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2526 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:51:25 +00:00
Chris Lattner
c8cc4cb03b Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:36:35 +00:00
Chris Lattner
497c60c0ed Reduce dependance on TransformInternals.h, instead using the TransformUtils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2518 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:12:18 +00:00
Chris Lattner
6d7491c3cc Add #include no longer included by llvm/Transforms/Scalar/ConstantProp.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2517 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:11:30 +00:00
Chris Lattner
2ed01d8f0b Factor code out to the TransformUtils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2516 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:10:55 +00:00
Chris Lattner
5a4337a8fc Factor code out of TransformInternals into the Transform Utils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2515 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:09:15 +00:00
Chris Lattner
0ed2e4b554 Build Transforms Utils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2514 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:08:50 +00:00
Chris Lattner
4d1e46e7b0 Add code pulled out of TransformInternals.cpp, ConstProp.cpp, and DCE.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2513 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:07:59 +00:00
Chris Lattner
071d0ad2f1 * Convert InstWorkList to vector instead of set, because on big programs it
is empirically faster by a noticable margin, even though duplicates can
  happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2511 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 04:29:32 +00:00
Chris Lattner
92deeaf7a3 * Remove all cfg simplification stuff for a new cfg simplify pass (todo)
* Convert to worklist instead of iterative algorithm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2510 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 04:24:11 +00:00
Chris Lattner
d661937352 Only do masking for unsigned values!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2504 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:54:59 +00:00
Chris Lattner
89df1b58a9 * Eliminate dead code that should have been removed in last revision
* Convert main constant propogation pass to be worklist driven instead of
  iterative.
* -constprop pass no longer "constant propogates" terminator instructions
   - CFG is now preserved!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2502 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:21:31 +00:00
Chris Lattner
473945d1dc Handle X = phi Y --> X = Y
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2501 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:06:38 +00:00
Chris Lattner
f51825e3fb * Use simplified interface to constant propogation stuff.
* Remove dead PHI case (which could not work due to getNumOperands rather than
  getNumIncomingValues.  This really belongs in InstCombine, anyway so we'll
  move it there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2497 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:54:10 +00:00
Chris Lattner
dfe81ab87a Clean up ADCE by removing extraneous wrapper class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2494 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:27:57 +00:00
Chris Lattner
ed3a55005d Combine not (not X) -> X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2493 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:03:21 +00:00
Chris Lattner
b35dde1df4 Support more cases...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2490 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:49:18 +00:00
Chris Lattner
3f5b877dd4 Add many more instruction combination simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2484 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:14:14 +00:00
Chris Lattner
cdac78b8a4 Merge blocks like this:
void "test3"(bool %T) {
        br bool %T, label %BB1, label %BB1
BB1:
        ret void
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2472 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:02:02 +00:00
Chris Lattner
4c1061f58c Implement constant propogation of shift instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2471 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:01:37 +00:00
Chris Lattner
904ec289c2 Ok, really it only takes me 3 times to get this right!
Now use #if 0 instead of #ifdef 0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2448 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 21:49:50 +00:00
Chris Lattner
52a9a1def8 Oops, disable debugging code all the way. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2447 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 21:47:40 +00:00
Chris Lattner
b9a6634466 * Finish the implementation of isEdgeFeasible this fixes bug:
test/Regression/Transforms/SCCP/2002-05-02-EdgeFailure.ll
* SCCP now preserves the CFG:  It leaves conditional branches the way they
  are in the program, not simplifying them.  A seperate pass should eliminate
  the potentially dead basic blocks and edges in the CFG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2446 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 21:44:00 +00:00
Chris Lattner
59f0ce2a41 * Enable SCCP debugging to be turned on with a simple change of #define
* Change worklist to a set so that duplicates cannot happen
* Add support for the invoke instruction
* Avoid marking store and free instructions as overdefined, since they
  cannot produce a value anyway.
* Inline the OperandChangedState implementation
* Add isEdgeFeasible in preparation to fix a bug.  Right now it behaves
  exactly as before.
* Remove obsolete comment about constant pools


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2445 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 21:18:01 +00:00
Chris Lattner
0e9c515439 * Simplify the code by not bothering to name the folded constant
* Do not skip the instruction immediately after a folded instruction.  This
  was causing the testcase failure:
	test/Regression/Transforms/SCCP/2002-05-02-MissSecondInst.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2443 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 20:32:51 +00:00
Chris Lattner
872265ee1b ExprTypeConvert will already do this transformation, no need to specialize
it here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2431 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 17:38:55 +00:00
Chris Lattner
1f8d13c361 Be a little more efficient, do not generate loads and stores with indices in them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2430 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 17:38:14 +00:00
Chris Lattner
bbad858b3a Fix bug: test/Regression/Transforms/LevelRaise/2002-05-02-BadCastElimination.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2429 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 17:37:34 +00:00
Chris Lattner
a1be566213 * Add ability to eliminate a bunch of different cascading cast variations
* Allow elimination of getelementptr X, uint 0 (which is a noop)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2428 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 17:06:02 +00:00
Chris Lattner
68d024dde4 Fixed bug: test/Regression/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2423 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-01 15:38:23 +00:00
Chris Lattner
71d3934bad Remove unneccesary pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2420 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-30 20:52:49 +00:00
Chris Lattner
6c1ce21ee6 Add folding rules for mul X, 0 and mul X, 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2417 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 22:24:47 +00:00
Chris Lattner
0dbfc05a2a Significantly clean up SCCP pass. Now the two classes are merged and in
an anonymous namespace where they belong.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2415 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 21:26:08 +00:00
Chris Lattner
f737121054 Range insertion now returns an iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2414 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 21:25:34 +00:00
Chris Lattner
94cf3b1c67 Remove unused files: This is the old induction varaible cannonicalization
pass built on top of interval analysis


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2411 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 20:18:00 +00:00
Chris Lattner
4840146b46 Fix for problem when allocating something like this:
malloc(100-i);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2409 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 20:09:21 +00:00
Chris Lattner
72a1d4e126 changes because iMemory.h no longer #includes DerivedTypes.h
This only requires Type.h anyway


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2405 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:48:30 +00:00
Chris Lattner
f772f8ef38 Eliminate dead global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2400 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:13:11 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
8b054c0eb9 Remove broken assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2396 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 16:20:25 +00:00
Chris Lattner
96c466b06a Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 14:57:45 +00:00
Chris Lattner
097632eae3 More cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2392 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 01:58:47 +00:00
Chris Lattner
2f6f03bddd Code cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2391 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 01:22:55 +00:00
Chris Lattner
97e52e4336 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:27:06 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
b9ddce65c2 Eliminate the PromoteInstance class, incorporating it into the PromotePass
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2375 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:12:38 +00:00
Chris Lattner
0adb9f95ea Eliminate visited, CurrentValue, and WriteSets as instance variables of
PromoteInstance.  Make them local variables that are passed around as
appropriate.  Especially in the case of CurrentValue, this makes the
code simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2374 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 18:54:01 +00:00
Chris Lattner
5b5df1747f * Fix bug: test/Regression/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll
* Minor cleanup that was missed in last patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2373 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 18:39:46 +00:00
Chris Lattner
9f4eb01dd4 This huge changeset is a strictly cleanup change
Bugfixes will come in the next revision so that the diff is obvious.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2372 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 18:27:55 +00:00
Chris Lattner
1b7f7dc4b4 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:21:30 +00:00
Chris Lattner
100d6daca4 Be careful not to make "external" function internal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2363 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 05:48:34 +00:00
Chris Lattner
dbb1735673 Initial checkin of new "Internalize" pass for GCCLD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2362 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 05:43:27 +00:00
Chris Lattner
d80e973cec Initial checkin of simple&fast SSA based GCSE algorithm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2338 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 00:47:11 +00:00
Chris Lattner
a298d27808 Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
const BasicBlocks


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 06:56:12 +00:00
Chris Lattner
f2361c5e5c Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2332 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 03:15:45 +00:00
Chris Lattner
8e343330a5 * Change Constant::getNullConstant to Constant::getNullValue
* Add support for pool allocating array allocations of varying size


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2329 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:29:32 +00:00
Chris Lattner
1a18b7cf80 Change Constant::getNullConstant to Constant::getNullValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:25:14 +00:00
Chris Lattner
7b5577b371 Programs that actually free memory were broken
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2307 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 22:11:30 +00:00
Chris Lattner
0154505ab7 Add a fixme so that we don't forget this is broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2298 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 18:52:03 +00:00
Chris Lattner
dd841aeb8d Significantly rework InstructionCombining to work better and to be cleaner.
We now use an InstVisitor to delegate to different cases that we are
interested in handling.  We also fix the FIXME's by adding users to the
worklist when appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2292 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 17:39:14 +00:00
Chris Lattner
2a632551a7 Convert SCCP over to use InstVisitor instead of hand crafted switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2286 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 15:13:15 +00:00
Chris Lattner
6428a27ee3 GEP instructions can never be constant propogated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2284 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 14:44:13 +00:00
Chris Lattner
27e3420ce9 Store instructions always return void, so they never get a name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2283 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 14:43:54 +00:00
Chris Lattner
3b87167ac4 Correctly transform dependant arguments, allowing the perimeter bm to work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2282 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 14:43:30 +00:00
Chris Lattner
4a94a70250 Add casts for documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2272 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-16 22:10:52 +00:00
Chris Lattner
169bffe28a * Clean up the code a bit
* Allow structs with negative offsets.  This enables the em3d benchmark to
  be made typesafe.  In this case, the struct had an array as the first
  element, so a negative index was ok (the expr was -8 + 8x)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2271 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-16 22:10:36 +00:00
Chris Lattner
09b9212b6e run an extra pass after a function has been transformed to eliminate
obviously duplicate loads of the pool base.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2255 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 22:42:23 +00:00
Chris Lattner
8d70cd9607 Eliminate cast of same type instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2251 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 19:45:29 +00:00
Chris Lattner
649f5dd77a * s/Method/Function
* Fix bug where the character after a % was being discarded


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2248 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-14 06:15:24 +00:00
Chris Lattner
3e0e520728 Turn off debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2247 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-14 06:14:41 +00:00
Chris Lattner
441d25a9f6 * Allow datasize to be specified on the commandline
* Build new datatypes correctly
* Transform instructions that return null pointers from functions to return
  a null index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2244 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-13 23:13:18 +00:00
Chris Lattner
ddcbd34f56 * Give alloca's for pool descriptors better names than "pool<n>".
* Fill in the pool descriptor links in the pool descriptors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2239 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-13 19:52:54 +00:00
Chris Lattner
027a6755f8 * Add names to the symbol table for pool types and modified types
* Handle more complex structure so that power works almost
* Fix bug with pooldestroy call where we passed in the size of the object
  instead of the pool to destroy.  bisort is now pool allocated successfully!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2238 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-13 19:25:57 +00:00
Chris Lattner
5146a7ddd4 Implement function rewriting to use offsets instead of pointers in programs.
This now works with treeadd at least, and perhaps other programs as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2233 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-12 20:23:15 +00:00
Chris Lattner
265b083e84 * Add documentation
* Split the CleanGCC pass into two passes, a global pass and an IP pass.
  Before it was just a global pass, but it did illegal things to the
  module, which broke other passes that were being scheduled with it by
  gccld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2224 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-10 20:33:11 +00:00
Chris Lattner
ca180c7ca3 Implement TODO, fixing bug:
test/Regression/Transforms/LevelRaise/2002-04-09-MissedRaise.ll


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2209 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:08:28 +00:00
Chris Lattner
42a412711c Add #includes to make up for #includes pruned out of header files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2207 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 18:37:46 +00:00
Chris Lattner
237e6d10f2 s/Method/Function
Remove extraneous #includes of llvm/Assembly/Writer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2178 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 22:03:00 +00:00
Chris Lattner
968ddc921e ConstantHandling moved into VMCore library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2165 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 20:18:09 +00:00
Chris Lattner
87182ae6ba Eliminate explicit use of Writer library, using debug dump output instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 22:31:23 +00:00
Chris Lattner
2fbfdcffd3 Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 20:49:59 +00:00
Chris Lattner
2aac6bf66a s/MethodType/FunctionType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2115 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 22:19:18 +00:00
Chris Lattner
61f64f9b6a PATypeHolder is now not a template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2106 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:24:34 +00:00
Chris Lattner
f8285d4d8f Allow scalars that point to multiple nodes when building the scalar map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2087 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 01:26:53 +00:00
Chris Lattner
f7196949bb Add extra case here to avoid getting spurious output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2086 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:45:33 +00:00
Chris Lattner
9acfbeeaa8 Add debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2066 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:17:46 +00:00
Chris Lattner
072d3a0224 * Catch and ignore (for now) return instructions in tranformed functions
* Add more debugging output
* Fix problems refering to wrong versions of various graphs
* Build the pool descriptor map!
* Clear the nodemapping map after building pool descriptor to avoid assert
* Transform the NEw function body, not the old one...
* Matrix.ll now works!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2058 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 20:53:14 +00:00
Chris Lattner
cfb5f4ce2e * Clean up data structures [AllocDSNode -> DSNode]
* TransformFunctionInfo now has call field form field mapping.  May be
  removed in the future.
* Moved the computation of "Scalars" into transformFunctionBody so
  transformFunction didn't have to recompute it.
* Implement the node mapping calculation in preparation to calculate
  PoolDescriptors to pass to transformFunctionBody
* Print out the node mapping [it looks right!]
* Other minor changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2056 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 09:12:35 +00:00
Chris Lattner
4c7f3dfeaa Maintain enough information so that the pools for all of the nodes of
the graph can be passed around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2053 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 04:02:31 +00:00
Chris Lattner
9d3493e533 Implement the first batch of transformations to the methods. So far it:
* Converts malloc instructions to poolalloc
 * Converts free instructions to poolfree
 * Convert calls to call the new cloned hacked up versions

Note that this does not modify hacked up stuff yet, just the top level
function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2052 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 21:25:19 +00:00
Chris Lattner
a744451856 Correctly clone the function with the extra argument types. Now we need
to modify the function next.

This also properly recycles functions so that we don't get exponential
code blowup in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2049 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:05:48 +00:00
Chris Lattner
f40b4792eb s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2048 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:04:45 +00:00
Chris Lattner
fa703a4ae5 New clone function routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2045 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:03:54 +00:00
Chris Lattner
d250f4294e Find out which calls in the function we need to transform and how.
Next step is to start hacking functions up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2044 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 17:13:46 +00:00
Chris Lattner
dc89f87d52 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2043 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 17:08:29 +00:00
Chris Lattner
9d89190434 Modularize code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2040 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 06:21:38 +00:00
Chris Lattner
54ce13f983 Implement the first step of pool allocation - Creating, initialization, and
destruction of the pools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2039 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 05:50:20 +00:00
Chris Lattner
6bfd6a578a s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2034 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:44:36 +00:00
Chris Lattner
89851077da Simplify code a bit by using Module::getOrInsertFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2032 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:43:24 +00:00
Chris Lattner
d2d3a16641 Flesh out a bunch more code, print allocations that are poolable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2031 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:40:59 +00:00
Chris Lattner
a637859c71 s/method/function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2030 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:40:25 +00:00
Chris Lattner
0d461f7f09 s/Method/Function/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2029 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:39:36 +00:00
Chris Lattner
be591a78cf Simplify code a lot by using the Module::getFunction & getOrInsertFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2028 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:38:05 +00:00
Chris Lattner
bda28f7c2a Initial checkin of Noop pass that will be the pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 18:08:31 +00:00
Cameron Buschardt
b1be061a76 * Move classes around
* rename constructor function
* Move stuff into anonymous namespaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2007 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 23:28:40 +00:00
Cameron Buschardt
98a37c2b9c Implemented promote mem->reg pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2005 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 23:17:37 +00:00