Commit Graph

940 Commits

Author SHA1 Message Date
Chris Lattner
72035995d5 Pass the callgraph not the module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 21:52:26 +00:00
Chris Lattner
a10df50282 Add the ability for SCC passes to initialize and finalize themselves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 21:30:06 +00:00
Chris Lattner
45a1cf87d4 It's not just a printer, it's actually an analysis too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:42:32 +00:00
Chris Lattner
446b86d381 Remove code to update loop depths
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13058 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:02:09 +00:00
Chris Lattner
85661d0978 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:45:27 +00:00
Chris Lattner
343c0cfa19 Fix computation of exit blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:21:41 +00:00
Chris Lattner
f1ab4b4eac Change the ExitBlocks list from being explicitly contained in the Loop
structure to being dynamically computed on demand.  This makes updating
loop information MUCH easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:14:10 +00:00
Chris Lattner
3048bd1d3e Implement method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 06:54:48 +00:00
Chris Lattner
24199db80e Add a new method, add a check missing that caused a segfault if a loop didn't
have a canonical indvar


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13032 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 05:38:05 +00:00
Chris Lattner
3221ad0db7 Add the ability to compute exit values for complex loop using unanalyzable
operations.  This allows us to compile this testcase:

int main() {
        int h = 1;
         do h = 3 * h + 1; while (h <= 256);
        printf("%d\n", h);
        return 0;
}

into this:

int %main() {
entry:
        call void %__main( )
        %tmp.6 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]*  %.str_1, long 0, long 0), int 364 )        ; <int> [#uses=0]
        ret int 0
}

This testcase was taken directly from 256.bzip2, believe it or not.

This code is not as general as I would like.  Next up is to refactor it
a bit to handle more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13019 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 22:58:41 +00:00
Chris Lattner
7980fb9007 Add the ability to compute trip counts that are only controlled by constants
even if the loop is using expressions that we can't compute as a closed-form.
This allows us to calculate that this function always returns 55:

int test() {
  double X;
  int Count = 0;
  for (X = 100; X > 1; X = sqrt(X), ++Count)
    /*empty*/;
  return Count;
}

And allows us to compute trip counts for loops like:

        int h = 1;
         do h = 3 * h + 1; while (h <= 256);

(which occurs in bzip2), and for this function, which occurs after inlining
and other optimizations:

int popcount()
{
   int x = 666;
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}

We still cannot compute the exit values of result or h in the two loops above,
which means we cannot delete the loop, but we are getting closer.  Being able to
compute a constant trip count for these two loops will allow us to unroll them
completely though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13017 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 18:36:24 +00:00
Brian Gaeke
c598517c24 Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
Debian.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 15:57:32 +00:00
Chris Lattner
92020faa2c add some helpful methods. Rearrange #includes to proper order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12960 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:16:02 +00:00
Chris Lattner
0a7f98c80d Factor a bunch of classes out into a public header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12958 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:07:24 +00:00
Chris Lattner
0aa84fdd04 Unbreak the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12956 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 14:17:43 +00:00
Chris Lattner
e9fc96e7cc Implement a FIXME: if we're going to insert a cast, we might as well only
insert it once!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 22:01:22 +00:00
Chris Lattner
16011e6201 This is a trivial tweak to the addrec insertion code: insert the increment
at the bottom of the loop instead of the top.  This reduces the number of
overlapping live ranges a lot, for example, eliminating a spill in an important
loop in 183.equake with linear scan.

