1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

617 Commits

Author SHA1 Message Date
Chris Lattner
9e6d9d0b72 make sure to mark nodes returned from functions as incomplete
llvm-svn: 20576
2005-03-12 14:58:28 +00:00
Chris Lattner
a4bd8bd9b0 remove this from the PA namespace, leaving it in the llvm ns
llvm-svn: 20574
2005-03-12 12:08:52 +00:00
Chris Lattner
848760c21f Move this from the pool allocator project to here, where it logically belongs.
llvm-svn: 20570
2005-03-12 11:51:30 +00:00
Chris Lattner
05e4fe5ef3 Make sure the two arguments of a setcc instruction point to the same node.
llvm-svn: 20462
2005-03-05 19:04:31 +00:00
Chris Lattner
0864ad52d4 Trivial cleanup patch
llvm-svn: 20436
2005-03-04 20:27:46 +00:00
Chris Lattner
cf3862ce8d Fix spelling, patch contributed by Gabor Greif
llvm-svn: 20342
2005-02-27 06:15:51 +00:00
Chris Lattner
9340ba4bf9 Handle null a bit more carefully.
Actually teach dsa about select instructions.  This doesn't affect the
graph in any way other than not setting a spurious U marker on pointer
nodes that are selected.

llvm-svn: 20324
2005-02-25 01:27:48 +00:00
Chris Lattner
16f321bbe7 This instruction:
X = gep null, ...

Used to not create a scalar map entry for X, which caused clients to barf.
This is bad.

llvm-svn: 20316
2005-02-24 19:55:31 +00:00
Chris Lattner
085b39c9e0 Fix a bug introduced by revision 1.187 of this file.
llvm-svn: 20308
2005-02-24 18:48:07 +00:00
Chris Lattner
c5646b3a15 Add a sanity check.
llvm-svn: 20195
2005-02-15 18:48:48 +00:00
Chris Lattner
e7d2b05fb0 Add a new method to make it easy to update graphs.
llvm-svn: 20194
2005-02-15 18:40:55 +00:00
Chris Lattner
82ef7e89fd Use new edge iterators to simplify some code.
llvm-svn: 20086
2005-02-09 03:20:43 +00:00
Chris Lattner
bfd643f504 IndCallGraphMap is now a pointer to a new'd map.
llvm-svn: 20065
2005-02-07 16:09:15 +00:00
Chris Lattner
43b0441ccb If we have an indirect call site that calls N functions, inline the N functions
into a temporary graph, remember it for later, then inline the tmp graph into
the call site.

In the case where there are other call sites to the same set of functions, this
permits us to just inline the temporary graph instead of all of the callees.

This turns N*M inlining situations into an N+M inlining situation.

llvm-svn: 20036
2005-02-04 19:59:49 +00:00
Chris Lattner
5f8b7b03b0 Split mergeInGraph into two methods.
llvm-svn: 20035
2005-02-04 19:58:28 +00:00
Chris Lattner
48828f062c Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
llvm-svn: 20031
2005-02-04 18:58:04 +00:00
Chris Lattner
15151dbff8 Refactor getFunctionArgumentsForCall out of mergeInGraph.
llvm-svn: 20018
2005-02-03 18:40:25 +00:00
Chris Lattner
56e08cc9a3 Eliminate some duplicated debug code
llvm-svn: 19980
2005-02-01 21:55:40 +00:00
Chris Lattner
57cdba4154 Eliminate self-recursion as a special case.
llvm-svn: 19979
2005-02-01 21:49:43 +00:00
Chris Lattner
b35595d4c0 Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.

llvm-svn: 19978
2005-02-01 21:37:27 +00:00
Chris Lattner
028a8a8f56 Signficantly speed up printing by not emitting the same file twice with
different names.  Large SCC's tend to be big, so this saves a lot of time.

llvm-svn: 19970
2005-02-01 19:10:48 +00:00
Chris Lattner
26d4a4b2d2 Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
llvm-svn: 19968
2005-02-01 17:35:52 +00:00
Chris Lattner
11a25d99d7 Rename variables to work with VC++'s hokey scoping rules.
llvm-svn: 19942
2005-01-31 00:10:58 +00:00
Chris Lattner
86f89c506f Fix some scary bugs that VC++ detected.
llvm-svn: 19941
2005-01-31 00:10:45 +00:00
Chris Lattner
ee6bc42f3e * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.

