Commit Graph

596 Commits

Author SHA1 Message Date
Vikram S. Adve
7a81a0fd13 Don't require a BB to look-up live variables, unless they may need to
be recomputed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:42:32 +00:00
Chris Lattner
1f2bbaa9cb Fix another minor bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7340 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:00:05 +00:00
Chris Lattner
e7e221ad24 Dont' try to parse the colon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:49:29 +00:00
Chris Lattner
f2d0134118 Add a more general check-flags which can be used to ensure arbitrary flags are set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7322 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:45:40 +00:00
Chris Lattner
c07736a397 Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:22:26 +00:00
Chris Lattner
bfcdf14d83 Fit code into 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7249 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:17:01 +00:00
Chris Lattner
28a128e37a Eliminate old-style cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7248 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:16:40 +00:00
Vikram S. Adve
40c600e8f3 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7227 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-22 12:08:58 +00:00
Brian Gaeke
1d2ba44224 Fix typo in call to isUnresolvableFunc, which was breaking the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7194 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-17 19:07:46 +00:00
Vikram S. Adve
1da1d32fc7 Rematerialize nodes from the globals graph into the current graph
after all callees are inlined into the current graph.

NOTE: There's also a major bug fix for the BU pass in DataStructure.cpp,
which ensures that resolvable indirect calls are not moved out to the
globals graph, so that they are eventually inlined (if possible).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7189 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:42:03 +00:00
Vikram S. Adve
03e19ddaf7 (1) Rematerialize nodes from the globals graph into the current graph
after all callers are inlined into the current graph.
(2) Optimize the way a graph is inlined into its callees in the TD phase:
    (a) Use DSGraph::cloneReachableSubgraph to clone only a subgraph at
        each call site, for faster inlining.
    (b) Clone separately for the same callee at different call sites,
        since only the reachable subgraph is being cloned, not the entire
        caller graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7188 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:40:28 +00:00
Vikram S. Adve
78bbec7fcb Implement 2 important changes: (1) rematerialization from the globals graph,
and (2) faster inlining by cloning only reachable nodes.  In particular:
(1) Added DSGraph::cloneReachableSubgraph and DSGraph::cloneReachableNodes
    to clone the subgraph reachable from a set of root nodes, into the
    current graph, merging the global nodes into thos in the current graph.
    The TD pass now uses this for faster inlining, and so does the
    next function.
(2) Added DSGraph::updateFromGlobalGraph() to rematerialize nodes from the
    globals graph into the current graph in both BU and TD passes.