I still need to make the exit comparison of the loop use the post-incremented
version of this variable, but this is an easy first step.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12952 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 21:11:25 +00:00
Chris Lattner
46758a894f Add some methods that are useful for updating loop information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 20:26:17 +00:00
Chris Lattner
b81c021f14 Change the call graph class to have TWO external nodes, making call graph
SCC passes much more useful.  In particular, this should fix the incredibly
stupid missed inlining opportunities that the inliner suffered from.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12860 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:36:32 +00:00
Chris Lattner
7512c08bfd Hrm, operator new and new[] do not belong here. We should not CSE them! :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:16:42 +00:00
Chris Lattner
bec63d606f operator new & operator new[] do not kill any legal memory locations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12833 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 18:16:34 +00:00
Chris Lattner
65585aa3fc Allow clients to be more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12831 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 16:43:07 +00:00
Chris Lattner
b903fc5c1b Add a couple of more functions that cannot access memory (the intrinsics) and
don't write to memory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 06:55:27 +00:00
Chris Lattner
627018b4b3 Fix a bug Brian found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 16:16:11 +00:00
Chris Lattner
ea9e005ce6 Sparc don't got not "sqrtl", bum bum bum
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12670 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:05:15 +00:00
Misha Brukman
bb2aff1e18 Kill warnings during an optimized compile where assert() disappears.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12669 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:00:46 +00:00
Chris Lattner
ddd947f21a Fix PR312 and IndVarsSimplify/2004-04-05-InvokeCastCrash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12668 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 18:46:55 +00:00
Chris Lattner
28977af72a Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12653 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:30:19 +00:00
Chris Lattner
5da80974c0 Implement test/Regression/Transforms/GCSE/undefined_load.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12641 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 00:45:16 +00:00
Chris Lattner
e34c0b48a0 Add a break in the default case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12639 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 00:43:03 +00:00
Chris Lattner
9687845800 Remove obsolete files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12633 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:56:24 +00:00
Chris Lattner
d18d9dcd28 Comment out debugging printouts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12623 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:26:46 +00:00
Chris Lattner
53e677abad Add a new analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12619 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:23:17 +00:00
Chris Lattner
fc33d30446 Add some new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12539 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 00:20:08 +00:00
Chris Lattner
db81395452 Adjust to new itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 20:42:49 +00:00
Chris Lattner
698c4a4bbb Minor efficiency improvement, finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12517 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-25 22:56:03 +00:00
Chris Lattner
4781bc7142 Fix a HORRIBLY NASTY bug that caused siod to stop working last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12479 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 23:22:04 +00:00
Chris Lattner
002be76733 Add some missing functions. Make sure to handle calls together in case the
client has another VN implementation that can VN calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12427 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 03:41:35 +00:00
Chris Lattner
fcead4f426 Ok, the assertion was bogus. Calls that do not read/write memory should not
have an alias set, just like adds and subtracts don't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:28:07 +00:00
Chris Lattner
df209fcc7e This assertion is bogus now that calls do not necessarily read/write memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12421 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:24:15 +00:00
Chris Lattner
5a6e947f1d Implement CSE of call instructions in the most trivial case. This implements
GCSE/call_cse.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12419 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 05:44:59 +00:00
Chris Lattner
bbcc147220 Fix a minor bug, implementing GCSE/call_pure_function.ll
Also, add some stuff I missed before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12417 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:18:28 +00:00
Chris Lattner
5b5f7c11d0 Don't be COMPLETELY pessimistic in the face of function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12413 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:08:36 +00:00
Chris Lattner
992860c44e Deinline some virtual methods, provide better mod/ref answers through the
use of the boolean queries


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12410 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:07:29 +00:00
Chris Lattner
b79d79297d Pass through the boolean queries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12409 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:06:46 +00:00
Chris Lattner
4244bb5bbd Teach basicaa about some stdc functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12408 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 03:36:49 +00:00
Chris Lattner
a2dc727ac4 DemoteRegToStack got moved from DemoteRegToStack.h to Local.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 02:13:38 +00:00
Chris Lattner
cc7c4acffa Fix a tiny bug that caused an incorrect assertion failure poolallocating
boxed-sim.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-13 01:14:23 +00:00
Chris Lattner
317201d773 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-13 00:24:00 +00:00
Chris Lattner
7a82ba0510 Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12351 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 23:12:55 +00:00
Chris Lattner
04b7593546 Implement mod/ref analysis for a trivial case where locals don't escape.
This comes up when you have a local array on the stack and you never pass
the address of elements around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12349 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 22:39:00 +00:00
Misha Brukman
85f5e11c06 Simplify code to process CallSites (thanks to Chris).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12334 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 16:20:49 +00:00
Misha Brukman
bc1dbe95b8 Evaluate ModRef information in addition to regular ol' pointer analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12331 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 06:15:08 +00:00
Misha Brukman
a975a9ab80 Implement getModRefInfo() for DSA to calculate whether a function modifies or
references a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12330 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 06:14:22 +00:00
Misha Brukman
56c0fa69a3 Make code more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12305 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 00:58:41 +00:00
Chris Lattner
c6b0c4b9e2 Fix PR284: [indvars] Induction variable analysis violates LLVM invariants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-10 21:42:19 +00:00
Chris Lattner
85fb1be62f implement new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-09 19:37:06 +00:00
Chris Lattner
96ab5caf2d Switch to using edge profiling information as the basic source of profile info
from using basic block counts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 22:04:08 +00:00
Chris Lattner
62e84f376b Refactor implementations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12240 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 21:30:35 +00:00
Chris Lattner
6ba8972919 Import the trace class from the reoptimizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12236 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 20:57:27 +00:00
Chris Lattner
dbbbfef165 If we have edge counts, we can produce block counts. I've verified that
using an edge profile to produce block counts gives the exact same numbers
as using a block count directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12232 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 20:03:52 +00:00
Chris Lattner
01945c1739 Add initial support for reading edge counts. This will be improved to enable
translation of edge counts into block/function counts when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12229 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 18:20:18 +00:00
Chris Lattner
d84d3501c6 Fix a bug handling globals that are constants, but are still external
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12208 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 03:52:24 +00:00
Chris Lattner
deb8712b49 Fix a minor bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12169 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-05 22:04:07 +00:00
Misha Brukman
a5f2905c71 Unbreak the build on Sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-05 20:04:40 +00:00
Chris Lattner
4ab483c6ad Fix a bug in a previous checkin that broke 175.vpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12128 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 21:36:57 +00:00
Chris Lattner
3aeb40cadb Add support for strto* and v*printf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12127 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 21:03:54 +00:00
Chris Lattner
6b3e3ccf73 Add non-crappy support for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12126 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 20:33:47 +00:00
Chris Lattner
e6e93ccd0c Implement a FIXME, improving the efficiency of DSA on povray.
This reduces CBU time from 145s -> 122s (debug build), reduces # allocated nodes
from 129420 to 116477.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12125 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 19:47:04 +00:00
Chris Lattner
da5c5a5b95 Speed up the cbu pass from taking somewhere near the age of the universe to about 90s on povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12123 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 19:16:35 +00:00
Chris Lattner
f590ced5c5 Fix BU datastructures with povray!
The problem was that we were merging a field of a node with a value that was
deleted.  Thanks to bugpoint for reducing povray to a nice small 3 function
example.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12116 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 17:06:53 +00:00
Chris Lattner
16437ff705 Minor changes, remove some debugging code that got checked in somehow.
Make sure to scope the NodeMap passed into cloneInto so that it doesn't point
to nodes that are deleted.  Add some FIXME's for future performance enhancements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12115 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 17:05:28 +00:00
Chris Lattner
2f3469013e Only clone nodes that are needed in the caller, don't clone ALL aux calls. This improves
povray from having ~600K nodes and 300K call nodes to 65K nodes and 25K call nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 03:57:53 +00:00
Chris Lattner
76a9eb3e40 Fix a minor bug handling incomplete programs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12105 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-03 23:00:19 +00:00
Chris Lattner
c4ebdcea7a Fix a DSA bug that caused DSA to generate incredibly huge graphs and take forever to
do it on povray.  The problem is that we were not copying globals from callees to
callers unless the existed in both graphs.  We should have copied them in the case
where the global pointed to a node that was copied as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12104 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-03 22:01:09 +00:00
Chris Lattner
2c7725abb4 Deinline methods, add fast exit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12102 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-03 20:55:27 +00:00
Chris Lattner
b1aaeee48a Fix a node mapping problem that was causing the pool allocator to locally allocate
nodes that were globally live, thus breaking programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12094 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-03 05:34:31 +00:00
Chris Lattner
7252939af0 FINALLY be able to get symbolic type names in the globals graph!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12082 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-02 21:39:43 +00:00
Chris Lattner
a19ba52596 Really, only if reopen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12080 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-02 20:46:18 +00:00
Chris Lattner
82e9d7224e Correctly add an array marker on a node when appropriate!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-01 19:02:54 +00:00
Chris Lattner
2d6a6aa137 Expand on my note-to-self
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12029 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-01 02:44:44 +00:00
Misha Brukman
99cc88bb64 * Remove function to find "main" in a Module, there's a method for that
* Removing extraneous empty space and empty comment lines


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12014 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-29 23:09:10 +00:00
Chris Lattner
0321b68f6b Only clone global nodes between graphs if both graphs have the global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-27 20:05:15 +00:00
Chris Lattner
6b586df328 ADD MORE FUNCTIONS!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11927 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-27 20:04:48 +00:00
Chris Lattner
cb582406dd Be a good little compiler and handle direct calls efficiently, even if there
are beastly ConstantPointerRefs in the way...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-26 22:07:22 +00:00
Chris Lattner
af6926a382 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-26 03:45:03 +00:00
Chris Lattner
abcdf80ec6 The node doesn't have to be _no_ node flags, it just has to be complete and
not have any globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11863 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-26 03:43:43 +00:00
Chris Lattner
1fe9874d15 Add _more_ functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-26 03:43:08 +00:00
Chris Lattner
cf14e71c5e Two changes:
1. Functions do not make things incomplete, only variables
 2. Constant global variables no longer need to be marked incomplete, because
    we are guaranteed that the initializer for the global will be in the
    graph we are hacking on now.  This makes resolution of indirect calls happen
    a lot more in the bu pass, supports things like vtables and the C counterparts
    (giant constant arrays of function pointers), etc...