llvm-svn: 19939
2005-01-30 23:51:02 +00:00
Chris Lattner
fadcc07232 Remove this code as it is currently completely broken and unmaintained.
If needed, this can be resurrected from CVS.

Note that several of the interfaces (e.g. the IPModRef ones) are supersumed
by generic AliasAnalysis interfaces that have been written since this code
was developed (and they are not DSA specific).

llvm-svn: 19864
2005-01-28 06:12:46 +00:00
Chris Lattner
f03b87704f Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
llvm-svn: 19818
2005-01-24 20:00:14 +00:00
Chris Lattner
c9b64b9749 Silence VC++ warnings.
llvm-svn: 19506
2005-01-12 04:51:37 +00:00
Jeff Cohen
f692cd303d Add last four createXxxPass functions
llvm-svn: 19424
2005-01-09 20:42:52 +00:00
Jeff Cohen
6827f061cc Get lib/Analysis/DataStructure to compile with VC++
llvm-svn: 19412
2005-01-09 04:18:28 +00:00
Chris Lattner
31ba7367aa Move method out of line for better ICC support
Add some ifdefs for some stuff I like to be able to toggle easily

llvm-svn: 18665
2004-12-08 21:03:56 +00:00
Chris Lattner
6ebc142507 Work correctly with ICC, Patch contributed by Bjørn Wennberg
llvm-svn: 18630
2004-12-08 16:22:26 +00:00
Reid Spencer
d0d846cd06 For PR387:\
Add getModRefInfo method to avoid overloaded virtuals

llvm-svn: 18601
2004-12-07 08:11:24 +00:00
Reid Spencer
d50c86f078 For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual

llvm-svn: 18589
2004-12-07 04:03:45 +00:00
Chris Lattner
0efef015fa Fix a bug that was preventing povray and namd from pool allocating correctly.
llvm-svn: 17632
2004-11-08 21:08:46 +00:00
Chris Lattner
dcee21898f Handle assert_fail special
llvm-svn: 17631
2004-11-08 21:08:28 +00:00
Chris Lattner
3b6d1045d3 Don't call Constant::getNullValue when the argument could be VoidTy
llvm-svn: 17457
2004-11-03 18:51:26 +00:00
Chris Lattner
8572d582cf Fix comment
llvm-svn: 17377
2004-10-31 21:54:51 +00:00
Chris Lattner
d72b6b1e77 Improve comment
llvm-svn: 17375
2004-10-31 19:57:43 +00:00
Chris Lattner
14d85c9b09 Add more paranoid assertions :)
llvm-svn: 17367
2004-10-31 17:45:40 +00:00
Chris Lattner
29b6259de3 Fix some more problems where we called getOffset before getNode()
llvm-svn: 17358
2004-10-30 07:21:19 +00:00
Chris Lattner
4b741eab69 Fix three bugs:
1. Calls to external global VARIABLES should not be treated as a call to an
    external function
 2. Efficiently deleting an element from a vector by using std::swap with
    the back, then pop_back is NOT a good way to keep the vector sorted.
 3. Our hope of having stuff get deleted by making them redundant just won't
    work.  In particular, if we have three calls in sequence that should be
    merged: A, B, C   first we unify B into A.  To be sure that they appeared
    identical (so B would be erased) we set B = A.  On the next step, we
    unified C into A and set C = A.  Unfortunately, this is no guarantee that
    C = B, so we would fail to delete the dead call.  Switch to a more
    explicit scheme.

llvm-svn: 17357
2004-10-30 05:41:23 +00:00
Chris Lattner
14dfc01ad5 Fix more undefined behavior
llvm-svn: 17356
2004-10-30 04:22:45 +00:00
Chris Lattner
c17cd85776 * Add a method
* change some uses of NH.getNode() in a bool context to use !NH.isNull()
* Fix a bunch of places where we depended on the (undefined) order of
  evaluation of arguments to function calls to ensure that getNode() was
  called before getOffset().  In practice, this was NOT happening.

