Commit Graph

1723 Commits

Author SHA1 Message Date
Chris Lattner
7cbe2ebb21 Generalize many transforms to work on ~ of vectors in addition to ~ of
integer ops.  This implements Transforms/InstCombine/and-or-not.ll
test3/test4, and finishes off PR1510


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 06:23:19 +00:00
Chris Lattner
003b6200df Implement two xforms:
1. ~(~X | Y) === (X & ~Y)
2. (A|B) & ~(A&B) -> A^B

This allows us to transform  ~(~(a|b) | (a&b)) -> a^b.

This implements PR1510 for scalar values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 05:58:24 +00:00
Chris Lattner
041a6c9048 delete some obviously dead vector operations, which deletes a few thousand
operations from Duraids example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37582 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 05:26:55 +00:00
Owen Anderson
71fcebcf8a Fix test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37564 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-12 22:43:57 +00:00
Owen Anderson
239e71201e Refactor some code, and fix test/Transforms/GVNPRE/2007-06-12-NoExit.ll by being more careful when using
post-dominator information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37556 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-12 16:57:50 +00:00
Dale Johannesen
ce0b23721e Sink CmpInst's to their uses to reduce register pressure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37554 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-12 16:50:17 +00:00
Owen Anderson
65d2862a60 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37550 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-12 00:50:47 +00:00
Owen Anderson
0e71466405 Handle functions with multiple exit blocks properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37539 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-11 16:25:17 +00:00
Owen Anderson
139fe848a2 Perform PRE of comparison operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-09 18:35:31 +00:00
Owen Anderson
b8b873cb7d Collect statistics from GVN-PRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-08 22:02:36 +00:00
Owen Anderson
a7f916cf89 Fix typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-08 20:57:08 +00:00
Owen Anderson
8338ff5ff1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37525 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-08 20:44:02 +00:00
Owen Anderson
900997ba3b Small bugfix, and const-ify some methods (Thanks, Bill).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37513 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-08 01:52:45 +00:00
Owen Anderson
397d405731 Add partial redundancy elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-08 01:03:01 +00:00
Devang Patel
468502e41a Do not require ETForest. Now it is unused by LICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-07 22:21:15 +00:00
Devang Patel
326821ef12 Use DominatorTree instead of ETForest.
This allows faster immediate domiantor walk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37500 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-07 21:57:03 +00:00
Devang Patel
b7d9dfc7ba Use DominatorTree instead of ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-07 21:42:15 +00:00
Devang Patel
fa51f9ae12 Use DominatorTree instead of ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-07 21:35:27 +00:00
Devang Patel
a97e040e05 Use DominatorTree instead of ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37495 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-07 18:45:06 +00:00
Devang Patel
387b8cbc2d Use DominatorTree instead of ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-07 18:40:55 +00:00
Lauro Ramos Venancio
d0499af703 Fix PR1499.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 17:08:48 +00:00
Nick Lewycky
5adcefb04d Inform ScalarEvolutions that we're deleting Values.
This is the obviously correct part of the fix for PR1487.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 03:51:56 +00:00
Owen Anderson
12112af5e8 Add simple full redundancy elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37455 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 01:27:49 +00:00
Chris Lattner
b47f6124f4 Fix PR1495 and CodeGen/X86/2007-06-05-LSR-Dominator.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 01:23:55 +00:00
Devang Patel
743f7e8839 Avoid non-trivial loop unswitching while optimizing for size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 00:21:03 +00:00
Owen Anderson
1d4eb6ab0d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37443 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-05 23:46:12 +00:00
Owen Anderson
8f862c80bc Don't leak memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37442 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-05 22:11:49 +00:00
Owen Anderson
359208032b Fix a small bug, some 80 cols violations, and add some more debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-05 17:31:23 +00:00
Dan Gohman
d8af90c1da Allow insertelement, extractelement, and shufflevector to be hoisted/sunk
by LICM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37435 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-05 16:05:55 +00:00
Bill Wendling
851879c4cf Patches by Chuck Rose to unbreak V Studio builds.
Thanks Chuck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37428 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 23:52:59 +00:00
Devang Patel
170f2b9bef s/ETNode::getChildren/ETNode::getETNodeChildren/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37426 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 23:45:02 +00:00
Owen Anderson
dbc705b73f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 23:34:56 +00:00
Owen Anderson
082fe7185e Fix a bunch of small bugs, and improve the debugging output significantly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 23:28:33 +00:00
Owen Anderson
5ea069fdda Make phi_translate correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 18:05:26 +00:00
Devang Patel
26042420d6 s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37407 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 00:32:22 +00:00
Owen Anderson
0fa6b37c6f Don't use the custom comparator where it's not necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37406 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-03 22:02:14 +00:00
Devang Patel
bec7647f98 s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-03 06:26:14 +00:00
Owen Anderson
10ac137d0b Remove an unused method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37402 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-03 05:58:25 +00:00
Owen Anderson
a724ac1a73 There's no need to have an Expression class... Value works just as well! This simplifies a lot of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37401 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-03 05:55:58 +00:00
Devang Patel
e7ae1a9dee Insert new instructions in AliasSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37390 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-01 22:15:31 +00:00
Owen Anderson
aa7d3351f0 clean() needs to process things in topological order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-01 22:00:37 +00:00
Owen Anderson
8e21fb7df8 Fix Expression comparison, which in turn fixes a value numbering error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-01 17:34:47 +00:00
Owen Anderson
243f348c2a Add a topological sort function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37376 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-31 22:44:11 +00:00
Owen Anderson
8214d50338 Attempt to fix up phi_translate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37366 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-31 00:42:15 +00:00
Devang Patel
f38ac5dd39 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37360 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-30 15:29:37 +00:00
Chris Lattner
39a1c04323 Fix Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll and the second
half of PR1421, by not decimating structs with holes that are the source and
destination of a memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37358 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-30 06:11:23 +00:00
Owen Anderson
2c0c51593d Fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-29 23:34:14 +00:00
Owen Anderson
e3072b292f Re-fix a bug, where I was now being too aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37348 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-29 23:26:30 +00:00
Owen Anderson
cdf8efde6a Use proper debugging facilities so other people don't have to look at my commented-out
debugging lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37347 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-29 23:15:21 +00:00
Owen Anderson
9b6bd12ef0 Comment debug code out that I accidentally uncommented last time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-29 22:43:03 +00:00