Commit Graph

17835 Commits

Author SHA1 Message Date
Chris Lattner 040426aee0 Fix a major problem where we didn't add call graph edges for call sites with
more than 1 callee.  This fixes Analysis/DSGraph/FunctionPointerTable-const.ll

llvm-svn: 20740
2005-03-21 20:20:49 +00:00
Chris Lattner 032b364fc4 New testcase, which is important to handle correctly.
llvm-svn: 20739
2005-03-21 20:18:51 +00:00
Misha Brukman 82ae9e1dda We may be adding functions to the Module during initialization, so
conservatively, it's modified

llvm-svn: 20735
2005-03-21 19:22:14 +00:00
Chris Lattner bad17144d0 This error message changed.
llvm-svn: 20734
2005-03-21 17:55:41 +00:00
Chris Lattner e8a43291cd Ugh, for some reason, I can't call this unless the reference is const!?!?!?
llvm-svn: 20732
2005-03-21 10:00:45 +00:00
Chris Lattner 13429dc5af The reachability cloner should add arguments to merged calls when the RHS of
the merge has more operands than the LHS.

llvm-svn: 20731
2005-03-21 09:39:51 +00:00
Chris Lattner aa32b37885 Make the first operand of this method be modifiable.
llvm-svn: 20730
2005-03-21 09:39:20 +00:00
Chris Lattner 8632462267 add a method
llvm-svn: 20729
2005-03-21 09:38:39 +00:00
Chris Lattner 5204115d09 If merging two calls like: foo(A) and bar(B, C), make sure the result has two
arguments, not one.

llvm-svn: 20728
2005-03-21 09:18:39 +00:00
Chris Lattner 7269f15e8f 'note to self'
llvm-svn: 20727
2005-03-21 08:43:32 +00:00
Chris Lattner a5f4b773d9 Remove a bunch of cruft and dead code for handling the case when types were
defined in function constant pools.  The assembler grammar has long
disallowed functions from having constant pools, so all of this stuff is
dead.

This makes it an immediate error for functions to refer to nonexisting
types, fixing Regression/Verifier/2005-03-21-UndefinedTypeReference.ll.

Before, references to non-existing types in functions would only be
detected when the subsequent function was parsed, due to the call to
"ResolveTypes".  "ResolveTypes" has not resolved any types for a long time,
instead it emitted an error message if no resolved types are left.  Since
the only caller of this method is in the module code, just inline it.

llvm-svn: 20726
2005-03-21 06:27:42 +00:00
Chris Lattner a825b14278 New testcase that the assembler incorrectly accepts.
llvm-svn: 20725
2005-03-21 06:24:53 +00:00
Tanya Lattner 87ee2ba48d Make this method non-const. Making it const causes the const version of
getIGroup to be called instead of the non-const one.  These two methods
have (??) different behavior, so this change fixes bugs.

llvm-svn: 20724
2005-03-21 06:07:43 +00:00
Chris Lattner 98f7e1c370 Change the way that the TD pass inlines graphs. Instead of inlining each
graph into all of the functions it calls when we visit a graph, change it so
that the graph visitor inlines all of the callers of a graph into the current
graph when it visits it.

While we're at it, inline global information from the GG instead of from each
of the callers.  The GG contains a superset of the info that the callers do
anyway, and this way we only need to do it one time (not one for each caller).

This speeds up the TD pass substantially on several programs, and there is
still room for improvement.  For example, the TD pass used to take 147s
on perlbmk, it now takes 36s.  On povray, we went from about 5s to 1.97s.
134.perl is down from ~1s for Loc+BU+TD to .6s.

The TD pass needs a lot of improvement though, which will occur with later
patches.

llvm-svn: 20723
2005-03-21 04:55:35 +00:00
Chris Lattner 6a67d4a804 rename a method add a data structure.
llvm-svn: 20722
2005-03-21 04:46:35 +00:00
Chris Lattner c8b4b7e314 Provide a guaranteed definition of intptr_t. Thansk to Evan Jones for
pointing this out!

llvm-svn: 20721
2005-03-21 01:36:35 +00:00
Chris Lattner c5cdc2260d Don't strip modref bits when inlining down the call graph. This fixes
the DSGraph/2003-06-30-TopDownResolve.ll regression from last night.

llvm-svn: 20717
2005-03-20 18:02:56 +00:00
Chris Lattner 21ef7678d6 Remove the ability to keep track of inlined globals, which is always dead.
llvm-svn: 20716
2005-03-20 04:30:30 +00:00
Chris Lattner 6abefe7639 Remove the InlinedGlobals set which is always empty.
llvm-svn: 20715
2005-03-20 04:30:16 +00:00
Chris Lattner 571c62a008 This call is always a noop, remove it.
llvm-svn: 20714
2005-03-20 04:29:54 +00:00
Chris Lattner b1cabb6541 remove some pointless asserts
llvm-svn: 20713
2005-03-20 04:29:39 +00:00
Chris Lattner ded489ec3b -steens doesn't use the inlined globals facility.
llvm-svn: 20712
2005-03-20 04:23:57 +00:00
Chris Lattner ff634f4e32 Build EC's for globals twice. The first is after constructing the initial
Globals Graph for the local pass, the second is after all of the locals
graphs have been constructed.  This allows for many additional global EC's
to be recognized that weren't before.  This speeds up analysis of programs
like 177.mesa, where it changes DSA from taking 0.712s to 0.4018s.

