Dan Gohman
75470c3bf1
explicit keywords.
...
llvm-svn: 42262
2007-09-24 15:48:49 +00:00
Chris Lattner
0625bd6472
Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
...
Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.
llvm-svn: 42042
2007-09-17 18:34:04 +00:00
David Greene
c656cbb8c2
Update GEP constructors to use an iterator interface to fix
...
GLIBCXX_DEBUG issues.
llvm-svn: 41697
2007-09-04 15:46:09 +00:00
Owen Anderson
a8ba659976
Fix 80 col. violations.
...
llvm-svn: 40751
2007-08-02 18:20:52 +00:00
Owen Anderson
5bd6c3f2c4
Fix a bug where we were marking GEP expressions with the wrong opcode.
...
llvm-svn: 40085
2007-07-20 08:19:20 +00:00
Owen Anderson
f9e6542969
Make val_replace fail early, which reduces the time to optimize 403.gcc to 14.8s.
...
llvm-svn: 40064
2007-07-19 19:57:13 +00:00
Owen Anderson
6aa17f1def
Use SmallVector and DenseMap in even more places.
...
With this, the time to optimize 403.gcc is down to 15.1s.
llvm-svn: 40042
2007-07-19 06:37:56 +00:00
Owen Anderson
75a244d6eb
Change ValueTable to use a DenseMap for mapping expressions to value numbers.
...
This results in a slight speedup for 403.gcc.
llvm-svn: 40040
2007-07-19 06:13:15 +00:00
Owen Anderson
6a4ff8549b
Move some sets and maps to SmallPtrSet and DenseMap respectively. This
...
reduces the time to optimize 403.gcc from 17.6s to 16.4s.
llvm-svn: 40036
2007-07-19 03:32:44 +00:00
Owen Anderson
084d3c2e2f
Make the pass registration static.
...
llvm-svn: 38508
2007-07-10 20:20:19 +00:00
Owen Anderson
4c4b238448
Move some key maps from std::map to DenseMap. This improves the time to optimize Anton's testcase from 17.5s
...
to 15.7s.
llvm-svn: 38480
2007-07-10 00:27:22 +00:00
Owen Anderson
41c2cab873
Use a cheaper test, delaying calling find_leader() until we know that it's necessary. This improves
...
the time to optimize Anton's testcase from 21.1s to 17.6s.
llvm-svn: 38479
2007-07-10 00:09:25 +00:00
Owen Anderson
7ee197ecf2
Add an assertion if find_leader fails.
...
llvm-svn: 38477
2007-07-09 23:57:18 +00:00
Owen Anderson
effc7a7d16
Take advantage of the new fast SmallPtrSet assignment operator when propagating AVAIL_OUT sets.
...
This reduces the time to optimize Anton's testcase from 31.2s to 21.s!
llvm-svn: 38475
2007-07-09 22:29:50 +00:00
Owen Anderson
56b01eb3d9
Fix a comment.
...
llvm-svn: 38459
2007-07-09 16:43:55 +00:00
Owen Anderson
267ba45249
Improve a hotspot that was making build_sets() slower by calling lookup() too
...
often. This improves Anton's testcase from 36s to 32s.
llvm-svn: 38441
2007-07-09 07:56:55 +00:00
Owen Anderson
1c83b5d999
Start using a set representation that remembers the set of value numbers represented
...
in the set. For the moment, this results in a slight performance decrease, but
it lays the groundwork for future improvements.
llvm-svn: 38439
2007-07-09 06:50:06 +00:00
Owen Anderson
8b99e0ab20
Fix an error where ANTIC_OUT was ending up with more than one expression of
...
the same value number. This fixes an infinite loop on 444.namd.
llvm-svn: 37967
2007-07-07 20:13:57 +00:00
Owen Anderson
7d4bbc1c0c
Be more aggressive in the heuristic. This mostly exposes more opportunities
...
for the GVN part of GVNPRE to apply.
llvm-svn: 37951
2007-07-06 20:29:43 +00:00
Owen Anderson
3c3dd902ec
Achieve what the incorrect test was trying to do by simply requiring that all
...
critical edges be split before we begin.
llvm-svn: 37949
2007-07-06 18:12:36 +00:00
Owen Anderson
bcdd7ec4c9
Remove an incorrect check.
...
llvm-svn: 37948
2007-07-06 16:52:47 +00:00
Owen Anderson
02e9698293
Fix a bunch of issues found in a testcase from 400.perlbench.
...
llvm-svn: 37929
2007-07-05 23:11:26 +00:00
Owen Anderson
ca1a184fd8
Fix another bug, this time in PREing select instructions.
...
llvm-svn: 37878
2007-07-04 22:33:23 +00:00
Owen Anderson
cd94fc982a
Fix a typo that was killing GVNPRE of select instructions.
...
llvm-svn: 37871
2007-07-04 18:26:18 +00:00
Owen Anderson
664e260a9c
Fix an error in phi translation of GEPs that was causing failures.
...
llvm-svn: 37868
2007-07-04 04:51:16 +00:00
Owen Anderson
2e4b6feac2
Add support for performing GVNPRE on GEP instructions.
...
llvm-svn: 37862
2007-07-03 23:51:19 +00:00
Owen Anderson
b9a494aea3
Add functionality to value number GEP instructions. This also provides the infrastructure that will
...
be used for function calls. NOTE: This does not yet do any transformation of GEPs or function calls.
llvm-svn: 37860
2007-07-03 22:50:56 +00:00
Owen Anderson
6b958c72bd
Make the unary operator case a bit faster, since casts are the only kind of unary operation.
...
llvm-svn: 37857
2007-07-03 19:01:42 +00:00
Owen Anderson
59bd053fc5
Add support for performing GVNPRE on cast instructions, and add a testcase for this.
...
llvm-svn: 37856
2007-07-03 18:37:08 +00:00
Owen Anderson
67799d4ffb
Add support for value numbering (but not actually optimizing) cast instructions.
...
llvm-svn: 37789
2007-06-29 00:51:03 +00:00
Owen Anderson
c738f7ca42
Add a type field to expressions in preparation for performing GVNPRE on casts.
...
llvm-svn: 37788
2007-06-29 00:40:05 +00:00
Owen Anderson
8a9fa5d081
Add support for performing GVNPRE on select instructions. This fixes test/Transforms/GVNPRE/select.ll.
...
llvm-svn: 37783
2007-06-28 23:51:21 +00:00
Owen Anderson
e02da55cc8
Make many sets a much more reasonable size. This decreases the time to optimize
...
Anton's testcase from 35.5s to 34.7s.
llvm-svn: 37769
2007-06-28 00:34:34 +00:00
Owen Anderson
7dae8efcf2
Use cached information that has already been computed to make clean() simpler and faster. This is a small speedup on most cases.
...
llvm-svn: 37761
2007-06-27 17:38:29 +00:00
Owen Anderson
0eb265729a
Fold a lot of code into two cases: binary instructions and ternary instructions.
...
This saves many lines of code duplication. No functionality change.
llvm-svn: 37759
2007-06-27 17:03:03 +00:00
Owen Anderson
b6a39fcb21
Add support for performing GVNPRE on the three vector-specific operations.
...
llvm-svn: 37745
2007-06-27 04:10:46 +00:00
Owen Anderson
5477c54aa0
1. Correct some comments and clean up some dead code.
...
2. When calculating ANTIC_IN, only iterate the changed blocks. For most average
inputs this is a small speedup, but for cases with unusual CFGs, this can be a significant win.
llvm-svn: 37742
2007-06-26 23:29:41 +00:00
Owen Anderson
43ca4b48f1
Use the built-in postorder iterators rather than computing a postorder walk by hand.
...
llvm-svn: 37721
2007-06-25 18:25:31 +00:00
Owen Anderson
191eb06352
1) Fix an issue with non-deterministic iteration order in phi_translate
...
2) Remove some maximal-set computing code that is no longer used.
3) Use a post-order CFG traversal to compute ANTIC_IN instead of a postdom traversal.
This causes the ANTIC_IN calculation to converge much faster. Thanks to Daniel Berlin for suggesting this.
With this patch, the time to optimize 403.gcc decreased from 17.5s to 7.5s, and Anton's huge
testcase decreased from 62 minutes to 38 seconds.
llvm-svn: 37714
2007-06-25 05:41:12 +00:00
Owen Anderson
7fb6da8e4d
Fix a silly mistake that was causing failures.
...
llvm-svn: 37712
2007-06-24 08:42:24 +00:00
Owen Anderson
49409f6501
Rework topo_sort so eliminate some behavior that scaled terribly. This reduces the time to optimize 403.gcc from 18.2s to 17.5s,
...
and has an even larger effect on larger testcases.
llvm-svn: 37708
2007-06-22 21:31:16 +00:00
Owen Anderson
21a1131565
Perform fewer set insertions while calculating ANTIC_IN. This reduces the amount of time to optimize 403.gcc from 21.9s to 18.2s.
...
llvm-svn: 37707
2007-06-22 18:27:04 +00:00
Owen Anderson
92c7b22e1a
Remove some code that I was using for collecting performance information that should not have been committed.
...
llvm-svn: 37706
2007-06-22 17:04:40 +00:00
Owen Anderson
f6e21871ad
Avoid excessive calls to find_leader when calculating AVAIL_OUT. This reduces the time to optimize 403.gcc from 23.5s to 21.9s.
...
llvm-svn: 37702
2007-06-22 03:14:03 +00:00
Owen Anderson
d50a29d613
Reserve space in vectors before topologically sorting into them. This improves the time to optimize 403.gcc from 28s to 23.5s.
...
llvm-svn: 37699
2007-06-22 00:43:22 +00:00
Owen Anderson
28a2d449fa
Make a bunch of optimizations for compile time to GVNPRE, including smarter set unions, deferring blocks rather than computing maximal sets, and smarter use of sets. With these enhancements, the time to optimize 273.perlbmk goes from 5.3s to 2.7s.
...
llvm-svn: 37698
2007-06-22 00:20:30 +00:00
Owen Anderson
2ff912bf33
Change lots of sets from std::set to SmallPtrSet. This reduces the time required to optimize 253.perlbmk from 10.9s to 5.3s.
...
llvm-svn: 37690
2007-06-21 17:57:53 +00:00
Owen Anderson
27876a3ff9
Eliminate a redundant check. This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds.
...
llvm-svn: 37683
2007-06-21 01:59:05 +00:00
Owen Anderson
fd5683ad7a
Comment-ize the functions in GVNPRE.
...
llvm-svn: 37681
2007-06-21 00:19:05 +00:00
Owen Anderson
06c1e585c9
Split runOnFunction into many smaller functions. This make it easier to get accurate performance analysis of GVNPRE.
...
llvm-svn: 37678
2007-06-20 22:10:02 +00:00