aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
AgeCommit message (Collapse)Author
2007-06-28Make many sets a much more reasonable size. This decreases the time to optimizeOwen Anderson
Anton's testcase from 35.5s to 34.7s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27Use cached information that has already been computed to make clean() ↵Owen Anderson
simpler and faster. This is a small speedup on most cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27Fold a lot of code into two cases: binary instructions and ternary instructions.Owen Anderson
This saves many lines of code duplication. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27Fix a bug.Zhou Sheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27Add support for performing GVNPRE on the three vector-specific operations.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-261. Correct some comments and clean up some dead code.Owen Anderson
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functionsChris Lattner
with weak linkage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37723 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25Use the built-in postorder iterators rather than computing a postorder walk ↵Owen Anderson
by hand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-251) Fix an issue with non-deterministic iteration order in phi_translateOwen Anderson
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37714 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24Fix value ranges.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24Fix a silly mistake that was causing failures.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24Remove tabs.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24Remove use of ETForest. Also cleaned up issues around unreachable basicNick Lewycky
blocks, and optimizing within one basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22Rework topo_sort so eliminate some behavior that scaled terribly. This ↵Owen Anderson
reduces the time to optimize 403.gcc from 18.2s to 17.5s, and has an even larger effect on larger testcases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22Perform fewer set insertions while calculating ANTIC_IN. This reduces the ↵Owen Anderson
amount of time to optimize 403.gcc from 21.9s to 18.2s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22Remove some code that I was using for collecting performance information ↵Owen Anderson
that should not have been committed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22Avoid excessive calls to find_leader when calculating AVAIL_OUT. This ↵Owen Anderson
reduces the time to optimize 403.gcc from 23.5s to 21.9s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22Reserve space in vectors before topologically sorting into them. This ↵Owen Anderson
improves the time to optimize 403.gcc from 28s to 23.5s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37699 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22Make a bunch of optimizations for compile time to GVNPRE, including smarter ↵Owen Anderson
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21Significantly improve the documentation of the instcombine divide/compareChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21Change lots of sets from std::set to SmallPtrSet. This reduces the time ↵Owen Anderson
required to optimize 253.perlbmk from 10.9s to 5.3s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21Move code to update dominator information after basic block is splitDevang Patel
from LoopSimplify.cpp to Dominator.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21Eliminate a redundant check. This speeds up optimization of 253.perlbmk ↵Owen Anderson
from 13.5 seconds to 10.9 seconds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37683 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21Comment-ize the functions in GVNPRE.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37681 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20refactor a bunch of code out of visitICmpInstWithInstAndIntCst into its ownChris Lattner
routine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37679 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20Split runOnFunction into many smaller functions. This make it easier to get ↵Owen Anderson
accurate performance analysis of GVNPRE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37678 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20Make GVNPRE accurate report whether it modified the function or not.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20Get rid of an unneeded helper function.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37670 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Use a DenseMap instead of an std::map for the value numbering. This reduces ↵Owen Anderson
the time to optimize lencod on a PPC Debug build from ~300s to ~140s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Make dependsOnInvoke much more specific in what it tests, which in turn make ↵Owen Anderson
it much faster to run. This reduces the time to optimize lencondwith a debug build on PPC from ~450s to ~300s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37667 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.hTanya Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Inliner pass header file was moved.Tanya Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Rename ScalarEvolution::deleteInstructionFromRecords toDan Gohman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37657 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Handle constants in phi nodes properly. This fixes ↵Owen Anderson
test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19silence a bogus warning Duraid ran into.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Be careful to erase values from all of the appropriate sets when they're not ↵Owen Anderson
needed anymore. This fixes a few more memory-related issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Remember to clear the maximal sets between functions.Owen Anderson
Thanks to Nicholas for valgrinding this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37646 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19Refactor GVNPRE to use a much smart method of uniquing value sets, and ↵Owen Anderson
centralize a lot of the value numbering information. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37645 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18Cache the results of dependsOnInvoke()Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37622 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18Fix indentation.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37621 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18Don't perform an expensive check if it's not necessary.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-16Fix test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll by ignoring all ↵Owen Anderson
instructions that depend on invokes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37610 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15Use SCEVConstant::get instead of SCEVUnknown::get to create anDan Gohman
integer constant SCEV. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15Fix test/Transforms/GVNPRE/2007-06-15-Looping.llOwen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37595 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15Add a SCEV class and supporting code for sign-extend expressions.Dan Gohman
This created an ambiguity for expandInTy to decide when to use sign-extension or zero-extension, but it turns out that most of its callers don't actually need a type conversion, now that LLVM types don't have explicit signedness. Drop expandInTy in favor of plain expand, and change the few places that actually need a type conversion to do it themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37591 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15Generalize many transforms to work on ~ of vectors in addition to ~ ofChris Lattner
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-15Implement two xforms:Chris Lattner
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-15delete some obviously dead vector operations, which deletes a few thousandChris Lattner
operations from Duraids example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37582 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-12Fix test/Transforms/GVNPRE/2007-06-12-PhiTranslate.llOwen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37564 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-12Refactor some code, and fix test/Transforms/GVNPRE/2007-06-12-NoExit.ll by ↵Owen Anderson
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