llvm-svn: 20711
2005-03-20 03:32:35 +00:00
Chris Lattner 36a810ac40 Add a new DSNode::removeGlobal method.
llvm-svn: 20710
2005-03-20 03:29:54 +00:00
Chris Lattner 0ebba657df add a method
llvm-svn: 20709
2005-03-20 03:29:39 +00:00
Chris Lattner 5ae215248f Transform BU pass to not use the horrible DSCallSiteIterator class.
llvm-svn: 20708
2005-03-20 02:42:07 +00:00
Chris Lattner a550a5b173 Implement new methods for dealing with DSNode global lists, rename uses of
old methods.

llvm-svn: 20707
2005-03-20 02:41:38 +00:00
Chris Lattner e68e808bcd use simpler methods.
llvm-svn: 20706
2005-03-20 02:41:16 +00:00
Chris Lattner 1ffdd57e0a method was renamed.
llvm-svn: 20705
2005-03-20 02:40:27 +00:00
Chris Lattner 5635a88fcb print out equiv class info.
llvm-svn: 20704
2005-03-20 02:40:11 +00:00
Chris Lattner e7a8e8677e some methods got renamed
llvm-svn: 20703
2005-03-20 02:40:04 +00:00
Chris Lattner 711e083c26 Make use of simpler DSNode methods.
llvm-svn: 20702
2005-03-20 02:39:49 +00:00
Chris Lattner 9991eeb575 rename some methods and add some new methods for dealing with the globals list
in a DSNode.

llvm-svn: 20701
2005-03-20 02:38:39 +00:00
Chris Lattner 61f3befdc8 #ifdef out a function only used by #ifdef'd code.
llvm-svn: 20700
2005-03-20 02:14:15 +00:00
Chris Lattner e965bd16bb comment cleanup
llvm-svn: 20699
2005-03-20 01:18:00 +00:00
Misha Brukman 42f1cfd637 Constant-propagate the value of `isL' variable and eliminate it.
llvm-svn: 20698
2005-03-19 23:39:50 +00:00
Jeff Cohen f4ab9e5965 Silence VC++ warning about mixing intptr_t and bool, and about unused variable isL.
llvm-svn: 20697
2005-03-19 22:36:39 +00:00
Chris Lattner 9379e69af9 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.

llvm-svn: 20696
2005-03-19 22:23:45 +00:00
Chris Lattner 4037048300 Make each scalar map contain a reference to an equivalence class of global
variables.  Do not insert a global into the scalar map unless it is the
leader of its equivalence class.

llvm-svn: 20695
2005-03-19 22:13:13 +00:00
Chris Lattner 1ce80fb008 Each DS collection now contains an equivalence class of globals values.
llvm-svn: 20694
2005-03-19 22:12:33 +00:00
Chris Lattner 6c5b90f36c add a method to clear globals from a node
llvm-svn: 20693
2005-03-19 22:12:03 +00:00
Chris Lattner 300dc0bc90 Two fixes for the copy ctor/operator=:
1. Make sure to clear() 'this' before adding elements to it
  2. Make sure that the leaders of the RHS EC are the leaders of the LHS EC.

llvm-svn: 20692
2005-03-19 21:02:12 +00:00
Chris Lattner 325f234d79 add some methods, fix a major bug in getLeader() that was causing things to
not be unified correctly.

llvm-svn: 20691
2005-03-19 20:42:43 +00:00
Chris Lattner e6364c2702 implement a proper copy ctor, operator= and add a helper method.
llvm-svn: 20690
2005-03-19 19:26:14 +00:00
Chris Lattner 484bfc4d26 Fix the 3 regressions last night, due to my buggy patch from yesterday.
llvm-svn: 20689
2005-03-19 17:35:11 +00:00
Alkis Evlogimenos 9160d5fd8b Add new function getPtrPtrFromArrayPtr().
llvm-svn: 20684
2005-03-19 11:40:31 +00:00
Alkis Evlogimenos 1a48561432 Stop using deprecated interface.
llvm-svn: 20679
2005-03-19 09:22:17 +00:00
Chris Lattner c1b9b56a2c 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.

llvm-svn: 20678
2005-03-19 05:15:27 +00:00
Chris Lattner c3256647e7 Rewrite this class, making the following improvements:
1. It now actually uses tarjan's algorithm, so it is a efficient inverse
     ackerman's function for union operations, not linear time.
  2. It now stores one copy of the data in the set instead of two.
  3. It now works for elements other than pointers.
  4. It now has a more STL-like interface that exposes iterators instead
     of internal implementation details.

llvm-svn: 20677
2005-03-19 05:14:29 +00:00
Chris Lattner bed1c18a44 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.

llvm-svn: 20676
2005-03-18 23:19:47 +00:00