summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't merge uses when they are targetting fixup sites withDan Gohman2010-07-151-1/+20
| | | | | | | | | | | | | different widths. In a use with a narrower fixup, formulae may be wider than the fixup, in which case the high bits aren't necessarily meaningful, so it isn't safe to reuse them for uses with wider fixups. This fixes PR7618, though the testcase is too large for a reasonable regression test, since it heavily dependes on hitting LSR's heuristics in a certain way. llvm-svn: 108455
* Use dbgs() instead of errs() in a DEBUG.Dan Gohman2010-07-151-1/+1
| | | | llvm-svn: 108453
* Watch out for a constant offset cancelling out a base register, formingDan Gohman2010-07-151-2/+9
| | | | | | | a zero. This situation arrises in Fortran code with induction variables that start at 1 instead of 0. This fixes PR7651. llvm-svn: 108424
* use getArgOperand instead of getOperandGabor Greif2010-06-301-2/+2
| | | | llvm-svn: 107270
* In GenerateReassociations, don't bother thinking about individualDan Gohman2010-06-251-8/+22
| | | | | | | | SCEVUnknown values which are loop-variant, as LSR can't do anything interesting with these values in any case. This fixes very slow compile times on loops which have large numbers of such values. llvm-svn: 106897
* A few minor micro-optimizations.Dan Gohman2010-06-241-5/+11
| | | | llvm-svn: 106764
* Teach getExactSDiv to evaluate x/1 to x up front, as it's a commonDan Gohman2010-06-241-8/+16
| | | | | | | enough special case, and it theoretically allows more folding because it works even when x is unanalyzable. llvm-svn: 106763
* Fix copy+pasto issues in isMulSExtable.Dan Gohman2010-06-241-4/+5
| | | | llvm-svn: 106759
* Fix OptimizeMax to handle an odd case where one of the max operandsDan Gohman2010-06-221-1/+4
| | | | | | is another max which folds. This fixes PR7454. llvm-svn: 106594
* Use A.append(...) instead of A.insert(A.end(), ...) when A is aDan Gohman2010-06-211-7/+6
| | | | | | SmallVector, and other SmallVector simplifications. llvm-svn: 106452
* Add a TODO comment.Dan Gohman2010-06-191-0/+2
| | | | llvm-svn: 106397
* Include the use kind along with the expression in the key of theDan Gohman2010-06-191-2/+28
| | | | | | | | | | | | use sharing map. The reconcileNewOffset logic already forces a separate use if the kinds differ, so incorporating the kind in the key means we can track more sharing opportunities. More sharing means fewer total uses to track, which means smaller problem sizes, which means the conservative throttles don't kick in as often. llvm-svn: 106396
* Don't include things in anonymous namespaces that don't need it.Dan Gohman2010-06-191-0/+4
| | | | llvm-svn: 106395
* Don't track users of undef values; they aren't interesting forDan Gohman2010-06-041-1/+5
| | | | | | register pressure. llvm-svn: 105501
* DominatorTree.getNode can return null for unreachable blocks.Dan Gohman2010-05-201-1/+1
| | | | llvm-svn: 104290
* Minor code cleanups.Dan Gohman2010-05-201-8/+7
| | | | llvm-svn: 104287
* Make Solve check its own post-condition, to reduce clutter in theDan Gohman2010-05-201-1/+2
| | | | | | top-level LSRInstance logic. llvm-svn: 104278
* Add comments.Dan Gohman2010-05-201-0/+16
| | | | llvm-svn: 104276
* More code cleanups. Use iterators instead of indices when indicesDan Gohman2010-05-201-22/+24
| | | | | | aren't needed. llvm-svn: 104273
* Fix OptimizeShadowIV to set Changed. Change OptimizeLoopTermCond to setDan Gohman2010-05-201-8/+7
| | | | | | | | | Changed directly instead of using a return value. Rename FilterOutUndesirableDedicatedRegisters's Changed variable to distinguish it from LSRInstance's Changed member. llvm-svn: 104269
* Add some comments.Dan Gohman2010-05-201-0/+6
| | | | llvm-svn: 104268
* Simplify this code. Don't do a DomTreeNode lookup for each visited block.Dan Gohman2010-05-201-14/+5
| | | | llvm-svn: 104267
* Minor code cleanups.Dan Gohman2010-05-201-20/+11
| | | | llvm-svn: 104263
* When canonicalizing icmp operand order to put the loop invariantDan Gohman2010-05-201-0/+1
| | | | | | | | | | | | operand on the left, the interesting operand is on the right. This fixes a bug where LSR was failing to recognize ICmpZero uses, which led it to be unable to reverse the induction variable in the attached testcase. Delete test/CodeGen/X86/stack-color-with-reg-2.ll, because its test is extremely fragile and hard to meaningfully update. llvm-svn: 104262
* Set Changed to true when canonicalizing ICmp operand order; even thoughDan Gohman2010-05-201-0/+1
| | | | | | it isn't a very interesting change, it's a change nonetheless. llvm-svn: 104260
* Rename a variable to avoid shadowing.Dan Gohman2010-05-201-2/+3
| | | | llvm-svn: 104234
* Minor code simplification.Dan Gohman2010-05-201-4/+4
| | | | llvm-svn: 104232
* Move the code for deleting BaseRegs and LSRUses into helper functions,Dan Gohman2010-05-201-5/+22
| | | | | | | and fix a bug that valgrind noticed where the code would std::swap an element with itself. llvm-svn: 104225
* Teach LSR how to cope better with unrolled loops on targets whereDan Gohman2010-05-191-3/+191
| | | | | | | | the addressing modes don't make this trivially easy. This allows it to avoid falling into the less precise heuristics in more cases. llvm-svn: 104186
* Add a comment.Dan Gohman2010-05-181-0/+1
| | | | llvm-svn: 104089
* Fix the predicate which checks for non-sensical formulae which haveDan Gohman2010-05-181-4/+5
| | | | | | constants in registers which partially cancel out their immediate fields. llvm-svn: 104088
* Factor out the code for recomputing an LSRUse's Regs set after someDan Gohman2010-05-181-17/+40
| | | | | | | of its formulae have been removed into a helper function, and also teach it how to update the RegUseTracker. llvm-svn: 104087
* Factor out code for estimating search space complexity into a helperDan Gohman2010-05-181-22/+26
| | | | | | function. llvm-svn: 104082
* Add some more debug output.Dan Gohman2010-05-181-0/+1
| | | | llvm-svn: 104080
* Factor out the code for deleting a formula from an LSRUse intoDan Gohman2010-05-181-4/+9
| | | | | | a helper function. llvm-svn: 104079
* Make some debug output more informative.Dan Gohman2010-05-181-2/+3
| | | | llvm-svn: 104078
* Print an error message in Formula::print if the HasBaseReg flagDan Gohman2010-05-181-0/+7
| | | | | | | is inconsistent with the BaseRegs field. It's not print's job to assert on an invalid condition, but it can make one more obvious. llvm-svn: 104077
* Rename RegUseTracker's RegUses member to RegUsesMap to avoidDan Gohman2010-05-181-7/+7
| | | | | | confusion with LSRInstance's RegUses member. llvm-svn: 104076
* Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!Douglas Gregor2010-05-111-1/+1
| | | | llvm-svn: 103457
* When pruning candidate formulae out of an LSRUse, update theDan Gohman2010-05-071-3/+11
| | | | | | | | | | | | | LSRUse's Regs set after all pruning is done, rather than trying to do it on the fly, which can produce an incomplete result. This fixes a case where heuristic pruning was stripping all formulae from a use, which led the solver to enter an infinite loop. Also, add a few asserts to diagnose this kind of situation. llvm-svn: 103328
* Use getConstant instead of getIntegerSCEV. The two are basically theDan Gohman2010-05-031-12/+11
| | | | | | same, now that getConstant has overloads consistent with ConstantInt::get. llvm-svn: 102965
* Generalize LSR's OptimizeMax to handle the new kinds of max expressionsDan Gohman2010-04-241-10/+43
| | | | | | that indvars may use, now that indvars is recognizing le and ge loops. llvm-svn: 102235
* Fix LSR to tolerate cases where ScalarEvolution initiallyDan Gohman2010-04-231-1/+4
| | | | | | | misses an opportunity to fold add operands, but folds them after LSR has separated them out. This fixes rdar://7886751. llvm-svn: 102157
* Remove the Expr member from IVUsers. Instead of remembering the expression,Dan Gohman2010-04-191-6/+5
| | | | | | | just ask ScalarEvolution for it on demand. This helps IVUsers be more robust in the case of expressions changing underneath it. This fixes PR6862. llvm-svn: 101819
* Delete this code, which is no longer needed.Dan Gohman2010-04-121-4/+0
| | | | llvm-svn: 101033
* When determining a canonical insert position, don't climb deeperDan Gohman2010-04-091-33/+73
| | | | | | | | into adjacent loops. Also, ensure that the insert position is dominated by the loop latch of any loop in the post-inc set which has a latch. llvm-svn: 100906
* When looking for loop-invariant users, look through no-op instructions,Dan Gohman2010-04-091-3/+11
| | | | | | | so that an unfortunately placed bitcast doesn't pin a value in a register. llvm-svn: 100883
* Refactor the code for computing the insertion point for an expression intoDan Gohman2010-04-091-8/+29
| | | | | | a separate function. llvm-svn: 100845
* Avoid allocating a value of zero in a register if the initial formulaDan Gohman2010-04-081-2/+6
| | | | | | inputs happen to negate each other. llvm-svn: 100828
* Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.Dan Gohman2010-04-081-2/+2
| | | | llvm-svn: 100824
OpenPOWER on IntegriCloud