aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/PredicateSimplifier.cpp
AgeCommit message (Collapse)Author
2006-10-25Resurrect r1.25.Nick Lewycky
Fix and comment the "or", "and" and "xor" transformations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31189 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-25hide symbols properlyChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31184 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-24Revert back to r1.21, which was the last revision of predsimplify thatChris Lattner
passes llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31146 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23Remove the Backwards operation. Resolving now works at the time when aNick Lewycky
property is added by running through the list of uses of the value and adding resolved properties to the property set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31126 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22Fix similar missing optimization opportunity in XOR.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31123 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22Whoops! Add missing NULL check.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31121 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22Handle "if ((x|y) != 0)" for ints like we do for bools. Fixes missedNick Lewycky
optimization opportunity pointed out by Chris Lattner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31118 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22AllocaInst can't return a null pointer. Fixes missed optimizationNick Lewycky
opportunity pointed out by Andrew Lewycky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31115 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12Replace custom dispatch code with two uses of InstVisitor. ImprovesNick Lewycky
compile-time performance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30896 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03Simplify logic further.Nick Lewycky
Ensure that we copy KnownProperties before calling visitBasicBlock, else we may leak properties into blocks where they don't belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30705 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03Simplify, now that predsimplify depends on break-crit-edges.Nick Lewycky
Fix SwitchInst where dest-block is the same as one of the cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30700 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03Move break-crit-edges before the predicate simplifier. Allows us toNick Lewycky
optimize in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30699 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28Eliminate ConstantBool::True and ConstantBool::False. Instead, provideChris Lattner
ConstantBool::getTrue() and ConstantBool::getFalse(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-23Style changes only. Remove dead code, fix a comment.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30588 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21Don't rewrite ConstantExpr::get.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30552 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20Once we're down to "setcc type constant1, constant2", at least come upNick Lewycky
with the right answer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30550 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20Use a total ordering to compare instructions.Nick Lewycky
Fixes infinite loop in resolve(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30540 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18Walk down the dominator tree instead of the control flow graph. That meansNick Lewycky
that we can't modify the CFG any more, at least not until it's possible to update the dominator tree (PR217). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13Add some more consistency checks.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30305 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13Fix unionSets so that it can merge correctly.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30304 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13Erase dead instructions.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11Skip the linear search if the answer is already known.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30251 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10Replace EquivalenceClasses with a custom-built data structure. Many commonNick Lewycky
operations (like findProperties) should be faster, at the expense of unionSets being slower in cases that are rare in practise. Don't erase a dead Instruction. This fixes a memory corruption issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30235 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-02Improve handling of SelectInst.Nick Lewycky
Reorder operations to remove duplicated work. Fix to leave floating-point types out of the optimization. Add tests to predsimplify.ll for SwitchInst and SelectInst handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30055 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01Don't confuse canonicalize and lookup. Fixes predsimplify.reg4.ll. AlsoNick Lewycky
corrects missing optimization opportunity removing cases from a switch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30009 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-31Properties where both Values weren't in the union (as being equal toNick Lewycky
another Value) weren't being found by findProperties. This fixes predsimplify.ll test6, a missed optimization opportunity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29991 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-30Move to using the EquivalenceClass ADT. Removes SynSets.Nick Lewycky
If a branch's condition has become a ConstantBool, simplify it immediately. Removing the edge saves work and exposes up more optimization opportunities in the pass. Add support for SelectInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29970 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-28Add PredicateSimplifier pass. Collapses equal variables into one formNick Lewycky
and simplifies expressions. This implements the optimization described in PR807. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29947 91177308-0d34-0410-b5e6-96231b3b80d8