Commit Graph

1109 Commits

Author SHA1 Message Date
Chris Lattner
adfd5f14b4 ADd support for printing eqgraphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 19:51:24 +00:00
Chris Lattner
2787e03d0e Replace linear search with logrithmic one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20580 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 19:05:05 +00:00
Chris Lattner
a4319e5826 make sure to mark nodes returned from functions as incomplete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20576 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 14:58:28 +00:00
Chris Lattner
b25959a632 remove this from the PA namespace, leaving it in the llvm ns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20574 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 12:08:52 +00:00
Chris Lattner
7aed7179bd Move this from the pool allocator project to here, where it logically belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20570 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 11:51:30 +00:00
Chris Lattner
50bc9ef507 Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20531 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 16:29:52 +00:00
Chris Lattner
bac5b46396 Export two methods for getting -X and A-B.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 05:34:41 +00:00
Chris Lattner
3267265d78 Make sure the two arguments of a setcc instruction point to the same node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20462 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 19:04:31 +00:00
Chris Lattner
f57cc3b7e2 Trivial cleanup patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20436 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-04 20:27:46 +00:00
Chris Lattner
f8db8a0432 Fix spelling, patch contributed by Gabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-27 06:15:51 +00:00
Chris Lattner
7192e501eb DCE a dead function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20339 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-26 23:36:45 +00:00
Chris Lattner
7ffc07dcf7 1 + 100 + 51 == 152, not 52.
If we fold three constants together (c1+c2+c3), make sure to keep
LHSC updated, instead of reusing (in this case), the 1 instead of the
partial sum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20337 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-26 18:50:19 +00:00
Chris Lattner
6e84bd7d59 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20324 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-25 01:27:48 +00:00
Chris Lattner
753b113cdf This instruction:
X = gep null, ...

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20316 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24 19:55:31 +00:00
Chris Lattner
d7642c4f2d Fix a bug introduced by revision 1.187 of this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20308 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24 18:48:07 +00:00
Chris Lattner
13d0108666 Remove use of bind_obj, deleter, and finegrainify namespacification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20277 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-22 23:27:21 +00:00
Chris Lattner
2352fec205 Scary typo that fixes Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
and PR515.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20224 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-17 16:54:16 +00:00
Chris Lattner
7a0c775044 Add a sanity check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20195 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 18:48:48 +00:00
Chris Lattner
d672ab936f Add a new method to make it easy to update graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20194 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 18:40:55 +00:00
Chris Lattner
4dc534c7fe Correct the recursive PHI node handling routines in a way that CANNOT induce
infinite loops (using the new replaceSymbolicValuesWithConcrete method).

This patch reverts this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050131/023830.html

... which was an attempted fix for this problem.  Unfortunately, that patch
caused test/Regression/Transforms/IndVarsSimplify/exit_value_tests.llx to fail
and slightly castrated the entire analysis.  This patch fixes it right.

This patch is dedicated to jeffc, for making me deal with this.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20146 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 04:37:18 +00:00
Chris Lattner
6be079491f Use new edge iterators to simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20086 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-09 03:20:43 +00:00
Chris Lattner
bcc70bcb25 IndCallGraphMap is now a pointer to a new'd map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 16:09:15 +00:00
Chris Lattner
86db364f02 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:59:49 +00:00
Chris Lattner
e859444a91 Split mergeInGraph into two methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20035 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:58:28 +00:00
Chris Lattner
d7be188323 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 18:58:04 +00:00
Chris Lattner
bb753c4f80 Refactor getFunctionArgumentsForCall out of mergeInGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20018 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-03 18:40:25 +00:00
Chris Lattner
269dbf5f5e Eliminate some duplicated debug code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19980 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:55:40 +00:00
Chris Lattner
20cd136c5d Eliminate self-recursion as a special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:49:43 +00:00
Chris Lattner
af8650e9c7 Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19978 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:37:27 +00:00
Chris Lattner
1e759999ca 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19970 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 19:10:48 +00:00
Chris Lattner
f189bcec00 Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19968 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 17:35:52 +00:00
Chris Lattner
caa7c19fb4 Fix a problem where we could infinitely recurse on phi nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19955 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 00:18:30 +00:00
Chris Lattner
f9aace20fb Rename variables to work with VC++'s hokey scoping rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19942 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:58 +00:00
Chris Lattner
cff8ac20ca Fix some scary bugs that VC++ detected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19941 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:45 +00:00
Chris Lattner
6538f42208 Make things more const-correct, adjust to changes in DSA interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:25 +00:00
Chris Lattner
a9548d9fd9 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:02 +00:00
Chris Lattner
3725c12b26 Due to previous simplifications, we can simplify the data structures being
used here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19913 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 07:04:10 +00:00
Chris Lattner
ee379a16ee Properly handle volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:42:34 +00:00
Chris Lattner
4f16bd7a74 Remove some useless map operations. Loads/stores that are in the same
BB as the load are not included in the Cand* sets at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19911 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:39:25 +00:00
Chris Lattner
15774df4d3 Before doing expensive global analysis, check to make sure the pointer is
not invalidated on entry and on exit of the block.  This fixes some N^2
behavior in common cases, and speeds up gcc another 5% to 22.35s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19910 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:31:53 +00:00
Chris Lattner
e212d62a34 Minor simplification/speedup. Replaces a set lookup with a pointer comparison.
This speeds up 176.gcc from 25.73s to 23.48s, which is 9.5%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:20:55 +00:00
Chris Lattner
e233b8c64b Eliminate generality that is not buying us anything. In particular, this
will cause us to miss cases where the input pointer to a load could be value
numbered to another load.  Something like this:


  %X = load int* %P1
  %Y = load int* %P2

Those are obviously the same if P1/P2 are the same.  The code this patch
removes attempts to handle that.  However, since GCSE iterates, this doesn't
actually buy us anything: GCSE will first replace P1 or P2 with the other
one, then the load can be value numbered as equal.

Removing this code speeds up gcse a lot.  On 176.gcc in debug mode, this
speeds up gcse from 29.08s -> 25.73s, a 13% savings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19906 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:11:16 +00:00
Chris Lattner
2652da6af9 If we see:
%A = alloca int
  %V = load int* %A

value number %V to undef, not 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19905 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 05:57:01 +00:00
Chris Lattner
9cb992ab72 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19864 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 06:12:46 +00:00
Chris Lattner
851b534b89 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 20:00:14 +00:00
Chris Lattner
507bdf9488 Silence VC++ warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19506 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-12 04:51:37 +00:00
Jeff Cohen
6e400f76e6 Apply feed back from Chris:
1. Rename createLoaderPass to CreateProfileLoaderPass
  2. Opt shouldn't use the pass registered in CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19431 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-10 03:56:27 +00:00
Jeff Cohen
1d7b5de7ee Add last four createXxxPass functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19424 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-09 20:42:52 +00:00
Jeff Cohen
2611dd4448 Get lib/Analysis/DataStructure to compile with VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19412 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-09 04:18:28 +00:00
Jeff Cohen
534927d82d Add even more missing createXxxPass functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19402 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08 22:01:16 +00:00