summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Non-affine post-inc SCEV expansions have more code which must beDan Gohman2010-03-021-2/+6
| | | | | | | emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
* Don't attempt load PRE when there is no real redundancy (i.e., the load is inBob Wilson2010-03-021-4/+6
| | | | | | a loop and is itself the only dependency). llvm-svn: 97526
* When GVN needs to split critical edges for load PRE, check all of theBob Wilson2010-03-011-1/+4
| | | | | | | | predecessors before returning. Otherwise, if multiple predecessor edges need splitting, we only get one of them per iteration. This makes a small but measurable compile time improvement with -enable-full-load-pre. llvm-svn: 97521
* MemoryDepAnalysis is not used if redundant load processing is disabled.Evan Cheng2010-03-011-1/+1
| | | | llvm-svn: 97512
* Spelling fixes.Dan Gohman2010-03-012-17/+17
| | | | llvm-svn: 97453
* Revert r97245 which seems to be causing performance problems.Bob Wilson2010-02-281-6/+5
| | | | llvm-svn: 97366
* fix grammaro's pointed out by danielChris Lattner2010-02-271-2/+2
| | | | llvm-svn: 97313
* fix PR6414, a nondeterminism issue in IPSCCP which was becauseChris Lattner2010-02-271-1/+15
| | | | | | of a subtle interation in a loop operating in densemap order. llvm-svn: 97288
* Move the EnableFullLoadPRE flag from a separate command-line option to anBob Wilson2010-02-261-5/+6
| | | | | | argument of createGVNPass and set it automatically for -O3. llvm-svn: 97245
* Remove unused "NoPRE" parameter in GVN and createGVNPass().Bob Wilson2010-02-261-5/+4
| | | | llvm-svn: 97235
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-251-12/+17
| | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. llvm-svn: 97126
* Reapply r97010, the speculative revert failed.Daniel Dunbar2010-02-241-6/+1
| | | | llvm-svn: 97036
* Speculatively revert r97010, "Add an argument to PHITranslateValue to specifyDaniel Dunbar2010-02-241-1/+6
| | | | | | the DominatorTree. ...", in hopes of restoring poor old PPC bootstrap. llvm-svn: 97027
* Add an argument to PHITranslateValue to specify the DominatorTree. If thisBob Wilson2010-02-241-6/+1
| | | | | | | | | | | | | | | | | | | | argument is non-null, pass it along to PHITranslateSubExpr so that it can prefer using existing values that dominate the PredBB, instead of just blindly picking the first equivalent value that it finds on a uselist. Also when the DominatorTree is specified, have PHITranslateValue filter out any result that does not dominate the PredBB. This is basically just refactoring the check that used to be in GetAvailablePHITranslatedSubExpr and also in GVN. Despite my initial expectations, this change does not affect the results of GVN for any testcases that I could find, but it should help compile time. Before this change, if PHITranslateSubExpr picked a value that does not dominate, PHITranslateWithInsertion would then insert a new value, which GVN would later determine to be redundant and would replace. By picking a good value to begin with, we save GVN the extra work of inserting and then replacing a new value. llvm-svn: 97010
* Update memdep when load PRE inserts a new load, and add some debug output.Bob Wilson2010-02-231-0/+2
| | | | | | I don't have a small testcase for this. llvm-svn: 96890
* Erase deleted instructions from GVN's ValueTable. This fixes assertionBob Wilson2010-02-221-0/+7
| | | | | | failures from ValueTable::verifyRemoved() when using -debug. llvm-svn: 96805
* Remove unused variables and parameters.Dan Gohman2010-02-222-44/+24
| | | | llvm-svn: 96780
* When emitting an instruction which depends on both a post-incrementedDan Gohman2010-02-221-2/+4
| | | | | | | | | induction variable value and a loop-variant value, don't force the insert position to be at the post-increment position, because it may not be dominated by the loop-variant value. This fixes a use-before-def problem noticed on PPC. llvm-svn: 96774
* This cast<Instruction> is unnecessary.Dan Gohman2010-02-221-1/+1
| | | | llvm-svn: 96771
* Rename getSDiv to getExactSDiv to reflect its behavior in cases whereDan Gohman2010-02-191-23/+25
| | | | | | the division would have a remainder. llvm-svn: 96693
* Check for overflow when scaling up an add or an addrec forDan Gohman2010-02-191-18/+49
| | | | | | scaled reuse. llvm-svn: 96692
* recommit 96626, evidence that it broke things appearsDale Johannesen2010-02-191-0/+7
| | | | | | to be spurious llvm-svn: 96662
* Revert 96626, which causes build failure on ppc Darwin.Dale Johannesen2010-02-191-7/+0
| | | | llvm-svn: 96653
* When determining the set of interesting reuse factors, considerDan Gohman2010-02-191-9/+15
| | | | | | | | strides in foreign loops. This helps locate reuse opportunities with existing induction variables in foreign loops and reduces the need for inserting new ones. This fixes rdar://7657764. llvm-svn: 96629
* Indvars needs to explicitly notify ScalarEvolution when it is replacingDan Gohman2010-02-181-0/+7
| | | | | | | | a loop exit value, so that if a loop gets deleted, ScalarEvolution isn't stick holding on to dangling SCEVAddRecExprs for that loop. This fixes PR6339. llvm-svn: 96626
* Hoist this loop-invariant logic out of the loop.Dan Gohman2010-02-181-4/+6
| | | | llvm-svn: 96614
* Delete some unneeded casts.Dan Gohman2010-02-171-2/+2
| | | | llvm-svn: 96429
* Don't attempt to divide INT_MIN by -1; consider such cases toDan Gohman2010-02-171-0/+4
| | | | | | have overflowed. llvm-svn: 96428
* Rename SuccessorNumber to GetSuccessorNumber.Bob Wilson2010-02-161-2/+2
| | | | llvm-svn: 96387
* Refactor rewriting for PHI nodes into a separate function.Dan Gohman2010-02-161-49/+70
| | | | llvm-svn: 96382
* Split critical edges as needed for load PRE.Bob Wilson2010-02-161-8/+30
| | | | llvm-svn: 96378
* Refactor to share code to find the position of a basic block successor in theBob Wilson2010-02-161-8/+1
| | | | | | terminator's list of successors. llvm-svn: 96377
* Fix whitespace.Dan Gohman2010-02-161-3/+3
| | | | llvm-svn: 96372
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-1612-235/+235
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Split the main for-each-use loop again, this time for GenerateTruncates,Dan Gohman2010-02-161-1/+4
| | | | | | | as it also peeks at which registers are being used by other uses. This makes LSR less sensitive to use-list order. llvm-svn: 96308
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-156-27/+28
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Fix whitespace.Dan Gohman2010-02-141-1/+1
| | | | llvm-svn: 96179
* Fix a comment.Dan Gohman2010-02-141-1/+1
| | | | llvm-svn: 96178
* When complicated expressions are broken down into subexpressionsDan Gohman2010-02-141-2/+8
| | | | | | | | | | with multiplication by constants distributed through, occasionally those subexpressions can include both x and -x. For now, if this condition is discovered within LSR, just prune such cases away, as they won't be profitable. This fixes a "zero allocated in a base register" assertion failure. llvm-svn: 96177
* Actually, this code doesn't have to be quite so conservative inDan Gohman2010-02-141-6/+5
| | | | | | | the no-TLI case. But it should still default to declining the transformation. llvm-svn: 96152
* Don't attempt aggressive post-inc uses if TargetLowering is not available,Dan Gohman2010-02-141-3/+8
| | | | | | because profitability can't be sufficiently approximated. llvm-svn: 96148
* Make LSR not crash if invoked without target lowering info, e.g. if invokedJohn McCall2010-02-131-2/+2
| | | | | | from opt. llvm-svn: 96135
* remove dead code.Chris Lattner2010-02-131-46/+7
| | | | llvm-svn: 96109
* Split some code out to a helper function (FindReusablePredBB)Chris Lattner2010-02-131-50/+72
| | | | | | | | | | | | and add a doxygen comment. Cache the phi entry to avoid doing tons of PHINode::getBasicBlockIndex calls in the common case. On my insane testcase from re2c, this speeds up CGP from 617.4s to 7.9s (78x). llvm-svn: 96083
* speed up CGP a bit by scanning predecessors through phi operandsChris Lattner2010-02-131-22/+22
| | | | | | instead of with pred_begin/end. llvm-svn: 96078
* Fix a pruning heuristic which implicitly assumed that SmallPtrSet isDan Gohman2010-02-131-45/+68
| | | | | | deterministically sorted. llvm-svn: 96071
* Reapply 95979, a compile-time speedup, now that the bug it exposed is fixed.Dan Gohman2010-02-121-1/+1
| | | | llvm-svn: 96005
* Fix this code to avoid dereferencing an end() iterator inDan Gohman2010-02-121-1/+5
| | | | | | offset distributions it doesn't expect. llvm-svn: 96002
* Revert "Reverse the order for collecting the parts of an addrec. The order", itDaniel Dunbar2010-02-121-1/+1
| | | | | | is breaking llvm-gcc bootstrap. llvm-svn: 95988
* Reverse the order for collecting the parts of an addrec. The orderDan Gohman2010-02-121-1/+1
| | | | | | | doesn't matter, except that ScalarEvolution tends to need less time to fold the results this way. llvm-svn: 95979
OpenPOWER on IntegriCloud