llvm-svn: 17354
2004-10-30 04:05:01 +00:00
Alkis Evlogimenos
1162280a0d Fix library name.
llvm-svn: 17306
2004-10-28 05:36:48 +00:00
Chris Lattner
3a79669263 add support for UndefValue
llvm-svn: 17260
2004-10-26 16:23:03 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
8d479b62ad Add support for undef
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Reid Spencer
e6418ec30f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
bc135b067a Build both archive and relinked objects
llvm-svn: 16892
2004-10-10 22:17:39 +00:00
Reid Spencer
7d9cba7a0f Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Chris Lattner
d15e144241 Fix a nasty dangling pointer problem, due to a free'd pointer being left in
a map.  This caused problems if a later object happened to be allocated at
the free'd object's address.

llvm-svn: 16813
2004-10-07 20:01:31 +00:00
Chris Lattner
e412d10cc0 Dont' let null nodes sneak past cast instructions
llvm-svn: 16779
2004-10-06 19:29:13 +00:00
Chris Lattner
43c0372c0b 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner
13e1bc338d Hide this option
llvm-svn: 15415
2004-08-02 20:16:21 +00:00
Misha Brukman
58104df77b Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Misha Brukman
2a80e53645 Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15328
2004-07-29 17:05:13 +00:00
Brian Gaeke
f18cdca667 These files don't need to include <iostream> since they include "Support/Debug.h".
llvm-svn: 15089
2004-07-21 20:50:33 +00:00
Reid Spencer
b339652b44 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14942
2004-07-18 00:18:30 +00:00
Chris Lattner
763d51409f Be compatible with IA64
llvm-svn: 14864
2004-07-16 00:04:13 +00:00
Chris Lattner
d7d7bc70fd Fix for PR341
llvm-svn: 14842
2004-07-15 02:26:49 +00:00
Chris Lattner
203cdb2e64 Disable some code that isn't helping matters
llvm-svn: 14682
2004-07-08 07:25:51 +00:00
Chris Lattner
dce7977318 Headers moved
llvm-svn: 14665
2004-07-07 06:35:22 +00:00
Chris Lattner
7e0d8f8084 Move all of the DSA headers into the Analysis/DataStructure subdir.
llvm-svn: 14663
2004-07-07 06:32:21 +00:00
Chris Lattner
fb2f56c7c8 As much as I hate to say it, the whole setNode interface for DSNodeHandles
is HOPELESSLY broken.  The problem is that the embedded getNode call can
change the offset of the node handle in unpredictable ways.

As it turns out, all of the clients of this method really want to set
both the node and the offset, thus it is more efficient (and less buggy)
to just do both of them in one method call.  This fixes some obscure bugs
handling non-forwarded node handles.

llvm-svn: 14660
2004-07-07 06:12:52 +00:00
Reid Spencer
50ec3f9325 Add #include <iostream> since Value.h does not #include it any more.
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Chris Lattner
548171248d Moved IPModRef out of the public include dir
llvm-svn: 14455
2004-06-28 00:41:23 +00:00
Chris Lattner
6eb1e76227 Move DependenceGraph.* to lib/Analysis/DataStructure
llvm-svn: 14452
2004-06-28 00:32:33 +00:00
Chris Lattner
f914ccfa2a Move MemoryDepAnalysis.h into lib/Analysis/DataStructure
llvm-svn: 14448
2004-06-28 00:27:16 +00:00
Chris Lattner
244d5fba00 Move PgmDependenceGraph.h out of the public include hierarchy
llvm-svn: 14446
2004-06-28 00:20:04 +00:00
Chris Lattner
4e431080a9 Fix merging of nodes whose incoming offset is not zero. This unbreaks DSA on
several mallocbench programs, including perl.

llvm-svn: 14342
2004-06-23 06:29:59 +00:00
Misha Brukman
f940c277df File depends on MemoryDepAnalysis (DSA); moved to lib/Analysis/DataStructure
llvm-svn: 14327
2004-06-22 18:28:37 +00:00
Misha Brukman
170b8a80de Files depend on DSA, moved to lib/Analysis/DataStructure
llvm-svn: 14326
2004-06-22 18:13:24 +00:00
Misha Brukman
43f0a951fe File depends on DSA, moved to lib/Analysis/DataStructure
llvm-svn: 14325
2004-06-22 18:11:38 +00:00
Chris Lattner
26e594052e If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs.

