1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

3288 Commits

Author SHA1 Message Date
Devang Patel
8292a2ee90 Do not filter loop if candidate branch is in loop header.
llvm-svn: 37792
2007-06-29 01:39:53 +00:00
Owen Anderson
cff6ffe45c Add support for value numbering (but not actually optimizing) cast instructions.
llvm-svn: 37789
2007-06-29 00:51:03 +00:00
Owen Anderson
f134e54bb1 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
f1665858f3 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
Devang Patel
03d844eebd - Undo previous check and allow loop switch for condtion that is not inside
loop.
- Avoid loop unswich for loop header branch.
- While cloning dominators fix typo and handle self dominating blocks.

llvm-svn: 37772
2007-06-28 02:05:46 +00:00
Devang Patel
7f468af921 Update LoopUnswitch pass to preserve DomiantorTree.
llvm-svn: 37771
2007-06-28 00:49:00 +00:00
Devang Patel
50d5420cdc If a condition is not inside a loop then the condition is suitable
to loop unswitch candidate for the loop.

llvm-svn: 37770
2007-06-28 00:44:10 +00:00
Owen Anderson
9372f36b3c 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
97dd99d761 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
a7927caa56 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
Zhou Sheng
011fc80616 Fix a bug.
llvm-svn: 37751
2007-06-27 09:50:26 +00:00
Owen Anderson
97de56ae2b Add support for performing GVNPRE on the three vector-specific operations.
llvm-svn: 37745
2007-06-27 04:10:46 +00:00
Owen Anderson
dc1d567274 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
Chris Lattner
64e8e4af59 fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functions
with weak linkage.

llvm-svn: 37723
2007-06-25 21:50:09 +00:00
Owen Anderson
fb09af59e0 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
293173ccd2 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
Nick Lewycky
59c02f6336 Fix value ranges.
llvm-svn: 37713
2007-06-24 20:14:22 +00:00
Owen Anderson
e16e7f2d3d Fix a silly mistake that was causing failures.
llvm-svn: 37712
2007-06-24 08:42:24 +00:00
Nick Lewycky
c238dd7dca Remove tabs.
llvm-svn: 37710
2007-06-24 04:40:16 +00:00
Nick Lewycky
fff717bc50 Remove use of ETForest. Also cleaned up issues around unreachable basic
blocks, and optimizing within one basic block.

llvm-svn: 37709
2007-06-24 04:36:20 +00:00
Owen Anderson
4713f37034 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
65af4e7d2b 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
1fe94b16dc 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
92c7510376 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
0abfa1ecb2 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
e121e85517 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
Chris Lattner
4624e16f16 Significantly improve the documentation of the instcombine divide/compare
transformation.  Also, keep track of which end of the integer interval overflows
occur on.  This fixes Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll
and rdar://5278853, a miscompilation of perl.

llvm-svn: 37692
2007-06-21 18:11:19 +00:00
Owen Anderson
eb29dac190 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
Devang Patel
bfb1c7192e Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp

llvm-svn: 37689
2007-06-21 17:23:45 +00:00
Owen Anderson
a783224b25 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
b06cc18b7c Comment-ize the functions in GVNPRE.
llvm-svn: 37681
2007-06-21 00:19:05 +00:00
Chris Lattner
26537049eb refactor a bunch of code out of visitICmpInstWithInstAndIntCst into its own
routine.

llvm-svn: 37679
2007-06-20 23:46:26 +00:00
Owen Anderson
ff60973eb8 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
Owen Anderson
58265d2391 Make GVNPRE accurate report whether it modified the function or not.
llvm-svn: 37673
2007-06-20 18:30:20 +00:00
Owen Anderson
815c4d384b Get rid of an unneeded helper function.
llvm-svn: 37670
2007-06-20 00:43:33 +00:00
Owen Anderson
997c4e5e47 Use a DenseMap instead of an std::map for the value numbering. This reduces the time to optimize lencod on a PPC Debug build from ~300s to ~140s.
llvm-svn: 37668
2007-06-19 23:23:54 +00:00
Owen Anderson
5a902e6afc Make dependsOnInvoke much more specific in what it tests, which in turn make it much faster to run. This reduces the time to optimize lencondwith a debug build on PPC from ~450s to ~300s.
llvm-svn: 37667
2007-06-19 23:07:16 +00:00
Tanya Lattner
b2aae813b6 Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.h
llvm-svn: 37666
2007-06-19 22:31:52 +00:00
Tanya Lattner
a2e912bf51 Inliner pass header file was moved.
llvm-svn: 37665
2007-06-19 22:29:50 +00:00
Dan Gohman
bb705e230a Rename ScalarEvolution::deleteInstructionFromRecords to
deleteValueFromRecords and loosen the types to all it to accept
Value* instead of just Instruction*, since this is what
ScalarEvolution uses internally anyway. This allows more flexibility
for future uses.

llvm-svn: 37657
2007-06-19 14:28:31 +00:00
Owen Anderson
0eafdcafe7 Handle constants in phi nodes properly. This fixes test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll
llvm-svn: 37655
2007-06-19 07:35:36 +00:00
Chris Lattner
6809b4b4fa silence a bogus warning Duraid ran into.
llvm-svn: 37649
2007-06-19 05:43:49 +00:00
Owen Anderson
f74f94d859 Be careful to erase values from all of the appropriate sets when they're not needed anymore. This fixes a few more memory-related issues.
llvm-svn: 37647
2007-06-19 05:37:32 +00:00
Owen Anderson
d3d1716516 Remember to clear the maximal sets between functions.
Thanks to Nicholas for valgrinding this.

llvm-svn: 37646
2007-06-19 04:32:55 +00:00
Owen Anderson
dc858f6498 Refactor GVNPRE to use a much smart method of uniquing value sets, and centralize a lot of the value numbering information. No functionality change.
llvm-svn: 37645
2007-06-19 03:31:41 +00:00
Owen Anderson
58098f3560 Cache the results of dependsOnInvoke()
llvm-svn: 37622
2007-06-18 04:42:29 +00:00
Owen Anderson
8956588783 Fix indentation.
llvm-svn: 37621
2007-06-18 04:31:21 +00:00
Owen Anderson
c45b435273 Don't perform an expensive check if it's not necessary.
llvm-svn: 37620
2007-06-18 04:30:44 +00:00
Owen Anderson
0c8b051523 Fix test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll by ignoring all instructions that depend on invokes.
llvm-svn: 37610
2007-06-16 00:26:54 +00:00
Dan Gohman
a3ea76f018 Use SCEVConstant::get instead of SCEVUnknown::get to create an
integer constant SCEV.

llvm-svn: 37596
2007-06-15 18:00:55 +00:00