Commit Graph

9529 Commits

Author SHA1 Message Date
Chris Lattner
48427b539f comment cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20699 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 01:18:00 +00:00
Chris Lattner
f4f6227989 Create an equivalence class of global variables that DSA will never be able
to tell apart anyway, and only track the leader for of these equivalence
classes in our graphs.

This dramatically reduces the number of GlobalValue*'s that appear in scalar
maps, which A) reduces memory usage, by eliminating many many scalarmap entries
and B) reduces time for operations that need to execute an operation for each
global in the scalar map.

As an example, this reduces the memory used to analyze 176.gcc from 1GB to
511MB, which (while it's still way too much) is better because it doesn't hit
swap anymore.  On eon, this shrinks the local graphs from 14MB to 6.8MB,
shrinks the bu+td graphs of povray from 50M to 40M, shrinks the TD graphs of
130.li from 8.8M to 3.6M, etc.

This change also speeds up DSA on large programs where this makes a big
difference.  For example, 130.li goes from 1.17s -> 0.56s, 134.perl goes
from 2.14 -> 0.93s, povray goes from 15.63s->7.99s (!!!).

This also apparently either fixes the problem that caused DSA to crash on
perlbmk and gcc, or it hides it, because DSA now works on these.  These
both take entirely too much time in the TD pass (147s for perl, 538s for
gcc, vs 7.67/5.9s in the bu pass for either one), but this is a known
problem that I'll deal with later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20696 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 22:23:45 +00:00
Chris Lattner
efd02c750f Fix the 3 regressions last night, due to my buggy patch from yesterday.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20689 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 17:35:11 +00:00
Alkis Evlogimenos
1cecd3a1d2 Add new function getPtrPtrFromArrayPtr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 11:40:31 +00:00
Alkis Evlogimenos
12cf385662 Stop using deprecated interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20679 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 09:22:17 +00:00
Chris Lattner
605a87cc19 Switch to use the new interface for the EquivalenceClasses class, and fix
a bug involving SCC's who have multiple members that are part of an EC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20678 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 05:15:27 +00:00
Chris Lattner
5021b8c2d6 do not bother inlining nullary functions without return values. The only
effect these calls can have is due to global variables, and these passes
all use the globals graph to capture their effect anyway.  This speeds up
the BU pass very slightly on perlbmk, reducing the number of dsnodes
allocated from 98913 to 96423.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 23:19:47 +00:00
Chris Lattner
db7436aae8 fix a bogus assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20675 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 23:18:30 +00:00
Chris Lattner
0c9707a190 another fastpath
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20674 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 23:18:20 +00:00
Chris Lattner
67c2d18166 remove use of getPrev() and getNext() on ilist nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20673 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 16:12:37 +00:00
Chris Lattner
41b162faba expose this pass to both opt and analyze
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20672 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 05:27:57 +00:00
Chris Lattner
4707b895b6 remove a bogus optimization. This only works if there are no globals in the
graph, and the combination of a function that does not reference globals, takes
not arguments and returns no value is pretty rare.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20670 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 00:23:59 +00:00
Chris Lattner
511f60c707 Rewrite DSAA::getModRefInfo to compute the mapping between caller and callee
to determine mod/ref behavior, instead of creating a *copy* of the caller
graph and inlining the callee graph into the copy.

This speeds up aa-eval on Ptrdist/yacr2 from 109.13s to 3.98s, and gives
identical results.  The speedup is similar on other programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20669 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 00:21:03 +00:00
Chris Lattner
4ffe5d8038 implement a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20668 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 23:45:54 +00:00
Chris Lattner
1c8327bd50 add some possibly bogus assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:33:27 +00:00
Chris Lattner
ddc77c458a Do not include the Function* for direct call/invoke instructions in the
alias evaluation.  Clients really don't care.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20664 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:25:04 +00:00
Duraid Madina
37b11a974a typo/denial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20663 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:23:27 +00:00
Chris Lattner
50cb9b40c2 simplify this function a bit, allow DS-AA to build on/improve the mod/ref
results returned by AA, not just use one or the other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20662 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:16:58 +00:00
Chris Lattner
94f8470fe3 Clean up some code, handle null pointer specially to avoid an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20660 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 19:56:56 +00:00
Chris Lattner
2e2cce69bc Two changes:
1. Chain to the parent implementation of M/R analysis if we can't find
     any information.  It has some heuristics that often do well.
  2. Do not clear all flags, this can make invalid nodes by turning nodes
     that used to be collapsed into non-collapsed nodes (fixing crashes)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20659 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 19:56:18 +00:00
Duraid Madina
817aed4fab clean up warnings when building in release mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20658 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 19:00:40 +00:00
Duraid Madina
d0b87b3ede OK, IA64 is statically linked into llc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 18:37:05 +00:00
Duraid Madina
de487f0977 build the IA64 target as a .so for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20654 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 18:29:04 +00:00
Duraid Madina
9b9d45f60e and so it begins...
PHASE 1: write instruction selector
PHASE 2: ???
PHASE 3: profit!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20652 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 18:17:03 +00:00
Chris Lattner
7805fa4acc Don't emit two comparisons when comparing a FP value against zero!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20651 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 16:29:26 +00:00
Chris Lattner
5b3a4553c1 Fix the missing symbols problem Bill was hitting. Patch contributed by
Bill Wendling!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 15:38:16 +00:00
Chris Lattner
ec3f5c4fd7 Do not create ridiculously huge DSNodes, as described in the comments.
This speeds up the BU pass on 172.mgrid from 62.3 -> 0.1242s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20648 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 05:25:34 +00:00
Chris Lattner
c0d0e77042 Fix a bug where we would consider " .99" and "1.0" different because of the
leading whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20647 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 04:49:04 +00:00
Chris Lattner
84b80a214a remove use of compat_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20643 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 22:42:19 +00:00
Misha Brukman
fd67824386 Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20638 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 05:42:00 +00:00
Chris Lattner
c72e57314a fix some 80 column violations
Add support for programs that define main in a .a file, such as f2c'd programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20631 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 23:03:34 +00:00
Chris Lattner
fc82ef6797 consolidate LinkFiles into LinkItems, use lib_* iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20630 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:55:17 +00:00
Chris Lattner
ad988f397d consolidate LinkLibraries into LinkItems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20629 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:51:40 +00:00
Chris Lattner
38065a7e01 make sure to mark nodes in the globals graph incomplete after computing it
so that external globals (and whatever they point to) are marked incomplete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20628 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:47:18 +00:00
Chris Lattner
49e88e80c7 fix crashes when we only have a prototype for main.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:10:04 +00:00
Chris Lattner
4d5af8e894 Fix a crash that happens when mapping something like this:
{ short, short }

to
  short

where the second short maps onto the second field of the first struct.  In
this case, the struct index is not aligned, so we should avoid calling
getLink(2), which asserts out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20626 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 21:36:50 +00:00
Andrew Lenharth
f23e3a2d38 sure, I can set a flag, but if I never check it, why bother setting it? Should fix 20 programs :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20623 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 19:51:19 +00:00
Chris Lattner
36a13cdeea Make computeGGToGMapping compute an invnodemap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20622 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 17:52:18 +00:00
Chris Lattner
2af8c5185a Finally fix (the right way) the problem where functions like this:
void foo() {
  G = 1;
}

would have an empty DSGraph even though G (a global) is directly used
in the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 17:14:09 +00:00
Chris Lattner
a5f47ea23d Start using retnodes_* for iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 16:55:04 +00:00
Chris Lattner
5d85f8f66e avoid varialbe name collisions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20606 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 06:29:12 +00:00
Chris Lattner
feb1550824 stop using method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20603 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 05:19:49 +00:00
Chris Lattner
39220ded94 stop using arg_front
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20599 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 05:03:36 +00:00
Chris Lattner
c5e7df1d60 stop using arg_back
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20598 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:59:17 +00:00
Chris Lattner
e4d5c441e0 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
841957ebaf Don't crash if computing a mapping to a node with zero size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20595 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:40:24 +00:00
Chris Lattner
b0f92e3ed3 rename method, add counterpart
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 00:58:16 +00:00
Andrew Lenharth
ca3d59b1dc FP 0.0 setcc optimization, and generate short branch sequence for setcc(FP) rather than stack usage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20589 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-14 19:23:45 +00:00
Chris Lattner
b2b17bb65b add a method to compute a commonly used mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20588 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-14 19:22:47 +00:00
Chris Lattner
e2bc7b2517 regardless of whether or not the client things we should mark globals incomplete,
ALWAYS mark them incomplete if they are external!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20586 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 20:36:01 +00:00