llvm-svn: 14316
2004-06-22 07:13:10 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Vikram S. Adve
6026f572eb Recognize memalign and friends, and handle them specially.
llvm-svn: 13741
2004-05-25 08:14:52 +00:00
Chris Lattner
1336a3f17a Updates to work with the new auto-forwarding AA interface changes
llvm-svn: 13682
2004-05-23 21:14:27 +00:00
Chris Lattner
0e1a543d88 Fix a really nasty bug with the -disable-ds-field-sensitivity option
llvm-svn: 13681
2004-05-23 21:14:09 +00:00
Chris Lattner
89353483d6 Update to match the autochaining interface that the AA interface uses
llvm-svn: 13680
2004-05-23 21:13:51 +00:00
Vikram S. Adve
cf685da276 Inline both direct and indirect callees in the CBU phase because
a direct callee may have indirect callees and so may have changed.

llvm-svn: 13649
2004-05-23 08:00:34 +00:00
Brian Gaeke
dfe0d9af07 Move the stuff that fixes the size, orientation & fonts of graphs to
the debugging functions that call "dot". These fixed settings have
various problems: for example, the fixed size that is set in the graph
traits classes is not appropriate for turning the dot file into a PNG,
and if TrueType font rendering is being used, the 'Courier' TrueType font
may not be installed. It seems easy enough to specify these things on the
command line, anyhow.

llvm-svn: 13366
2004-05-05 06:10:06 +00:00
Misha Brukman
f5e334783a Wrapped code and comments at 80 cols; doxygenified some comments.
llvm-svn: 13264
2004-04-29 04:05:30 +00:00
Chris Lattner
430a61e786 If an object is not in the scalar map then it must be a global from another
graph.

llvm-svn: 13173
2004-04-26 14:44:08 +00:00
Chris Lattner
9236135e8f 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.

llvm-svn: 12653
2004-04-05 01:30:19 +00:00
Chris Lattner
37b7966121 Fix a tiny bug that caused an incorrect assertion failure poolallocating
boxed-sim.

llvm-svn: 12358
2004-03-13 01:14:23 +00:00
Chris Lattner
f7bc6fd913 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.

llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Misha Brukman
ee27e80a0b Implement getModRefInfo() for DSA to calculate whether a function modifies or
references a pointer.

llvm-svn: 12330
2004-03-12 06:14:22 +00:00
Chris Lattner
9ce3638433 implement new method
llvm-svn: 12264
2004-03-09 19:37:06 +00:00
Chris Lattner
1ae4150e31 Fix a bug handling globals that are constants, but are still external
llvm-svn: 12208
2004-03-08 03:52:24 +00:00
Chris Lattner
5a9cae47a4 Fix a minor bug
llvm-svn: 12169
2004-03-05 22:04:07 +00:00
Misha Brukman
75729872be Unbreak the build on Sparc.
llvm-svn: 12161
2004-03-05 20:04:40 +00:00
Chris Lattner
f21e7a75d6 Fix a bug in a previous checkin that broke 175.vpr
llvm-svn: 12128
2004-03-04 21:36:57 +00:00
Chris Lattner
c885697daa Add support for strto* and v*printf
llvm-svn: 12127
2004-03-04 21:03:54 +00:00
Chris Lattner
48b0fd7101 Add non-crappy support for varargs
llvm-svn: 12126
2004-03-04 20:33:47 +00:00
Chris Lattner
ac1eaa43fa 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.

llvm-svn: 12125
2004-03-04 19:47:04 +00:00
Chris Lattner
e3fc09a37e Speed up the cbu pass from taking somewhere near the age of the universe to about 90s on povray
llvm-svn: 12123
2004-03-04 19:16:35 +00:00
Chris Lattner
bc7fc82865 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.  :)

llvm-svn: 12116
2004-03-04 17:06:53 +00:00
Chris Lattner
e0c90cf983 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.

llvm-svn: 12115
2004-03-04 17:05:28 +00:00
Chris Lattner
790bd9d970 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.

llvm-svn: 12109
2004-03-04 03:57:53 +00:00
Chris Lattner
a141de0f09 Fix a minor bug handling incomplete programs
llvm-svn: 12105
2004-03-03 23:00:19 +00:00
Chris Lattner
0e1cd00f2c 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.

