summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify names of lattice values. SGTUNE becomes SGT, for example.Nick Lewycky2007-01-291-71/+127
| | | | | | | | | | | | | Fix initializeConstant, now initializeInt. Fixes major performance bottleneck. X == Y || X->DominatedBy(Y) is redundant. Remove the X == Y part. Fix crasher in makeEqual where getOrInsertNode would add a new constant, producing an NE relationship between the two members we're trying to make equal. This now allows us to mark more BBs as unreachable. llvm-svn: 33612
* For PR1094:Reid Spencer2007-01-171-4/+4
| | | | | | | Adjust the use of SetVector for changes in SetVector's interface. Patch by Gordon Henriksen. llvm-svn: 33280
* Don't print address of ETNode. Print the DFSNumIn which uniquely identifiesNick Lewycky2007-01-151-34/+65
| | | | | | | | | | | | | | | the basic block and is stable across runs in gdb or valgrind. Make Node::update handle edges which dominate and are tighter than existing edges. Replace makeEqual's "squeeze theorem" code. Fixes miscompilation. Gate the calls to defToOps and opsToDef. Before this, we were getting IG edges about values which weren't even defined in the dominated area. This reduces the size of the IG by about half. llvm-svn: 33236
* "Default context" blocks can occur after a non-default one. This meantNick Lewycky2007-01-131-8/+12
| | | | | | | | | that properties were being applied where they didn't belong. Fixes crash in new MiBench testcase. Also mark debugging code as such in #ifdef. llvm-svn: 33177
* If we know that it's a constant being casted, propagate through the castNick Lewycky2007-01-121-1/+10
| | | | | | | instruction. Doesn't work the other way though (can't recover bits that have been truncated). llvm-svn: 33104
* Clean up logic after ConstantBool removal.Nick Lewycky2007-01-121-20/+14
| | | | llvm-svn: 33096
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-3/+3
| | | | llvm-svn: 33076
* For PR1043:Zhou Sheng2007-01-111-26/+31
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* Quiet compiler warning. The only reason the function is marked virtualNick Lewycky2007-01-111-0/+2
| | | | | | is so that it can be called from inside a debugger. llvm-svn: 33067
* New predicate simplifier!Nick Lewycky2007-01-111-974/+1155
| | | | | | Please do not enable, there is still some known miscompile problem. llvm-svn: 33066
* For PR950:Reid Spencer2006-12-231-97/+247
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* Convert more Statistic's over to STATISTICChris Lattner2006-12-191-7/+4
| | | | llvm-svn: 32692
* Removing even more <iostream> includes.Bill Wendling2006-12-071-33/+29
| | | | llvm-svn: 32320
* add missing #includeChris Lattner2006-12-061-0/+1
| | | | llvm-svn: 32280
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-3/+3
| | | | | | is 'unsigned'. llvm-svn: 32279
* Unbreak VC++ build.Jeff Cohen2006-12-021-7/+7
| | | | llvm-svn: 32113
* Update to new predicate simplifier VRP design. Fixes PR966 and PR967.Nick Lewycky2006-11-221-574/+1105
| | | | | | | | Remove predicate simplifier from default gcc3 pipeline. New design is too slow to enable by default. Add new testcases for problems encountered in development. llvm-svn: 31895
* Unbreak VC++ build.Jeff Cohen2006-11-051-3/+3
| | | | llvm-svn: 31464
* Remove commented line from earlier debugging.Nick Lewycky2006-11-051-2/+0
| | | | llvm-svn: 31460
* For PR950:Reid Spencer2006-11-021-1/+3
| | | | | | Replace the REM instruction with UREM, SREM and FREM. llvm-svn: 31369
* For PR950:Reid Spencer2006-10-261-1/+3
| | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. llvm-svn: 31195
* Fix 2006-10-25-AddSetCC. A relational operator (like setlt) can neverNick Lewycky2006-10-261-27/+46
| | | | | | produce an EQ property. llvm-svn: 31193
* Resurrect r1.25.Nick Lewycky2006-10-251-117/+154
| | | | | | Fix and comment the "or", "and" and "xor" transformations. llvm-svn: 31189
* hide symbols properlyChris Lattner2006-10-251-1/+1
| | | | llvm-svn: 31184
* Revert back to r1.21, which was the last revision of predsimplify thatChris Lattner2006-10-241-134/+109
| | | | | | passes llvm-gcc bootstrap. llvm-svn: 31146
* Remove the Backwards operation. Resolving now works at the time when aNick Lewycky2006-10-231-90/+102
| | | | | | | property is added by running through the list of uses of the value and adding resolved properties to the property set. llvm-svn: 31126
* Fix similar missing optimization opportunity in XOR.Nick Lewycky2006-10-221-13/+22
| | | | llvm-svn: 31123
* Whoops! Add missing NULL check.Nick Lewycky2006-10-221-0/+1
| | | | llvm-svn: 31121
* Handle "if ((x|y) != 0)" for ints like we do for bools. Fixes missedNick Lewycky2006-10-221-10/+13
| | | | | | optimization opportunity pointed out by Chris Lattner. llvm-svn: 31118
* AllocaInst can't return a null pointer. Fixes missed optimizationNick Lewycky2006-10-221-0/+6
| | | | | | opportunity pointed out by Andrew Lewycky. llvm-svn: 31115
* Replace custom dispatch code with two uses of InstVisitor. ImprovesNick Lewycky2006-10-121-93/+113
| | | | | | compile-time performance. llvm-svn: 30896
* Simplify logic further.Nick Lewycky2006-10-031-17/+8
| | | | | | | Ensure that we copy KnownProperties before calling visitBasicBlock, else we may leak properties into blocks where they don't belong. llvm-svn: 30705
* Simplify, now that predsimplify depends on break-crit-edges.Nick Lewycky2006-10-031-26/+8
| | | | | | Fix SwitchInst where dest-block is the same as one of the cases. llvm-svn: 30700
* Move break-crit-edges before the predicate simplifier. Allows us toNick Lewycky2006-10-031-7/+3
| | | | | | optimize in more cases. llvm-svn: 30699
* Eliminate ConstantBool::True and ConstantBool::False. Instead, provideChris Lattner2006-09-281-40/+33
| | | | | | ConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30665
* Style changes only. Remove dead code, fix a comment.Nick Lewycky2006-09-231-11/+4
| | | | llvm-svn: 30588
* Don't rewrite ConstantExpr::get.Nick Lewycky2006-09-211-44/+20
| | | | llvm-svn: 30552
* Once we're down to "setcc type constant1, constant2", at least come upNick Lewycky2006-09-201-18/+14
| | | | | | with the right answer. llvm-svn: 30550
* Use a total ordering to compare instructions.Nick Lewycky2006-09-201-87/+101
| | | | | | Fixes infinite loop in resolve(). llvm-svn: 30540
* Walk down the dominator tree instead of the control flow graph. That meansNick Lewycky2006-09-181-150/+90
| | | | | | | that we can't modify the CFG any more, at least not until it's possible to update the dominator tree (PR217). llvm-svn: 30469
* Add some more consistency checks.Nick Lewycky2006-09-131-1/+20
| | | | llvm-svn: 30305
* Fix unionSets so that it can merge correctly.Nick Lewycky2006-09-131-22/+34
| | | | llvm-svn: 30304
* Erase dead instructions.Nick Lewycky2006-09-131-2/+3
| | | | llvm-svn: 30298
* Skip the linear search if the answer is already known.Nick Lewycky2006-09-111-20/+22
| | | | llvm-svn: 30251
* Replace EquivalenceClasses with a custom-built data structure. Many commonNick Lewycky2006-09-101-133/+259
| | | | | | | | | 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. llvm-svn: 30235
* Improve handling of SelectInst.Nick Lewycky2006-09-021-31/+44
| | | | | | | | 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. llvm-svn: 30055
* Don't confuse canonicalize and lookup. Fixes predsimplify.reg4.ll. AlsoNick Lewycky2006-09-011-21/+20
| | | | | | corrects missing optimization opportunity removing cases from a switch. llvm-svn: 30009
* Properties where both Values weren't in the union (as being equal toNick Lewycky2006-08-311-24/+18
| | | | | | | | another Value) weren't being found by findProperties. This fixes predsimplify.ll test6, a missed optimization opportunity. llvm-svn: 29991
* Move to using the EquivalenceClass ADT. Removes SynSets.Nick Lewycky2006-08-301-165/+92
| | | | | | | | | 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. llvm-svn: 29970
* Add PredicateSimplifier pass. Collapses equal variables into one formNick Lewycky2006-08-281-0/+744
and simplifies expressions. This implements the optimization described in PR807. llvm-svn: 29947
OpenPOWER on IntegriCloud