Commit Graph

30 Commits

Author SHA1 Message Date
Owen Anderson a75dd4dc56 Fix a few more bugs, including an instance of walking in reverse topological rather than topological order. This
fixes a testcase extracted from llvm-test.

llvm-svn: 37550
2007-06-12 00:50:47 +00:00
Owen Anderson d184c18074 Handle functions with multiple exit blocks properly.
llvm-svn: 37539
2007-06-11 16:25:17 +00:00
Owen Anderson 223718c40e Perform PRE of comparison operators.
llvm-svn: 37536
2007-06-09 18:35:31 +00:00
Owen Anderson 7d76b2a774 Collect statistics from GVN-PRE.
llvm-svn: 37530
2007-06-08 22:02:36 +00:00
Owen Anderson b232efaf48 Fix typo in a comment.
llvm-svn: 37526
2007-06-08 20:57:08 +00:00
Owen Anderson 55994f2453 Fix a bug that was causing the elimination phase not to replace values when it should be.
With this patch, GVN-PRE now correctly optimizes the example from the thesis.

Many thanks to Daniel Berlin for helping me find errors in this.

llvm-svn: 37525
2007-06-08 20:44:02 +00:00
Owen Anderson 2e5efc30c2 Small bugfix, and const-ify some methods (Thanks, Bill).
llvm-svn: 37513
2007-06-08 01:52:45 +00:00
Owen Anderson be80240b29 Add partial redundancy elimination.
llvm-svn: 37510
2007-06-08 01:03:01 +00:00
Owen Anderson 634a063c1d Add simple full redundancy elimination.
llvm-svn: 37455
2007-06-06 01:27:49 +00:00
Owen Anderson ddbe430732 Fix a misunderstanding of the algorithm. Really, we should be tracking values
and expression separately.  We can get around this, however, by only keeping
opaque values in TMP_GEN.

llvm-svn: 37443
2007-06-05 23:46:12 +00:00
Owen Anderson c84720913a Don't leak memory.
llvm-svn: 37442
2007-06-05 22:11:49 +00:00
Owen Anderson 9b89e4b561 Fix a small bug, some 80 cols violations, and add some more debugging output.
llvm-svn: 37436
2007-06-05 17:31:23 +00:00
Owen Anderson 3c9d8eef21 Don't use std::set_difference when the two sets are sorted differently. Compute
the difference manually instead.

This allows GVNPRE to produce correct analysis for the example in the GVNPRE
paper.

llvm-svn: 37425
2007-06-04 23:34:56 +00:00
Owen Anderson 3df5299f94 Fix a bunch of small bugs, and improve the debugging output significantly.
llvm-svn: 37424
2007-06-04 23:28:33 +00:00
Owen Anderson 38b6b22a41 Make phi_translate correct.
llvm-svn: 37418
2007-06-04 18:05:26 +00:00
Devang Patel bdd1aaef10 s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Owen Anderson 0eca9aad10 Don't use the custom comparator where it's not necessary.
llvm-svn: 37406
2007-06-03 22:02:14 +00:00
Devang Patel 0e8aa7b69a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Owen Anderson 46499645db Remove an unused method.
llvm-svn: 37402
2007-06-03 05:58:25 +00:00
Owen Anderson 0b68cda302 There's no need to have an Expression class... Value works just as well! This simplifies a lot of code.
llvm-svn: 37401
2007-06-03 05:55:58 +00:00
Owen Anderson 48e93f2ce9 clean() needs to process things in topological order.
llvm-svn: 37389
2007-06-01 22:00:37 +00:00
Owen Anderson 4c89142466 Fix Expression comparison, which in turn fixes a value numbering error.
llvm-svn: 37386
2007-06-01 17:34:47 +00:00
Owen Anderson 331bf6a959 Add a topological sort function.
llvm-svn: 37376
2007-05-31 22:44:11 +00:00
Owen Anderson 81d156e16f Attempt to fix up phi_translate.
llvm-svn: 37366
2007-05-31 00:42:15 +00:00
Owen Anderson 4b0c1859fd Fix a typo
llvm-svn: 37350
2007-05-29 23:34:14 +00:00
Owen Anderson 0c4230724c Re-fix a bug, where I was now being too aggressive.
llvm-svn: 37348
2007-05-29 23:26:30 +00:00
Owen Anderson 4a6ec8fb57 Use proper debugging facilities so other people don't have to look at my commented-out
debugging lines.

llvm-svn: 37347
2007-05-29 23:15:21 +00:00
Owen Anderson f11bdc7637 Comment debug code out that I accidentally uncommented last time.
llvm-svn: 37346
2007-05-29 22:43:03 +00:00
Owen Anderson ac83a3e4ff Add a place where I missed using the maximal set. Note that using the maximal
set this way is _SLOW_.  Somewhere down the line, I'll look at speeding it up.

llvm-svn: 37345
2007-05-29 22:35:41 +00:00
Owen Anderson 5fba6c19b2 Very first part of a GVN-PRE implementation. It currently performs a bunch of analysis, and nothing more. It is also quite slow for the moment. However,
it should give a sense of what's going on.

llvm-svn: 37343
2007-05-29 21:53:49 +00:00