llvm-svn: 12104
2004-03-03 22:01:09 +00:00
Chris Lattner
a6540122dc Deinline methods, add fast exit
llvm-svn: 12102
2004-03-03 20:55:27 +00:00
Chris Lattner
309a57f0c0 Fix a node mapping problem that was causing the pool allocator to locally allocate
nodes that were globally live, thus breaking programs.

llvm-svn: 12094
2004-03-03 05:34:31 +00:00
Chris Lattner
ea4242a575 FINALLY be able to get symbolic type names in the globals graph!
llvm-svn: 12082
2004-03-02 21:39:43 +00:00
Chris Lattner
833646d6b8 Really, only if reopen
llvm-svn: 12080
2004-03-02 20:46:18 +00:00
Chris Lattner
e7c638e989 Correctly add an array marker on a node when appropriate!
llvm-svn: 12055
2004-03-01 19:02:54 +00:00
Chris Lattner
9e71c09ff5 Only clone global nodes between graphs if both graphs have the global.
llvm-svn: 11928
2004-02-27 20:05:15 +00:00
Chris Lattner
138a7dfb62 ADD MORE FUNCTIONS!
llvm-svn: 11927
2004-02-27 20:04:48 +00:00
Chris Lattner
d359fbf991 Be a good little compiler and handle direct calls efficiently, even if there
are beastly ConstantPointerRefs in the way...

llvm-svn: 11883
2004-02-26 22:07:22 +00:00
Chris Lattner
9e55e31b2d Fix typo
llvm-svn: 11864
2004-02-26 03:45:03 +00:00
Chris Lattner
7990e4dcd0 The node doesn't have to be _no_ node flags, it just has to be complete and
not have any globals.

llvm-svn: 11863
2004-02-26 03:43:43 +00:00
Chris Lattner
948fffa8a2 Add _more_ functions
llvm-svn: 11862
2004-02-26 03:43:08 +00:00
Chris Lattner
9fd0c48f80 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

llvm-svn: 11852
2004-02-25 23:36:08 +00:00
Chris Lattner
7d273bc532 When building local graphs, clone the initializer for constant globals into each
local graph that uses the global.

llvm-svn: 11850
2004-02-25 23:31:02 +00:00
Chris Lattner
9fe3bf296d 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.

llvm-svn: 11848
2004-02-25 23:08:00 +00:00
Chris Lattner
a9f67b5ab8 Add a bunch more functions
llvm-svn: 11847
2004-02-25 23:06:40 +00:00
Chris Lattner
d99d965f8c Try harder to get symbol info
llvm-svn: 11846
2004-02-25 23:06:30 +00:00
Chris Lattner
4f09004dff Add a bunch more functions used by perlbmk
llvm-svn: 11824
2004-02-25 17:43:20 +00:00
Chris Lattner
9036c86b14 Add support for 'rename'
llvm-svn: 11813
2004-02-24 22:17:00 +00:00
Chris Lattner
d9652be664 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.

llvm-svn: 11810
2004-02-24 22:02:48 +00:00
Chris Lattner
573441bfbd 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.

llvm-svn: 11695
2004-02-22 00:53:54 +00:00
Chris Lattner
7bff00313e Fix an iterator invalidation problem which was causing some nodes to not be
correctly merged over!

llvm-svn: 11693
2004-02-21 22:28:26 +00:00
Chris Lattner
458704f675 Use handy method
llvm-svn: 11692
2004-02-21 22:27:31 +00:00
Chris Lattner
dacc6a7448 Instead of cloning the globals for main into the globals graph at the end of
BU propagation, clone the globals into the GG of EACH FUNCTION that finishes
processing!  The GlobalsGraph *must* include all globals and effects from
all functions in the program.  Fixing this makes pool allocation work better
on 175.vpr, but it still ultimately crashes.

llvm-svn: 11686
2004-02-21 00:30:28 +00:00
Chris Lattner
0f9200e5a5 There is no need to merge the globals graph into the function graphs at the
end of the BU and CBU passes.  The globals will be marked incomplete, so it
doesn't matter if they are missing some info, and merging isn't guaranteed
to bring everything in anyway!

llvm-svn: 11684
2004-02-20 23:52:15 +00:00
Chris Lattner
31f8fa66cb Add two missing returns, which caused us to be very pessimistic about the
printf and scanf families!