Testcase here: test/Regression/Analysis/DSGraph/constant_globals.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-25 23:36:08 +00:00
Chris Lattner
c420ab6c25 When building local graphs, clone the initializer for constant globals into each
local graph that uses the global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11850 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-25 23:31:02 +00:00
Chris Lattner
51c06abbf1 Simplify the dead node elimination stuff
Make the incompleteness marker faster by looping directly over the globals
instead of over the scalars to find the globals

Fix a bug where we didn't mark a global incomplete if it didn't have any
outgoing edges.  This wouldn't break any current clients but is still wrong.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11848 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-25 23:08:00 +00:00
Chris Lattner
52fc8d7ec9 Add a bunch more functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11847 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-25 23:06:40 +00:00
Chris Lattner
153f24070c Try harder to get symbol info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11846 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-25 23:06:30 +00:00
Chris Lattner
adc1efe81c Add a bunch more functions used by perlbmk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11824 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-25 17:43:20 +00:00
Chris Lattner
39bb2dc557 Add support for 'rename'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-24 22:17:00 +00:00
Chris Lattner
d561209a47 Add support for remove, fwrite, and fread
Also fix problem where we didn't check to see if a node pointer was null.
Though fclose(null) doesn't make a lot of sense, 300.twolf does it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-24 22:02:48 +00:00
Chris Lattner
e735b2de30 Fix a soon-to-be-missing #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 06:26:17 +00:00
Chris Lattner
0ad9170327 Use isNull instead of getNode() to test for existence of a node, this is cheaper.
FIX MAJOR BUG, whereby we didn't merge null edges correctly. Correcting this
fixes poolallocation on 175.vpr, and possibly others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11695 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 00:53:54 +00:00
Chris Lattner
d85645f526 Fix an iterator invalidation problem which was causing some nodes to not be
correctly merged over!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11693 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 22:28:26 +00:00
Chris Lattner
5171115cf3 Use handy method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 22:27:31 +00:00