summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit message (Collapse)AuthorAgeFilesLines
* LSR: rewrite inner loops only.Andrew Trick2011-09-291-5/+21
| | | | | | | | Rewriting the entire loop nest now requires -enable-lsr-nested. See PR11035 for some performance data. A few unit tests specifically test nested LSR, and are now under a flag. llvm-svn: 140762
* Disable LSR retry by default.Andrew Trick2011-09-271-0/+16
| | | | | | | Disabling aggressive LSR saves compilation time, and with the new indvars behavior usually improves performance. llvm-svn: 140590
* LSR, one of the new Cost::isLoser() checks did not get merged in the ↵Andrew Trick2011-09-261-2/+6
| | | | | | previous checkin. llvm-svn: 140583
* LSR cost metric minor fix and verification.Andrew Trick2011-09-261-3/+26
| | | | | | | | The minor bug heuristic was noticed by inspection. I added the isLoser/isValid helpers because they will become more important with subsequent checkins. llvm-svn: 140580
* LSR minor bug fix in RateRegister.Andrew Trick2011-09-231-1/+1
| | | | | | | No test case. Noticed by inspection and I doubt it ever affects the outcome of the overall heuristic, let alone final codegen. llvm-svn: 140431
* LSR wants to split the landing pad's critical edge. Let it do it, but use theBill Wendling2011-08-251-1/+8
| | | | | | proper function to do it. llvm-svn: 138550
* When inserting new instructions, use getFirstInsertionPt instead ofBill Wendling2011-08-251-3/+4
| | | | | | getFirstNonPHI so that it will skip over the landingpad instructions as well. llvm-svn: 138537
* Skip the landingpad instruction when determining the insertion point.Bill Wendling2011-08-241-0/+3
| | | | llvm-svn: 138481
* LSR, correct fix for rdar://9786536. Silly casting bug.Andrew Trick2011-07-211-2/+2
| | | | llvm-svn: 135654
* LSR must sometimes sign-extend before generating double constants.Andrew Trick2011-07-211-3/+10
| | | | | | rdar://9786536 llvm-svn: 135650
* LSR crashes on an empty IVUsers list.Andrew Trick2011-07-211-0/+3
| | | | | | rdar://9786536 llvm-svn: 135644
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-37/+37
| | | | llvm-svn: 135375
* start using the new helper methods a bit.Chris Lattner2011-07-151-1/+1
| | | | llvm-svn: 135251
* SCEVExpander: give new insts a name that identifies the reponsible pass.Andrew Trick2011-06-281-1/+1
| | | | llvm-svn: 133992
* IVUsers no longer needs to record the phis.Andrew Trick2011-06-211-2/+1
| | | | llvm-svn: 133518
* When checking for signed multiplication overflow, watch out for INT_MIN and -1.Dan Gohman2011-05-231-0/+2
| | | | | | This fixes PR9845. llvm-svn: 131919
* indvars: Prototyping Sign/ZeroExtend elimination without canonical IVs.Andrew Trick2011-05-201-1/+2
| | | | | | | | | | No functionality enabled by default. Use -disable-iv-rewrite. Extended IVUsers to keep track of the phi that represents the users' IV. Added the WidenIV transform to replace a narrow IV with a wide IV by doing a one-for-one replacement of IV users instead of expanding the SCEV expressions. [sz]exts are removed and truncs are inserted. llvm-svn: 131744
* When forming an ICmpZero LSRUse, normalize the non-IV operandDan Gohman2011-05-181-0/+4
| | | | | | | of the comparison, so that the resulting expression is fully normalized. This fixes PR9939. llvm-svn: 131576
* Add an unfolded offset field to LSR's Formula record. This is used toDan Gohman2011-05-031-9/+62
| | | | | | | | model constants which can be added to base registers via add-immediate instructions which don't require an additional register to materialize the immediate. llvm-svn: 130743
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-2/+2
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Reapply r129401 with patch for clang.Bill Wendling2011-04-131-3/+0
| | | | llvm-svn: 129419
* Revert r129401 for now. Clang is using the old way of doing things.Bill Wendling2011-04-121-0/+3
| | | | llvm-svn: 129403
* Remove the unaligned load intrinsics in favor of using native unaligned loads.Bill Wendling2011-04-121-3/+0
| | | | | | | | | Now that we have a first-class way to represent unaligned loads, the unaligned load intrinsics are superfluous. First part of <rdar://problem/8460511>. llvm-svn: 129401
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-2/+1
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-301-0/+1
| | | | llvm-svn: 128535
* Added SCEV::NoWrapFlags to manage unsigned, signed, and self wrapAndrew Trick2011-03-141-6/+16
| | | | | | | | | properties. Added the self-wrap flag for SCEV::AddRecExpr. A slew of temporary FIXMEs indicate the intention of the no-self-wrap flag without changing behavior in this revision. llvm-svn: 127590
* If we can't avoid running loop-simplify twice for now, at least avoid runningCameron Zwarich2011-02-101-0/+3
| | | | | | iv-users twice. llvm-svn: 125318
* Revert this in an attempt to bring the builders back.Eric Christopher2011-02-101-4/+4
| | | | llvm-svn: 125257
* Turn this pass ordering:Cameron Zwarich2011-02-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Natural Loop Information Loop Pass Manager Canonicalize natural loops Scalar Evolution Analysis Loop Pass Manager Induction Variable Users Canonicalize natural loops Induction Variable Users Loop Strength Reduction into this: Scalar Evolution Analysis Loop Pass Manager Canonicalize natural loops Induction Variable Users Loop Strength Reduction This fixes <rdar://problem/8869639>. I also filed PR9184 on doing this sort of thing automatically, but it seems easier to just change the ordering of the passes if this is the only case. llvm-svn: 125254
* Don't split any loop backedges, including backedges of loops other thanDan Gohman2011-02-081-15/+17
| | | | | | | | the active loop. This is generally desirable, and it avoids trouble in situations such as the testcase in PR9123, though the failure mode depends on use-list order, so it is infeasible to test. llvm-svn: 125065
* Remove code for updating dominance frontiers and some outdated references toCameron Zwarich2011-01-181-1/+0
| | | | | | dominance and post-dominance frontiers. llvm-svn: 123725
* split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner2011-01-021-0/+1
| | | | | | so that Dominators.h is *just* domtree. Also prune #includes a bit. llvm-svn: 122714
* Move SCEV::dominates and properlyDominates to ScalarEvolution.Dan Gohman2010-11-171-13/+11
| | | | llvm-svn: 119570
* Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be memberDan Gohman2010-11-171-5/+5
| | | | | | | functions of ScalarEvolution, in preparation for memoization and other optimizations. llvm-svn: 119562
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-191-2/+2
| | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. llvm-svn: 116854
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+9
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Filter out illegal formulae after updating offsets, not before, so thatDan Gohman2010-10-081-18/+18
| | | | | | | | | | formulae which become illegal as a result of the offset updating don't escape. This is for rdar://8529692. No testcase yet, because the given cases hit use-list ordering differences. llvm-svn: 116093
* Delete the FormulaSorter class and inline its one method into itsDan Gohman2010-10-071-28/+10
| | | | | | | one user. This code will be restructured soon and FormulaSorter is getting in the way. llvm-svn: 116012
* Fix a spello.Dan Gohman2010-10-071-1/+1
| | | | llvm-svn: 116011
* Charge a formula for explicit multiplies on scaled registers too,Dan Gohman2010-10-071-3/+3
| | | | | | not just base registers. llvm-svn: 116010
* Use size_t for consistency.Dan Gohman2010-10-071-1/+1
| | | | llvm-svn: 116009
* When merging one use into another, transfer the offsets fromDan Gohman2010-10-071-0/+8
| | | | | | the old use to the new one. llvm-svn: 116008
* Fix LSR to keep the RegUseTracker up to date when combining users.Dan Gohman2010-10-071-8/+19
| | | | | | | | This doesn't usually matter, because the other heuristics usually succeed regardless, but it's good to keep the register use bookkeeping consistent. llvm-svn: 116005
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Delete an unused function.Dan Gohman2010-09-271-2/+0
| | | | llvm-svn: 114841
* do not rely on the implicit-dereference semantics of dyn_cast_or_nullGabor Greif2010-09-181-1/+1
| | | | llvm-svn: 114278
* Revert 112442 and 112440 until the compile time problems introducedDan Gohman2010-09-011-106/+50
| | | | | | by 112440 are resolved. llvm-svn: 112692
* Optionally rerun dedicated-register filtering after applyingDan Gohman2010-08-291-0/+20
| | | | | | | other filtering techniques, as those may allow it to filter out more obviously unprofitable candidates. llvm-svn: 112441
* Fix several areas in LSR to do a better job keeping the mainDan Gohman2010-08-291-50/+106
| | | | | | | | LSRInstance data structures up to date. This fixes some pessimizations caused by stale data which will be exposed in an upcoming change. llvm-svn: 112440
OpenPOWER on IntegriCloud