(3) `I' flags are removed from all nodes in the globals graph, because they
    are difficult to maintain correctly and are not needed anyway.
(4) Aux. function calls are only removed to the globals graph if they
    will never be resovled.  (This is what fixed gap.)  The immediate
    reason is that if we took these out of a function (and moved them to
    the globals graph) we would need to rematerialize these nodes into the
    function graph for every function in the BU pass.  The longer term
    problem is that we would need to find a way to remove them from the
    globals graph iff they have been resolved on all paths through the
    call graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7187 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:36:31 +00:00
Vikram S. Adve
2e1de5ed59 Factor out the test for unresolvable external functions into
isUnresolvableFunc() (I thought I needed this externally.
I don't, but it's still nicer this way.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7186 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:25:17 +00:00
Misha Brukman
1ba3138cdc The word separate' only has one e'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7174 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 17:26:34 +00:00
Chris Lattner
5bfccb9def Reuse the values if they are constants: this is important so that we index into the right structure field
This fixes bug: BasicAA/2003-07-03-BasicAACrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 06:42:38 +00:00
Chris Lattner
85cfe01a5e Remove globals more aggressively from graphs.
Fix a bug where we removed nodes that were marked U.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7090 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 02:03:53 +00:00
Chris Lattner
7079386e02 INCLUDE_PARENT_GRAPH is required!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7088 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:57:05 +00:00
Chris Lattner
10c45d6cd5 Disable incorrect mustalias code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7087 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:56:51 +00:00
Chris Lattner
61691c5d85 Remove space at end of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7084 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:44:15 +00:00
Chris Lattner
6c87461fe6 Fix how we are handling unreachable functions. This DRAMATICALLY improves efficiency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7082 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:42:48 +00:00
Chris Lattner
d391d70361 Keep track of how many inlinings are performed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 20:24:42 +00:00
Chris Lattner
47030f8a72 Try using trivially dead deletion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7075 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 19:49:11 +00:00
Chris Lattner
44cfdf9b9a Remove dead Nodes list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7065 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 06:06:34 +00:00
Chris Lattner
a8da51bf51 Complete rewrite of td pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7064 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:44 +00:00
Chris Lattner
63899fab93 Print collapsed to match the paper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7063 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:27 +00:00
Chris Lattner
9cd0484251 Reduce amount of work we do calculating mustaliases if the arg is a global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7062 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:13 +00:00
Chris Lattner
58f98d0bf0 Add support for ParentGraph only when building in debug mode
Minor cleanups, reenable folding of call nodes to external functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7061 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:38:49 +00:00
Chris Lattner
f07804b923 Add some functions to the blacklist
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7060 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:38:00 +00:00
Chris Lattner
744f93996e Make the BU closure keep track of which actual calls happen
Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:37:48 +00:00
Chris Lattner
3051419036 Make local pass print out its progress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7058 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:37:26 +00:00
Chris Lattner
5fd60913da Fix bug: Regression/Other/2002-03-11-ExprAssertion.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7046 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 21:08:52 +00:00
Chris Lattner
18f07a11b9 Rework TD pass to work with the precise call graph constructed by the BU phase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:28:11 +00:00
Chris Lattner
b6734b281b Do not treat global variables as functions! (and assert failing)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:27:53 +00:00
Chris Lattner
d9dad2cf61 Dont' print scalar nodes for ConstantPointerRefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:27:32 +00:00
Chris Lattner
5d5b6d6a5c Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:04:18 +00:00
Chris Lattner
6681e98b13 Use the getFunctionNames method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7008 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:57:39 +00:00
Chris Lattner
a9d6566e36 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7007 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:57:30 +00:00
Chris Lattner
2b4c8dfdd5 Split CallSiteIterator out into DSCallSiteIterator.h, and generalize it a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7006 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:27:53 +00:00
Chris Lattner
9f93055253 Be more const-correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7005 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:27:18 +00:00
Chris Lattner
7b1ceaa40b Fix bug in last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7003 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:18:26 +00:00
Chris Lattner
0eea61863b Reimplement the BU closure to collapse all SCC graphs into a single graph.
Look at all of the code that gets deleted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7001 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:09:58 +00:00
Chris Lattner
2cb9acd785 Handle the case where OldNodeMap == &ScalarMap correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7000 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:09:29 +00:00
Chris Lattner
acbc8c6768 Remove dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6999 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:39 +00:00
Chris Lattner
81d924d804 Do not delete the same graph multiple times when freeing memory if graphs are sharing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6998 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:27 +00:00
Chris Lattner
3d162907e3 Do not multiply delete graphs if functions are sharing graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6997 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:08 +00:00
Chris Lattner
8d32767da4 Move usages of explicit hash_* datastructures to use typedefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6996 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:36:09 +00:00
Chris Lattner
5a54063303 Revamp DSGraphs so that they can support multiple functions in the same
DSGraph at one time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6994 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:15:25 +00:00
Chris Lattner
a321b04d60 Adjust for new DSGraph API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6993 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:14:54 +00:00
Chris Lattner
dea8146787 Abstract out the predicate which decides whether a function gets complete
arguments or not...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6987 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:37:07 +00:00
Chris Lattner
06e24c8447 Fix minor bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6986 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:36:31 +00:00