llvm-svn: 11683
2004-02-20 23:27:09 +00:00
Chris Lattner
4653c4cb50 Add support for some string functions, the scanf family, and sprintf
llvm-svn: 11673
2004-02-20 20:27:11 +00:00
Chris Lattner
d9e1a49650 When we complete the bottom-up pass, make sure to merge the globals in 'main' into
the globals graph.

llvm-svn: 11562
2004-02-17 19:06:47 +00:00
Chris Lattner
2c0736be99 Only spit out warning for functions that take pointers, not for sin and the like
Add more special case handling for stdio functions.  I feel dirty, how about you?

llvm-svn: 11506
2004-02-16 22:57:19 +00:00
Chris Lattner
513e4c7bd9 memset and bcopy and now unified by the llvm.memset intrinsic
llvm-svn: 11503
2004-02-16 18:37:40 +00:00
Chris Lattner
cd6a595db5 No need to scan zero initializers. This should make DSA a bit faster.
llvm-svn: 11471
2004-02-15 05:53:42 +00:00
Chris Lattner
33ed4f9de9 Add support for a bunch more functions
llvm-svn: 11395
2004-02-13 21:21:48 +00:00
Chris Lattner
fbacee0077 Add support for fopen/fclose. Specifically with fopen, we were marking all of the
operands as incomplete, though fopen is known to only read them.  This just adds
fclose for symmetry, though it doesn't gain anything.  This makes the dsgraphs for
181.mcf much more precise.

llvm-svn: 11390
2004-02-13 20:05:32 +00:00
Chris Lattner
dd8e3f4208 Restructure code to handle memcpy/memmove
llvm-svn: 11374
2004-02-13 16:09:54 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
838c2dd5af Add one that I missed
llvm-svn: 11179
2004-02-08 01:53:10 +00:00
Chris Lattner
cc1376078c Instead of callign removeTriviallyDeadNodes on the global graph every time
removeDeadNodes is called, only call it at the end of the pass being run.
This saves 1.3 seconds running DSA on 177.mesa (5.3->4.0s), which is
pretty big.  This is only possible because of the automatic garbage
collection done on forwarding nodes.

llvm-svn: 11178
2004-02-08 01:51:48 +00:00
Chris Lattner
e2ee216e1f Remove another unneeded call.
llvm-svn: 11177
2004-02-08 01:40:40 +00:00
Chris Lattner
85ba7bbf78 This call is no longer needed now that merging does not produce garbage
llvm-svn: 11176
2004-02-08 01:38:34 +00:00
Chris Lattner
32a3eb0b88 Substantially improve the DSA code by removing 'forwarding' nodes from
DSGraphs while they are forwarding.  When the last reference to the forwarding
node is dropped, the forwarding node is autodeleted.  This should simplify
removeTriviallyDead nodes, and is only (efficiently) possible because we are
using an ilist of dsnodes now.

llvm-svn: 11175
2004-02-08 01:27:18 +00:00
Chris Lattner
84ff796305 Bugfix for ilist conversion. The ilist wants to make an 'end' node which has
G == 0

llvm-svn: 11174
2004-02-08 01:05:37 +00:00
Chris Lattner
29067016a4 Switch the Nodes list from being an std::vector<DSNode*> to an ilist<DSNode>
llvm-svn: 11173
2004-02-08 00:53:26 +00:00
Chris Lattner
2c836fc933 Change to use node_iterators instead of direct access to Nodes
llvm-svn: 11171
2004-02-08 00:23:16 +00:00
Chris Lattner
6af67c7eb4 getNodes() is gone, use node_begin/end instead
Rename stats from dsnode -> dsa
Add a new stat

llvm-svn: 11167
2004-02-07 23:58:05 +00:00
Chris Lattner
ce838bfae6 There is no need to clone over nodes that are going to be dead anyway
llvm-svn: 11157
2004-02-07 22:00:03 +00:00
Chris Lattner
89f03df701 Avoid referencing deleted DSgraphs when merging an SCC into a larger SCC. This
fixes the crash in 176.gcc.

llvm-svn: 11033
2004-01-31 21:02:18 +00:00
Chris Lattner
0127841d4e Forward method request to chained aa implementation
llvm-svn: 11024
2004-01-30 22:20:55 +00:00