summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Enable SCEV-based unrolling by default.Andrew Trick2011-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | This changes loop unrolling to use the same mechanism for trip count computation as indvars. This is a stronger check that tends to unroll more loops. A very common side-effect is that many single iteration loops will be removed sooner. The real goal was simply to remove dependence on canonical IVs. x86 is break even. ARM performance changes to expect (+ is good): External/SPEC/CFP2000/183.equake/183.equake +13% SingleSource/Benchmarks/Dhrystone/fldry +21% MultiSource/Applications/spiff/spiff +3% SingleSource/Benchmarks/Stanford/Puzzle -14% The Puzzle regression is actually an improvement in loop optimization that defeats GVN: rdar://problem/10065079. llvm-svn: 139009
* Compare type size instead of type _store_ size to make sure that BitCastInstJakub Staszak2011-09-021-2/+2
| | | | | | will be valid. This fixes PR10820. llvm-svn: 139005
* Change worklist driven deletion to be an iterative process.Bill Wendling2011-09-011-16/+7
| | | | | | Duncan noticed this! llvm-svn: 138967
* Fix an issue with the IR sink pass found by inspection. (I'm not sure ↵Eli Friedman2011-09-011-7/+6
| | | | | | anyone is actually using this, but might as well fix it since I found the issue.) llvm-svn: 138965
* Make sure we aren't deleting the landingpad instruction.Bill Wendling2011-08-311-5/+21
| | | | | | | | | The landingpad instruction is required in the landing pad block. Because we're not deleting terminating instructions, the invoke may still jump to here (see Transforms/SCCP/2004-11-16-DeadInvoke.ll). Remove all uses of the landingpad instruction, but keep it around until code-gen can remove the basic block. llvm-svn: 138890
* Remove the old tail duplication pass. It is not used and is unable to updateRafael Espindola2011-08-303-375/+0
| | | | | | | ssa, so it has to be run really early in the pipeline. Any replacement should probably use the SSAUpdater. llvm-svn: 138841
* Speculatively revert r138809 in an attempt to fix DragonEgg.Owen Anderson2011-08-301-2/+1
| | | | llvm-svn: 138829
* When walking backwards to eliminate final stores to allocas at the end of a ↵Owen Anderson2011-08-301-1/+2
| | | | | | function, encountering an unrelated store should not cause us to give up like encountering a load does. llvm-svn: 138809
* Don't sink landingpad instructions during ind-var simplification.Bill Wendling2011-08-261-0/+4
| | | | llvm-svn: 138651
* 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-252-5/+6
| | | | | | 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
* Use getFirstInsertionPt instead of getFirstNonPHI so that it skips to the properBill Wendling2011-08-241-3/+3
| | | | | | insertion place. llvm-svn: 138473
* Add a comment.Dan Gohman2011-08-221-0/+4
| | | | llvm-svn: 138243
* Constant pointers to objects don't need reference counting.Dan Gohman2011-08-221-0/+13
| | | | llvm-svn: 138242
* The landingpad instruction isn't dead simply because it's value isn't used.Bill Wendling2011-08-191-1/+1
| | | | llvm-svn: 138102
* Make a bunch of symbols private.Benjamin Kramer2011-08-191-2/+2
| | | | llvm-svn: 138025
* Track a retain+release nesting level independently of theDan Gohman2011-08-191-36/+64
| | | | | | | | known-incremented level, because the two concepts can be used to prove the saftey of a retain+release removal in different ways. llvm-svn: 138016
* Use 'getFirstInsertionPt' when trying to insert new instructions during LICM.Bill Wendling2011-08-181-3/+3
| | | | llvm-svn: 138008
* Make it clear that this code is iterating in reverse order through the array.Dan Gohman2011-08-181-2/+3
| | | | llvm-svn: 137985
* Dramatically speedup codegen prepare by a) avoiding use of dominator tree ↵Devang Patel2011-08-181-16/+38
| | | | | | and b) doing a separate pass over dbg.value instructions. llvm-svn: 137908
* Atomic load/store handling for the passes using memdep (GVN, DSE, memcpyopt).Eli Friedman2011-08-173-9/+11
| | | | llvm-svn: 137888
* Disable PRE for landing pads.Bill Wendling2011-08-171-2/+14
| | | | | | | | PRE needs the landing pads to have their critical edges split. Doing this for a landing pad is non-trivial. Abandon the attempt to perform PRE when we come across a landing pad. (Reviewed by Owen!) llvm-svn: 137876
* Silly mistake from r137777; restore significant isStructTy() checks. While ↵Eli Friedman2011-08-171-4/+19
| | | | | | | | | | here, be a bit more defensive with unknown instructions. Fixes PR10687. llvm-svn: 137836
* A bunch of misc fixes to SCCPSolver::ResolvedUndefsIn, including a fix to stopEli Friedman2011-08-161-40/+72
| | | | | | | | | making random bad assumptions about instructions which are not explicitly listed. Includes fix for rdar://9956541, a version of "undef ^ undef should return 0 because it's easier than arguing with users". llvm-svn: 137777
* Minor bug in SCCP found by inspection. (I don't think it's possible to hit ↵Eli Friedman2011-08-161-0/+7
| | | | | | this with a normal pass pipeline, but fixing for completeness.) llvm-svn: 137755
* Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>'Bill Wendling2011-08-161-13/+6
| | | | | | check for a LandingPadInst. llvm-svn: 137745
* In places where it's using "getFirstNonPHI", skip the landingpad instruction ↵Bill Wendling2011-08-151-5/+8
| | | | | | if necessary. llvm-svn: 137679
* Atomic load/store support in LICM.Eli Friedman2011-08-151-6/+10
| | | | llvm-svn: 137648
* Skip the insertion iterator past the landingpad instruction if there.Bill Wendling2011-08-151-0/+1
| | | | llvm-svn: 137626
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-121-0/+1
| | | | | | | | | | | | This implements the 'landingpad' instruction. It's used to indicate that a basic block is a landing pad. There are several restrictions on its use (see LangRef.html for more detail). These restrictions allow the exception handling code to gather the information it needs in a much more sane way. This patch has the definition, implementation, C interface, parsing, and bitcode support in it. llvm-svn: 137501
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-121-1/+1
| | | | | | when building with assertions disabled. llvm-svn: 137460
* Don't convert objc_autoreleaseReturnValue to objc_autorelease if the resultDan Gohman2011-08-121-6/+13
| | | | | | is returned through a bitcast. llvm-svn: 137402
* Don't let arbitrary calls disrupt nested retain+release pairs ifDan Gohman2011-08-121-56/+78
| | | | | | | | | the retains and releases all use the same SSA pointer value. Also, don't let CFG hazards disrupt nested retain+release pair optimizations. llvm-svn: 137399
* Use an actual reverse-CFG reverse-postorder for the bottom-up traversal,Dan Gohman2011-08-121-16/+30
| | | | | | | rather than plain postorder, so that CFG constructs like single-exit loops are reliably visited in a sensible order. llvm-svn: 137398
* Allow loop unrolling to get known trip counts from ScalarEvolution.Andrew Trick2011-08-111-7/+23
| | | | | | | | | | | | | SCEV unrolling can unroll loops with arbitrary induction variables. It is a prerequisite for -disable-iv-rewrite performance. It is also easily handles loops of arbitrary structure including multiple exits and is generally more robust. This is under a temporary option to avoid affecting default behavior for the next couple of weeks. It is needed so that I can checkin unit tests for updateUnloop. llvm-svn: 137384
* Fix typos in comments, and delete an unused function.Dan Gohman2011-08-111-6/+2
| | | | llvm-svn: 137352
* Invoke SimplifyIndVar when we partially unroll a loop. Fixes PR10534.Andrew Trick2011-08-101-4/+1
| | | | llvm-svn: 137203
* Cleanup. Make ScalarEvolution an explicit argument of theAndrew Trick2011-08-101-2/+2
| | | | | | SimplifyIndVar utility since it is required. llvm-svn: 137202
* Added a SimplifyIndVar utility to simplify induction variable usersAndrew Trick2011-08-101-328/+48
| | | | | | | | | | | | | | | | based on ScalarEvolution without changing the induction variable phis. This utility is the main tool of IndVarSimplifyPass, but the pass also restructures induction variables in strange ways that are sensitive to pass ordering. This provides a way for other loop passes to simplify new uses of induction variables created during transformation. The utility may be used by any pass that preserves ScalarEvolution. Soon LoopUnroll will use it. The net effect in this checkin is to cleanup the IndVarSimplify pass by factoring out the SimplifyIndVar algorithm into a standalone utility. llvm-svn: 137197
* Representation of 'atomic load' and 'atomic store' in IR.Eli Friedman2011-08-091-0/+17
| | | | llvm-svn: 137170
* Made SCEV's UDiv expressions more canonical. When dividing aAndrew Trick2011-08-061-0/+65
| | | | | | | | | | | | | | | | | | | | | | | recurrence, the initial values low bits can sometimes be ignored. To take advantage of this, added FoldIVUser to IndVarSimplify to fold an IV operand into a udiv/lshr if the operator doesn't affect the result. -indvars -disable-iv-rewrite now transforms i = phi i4 i1 = i0 + 1 idx = i1 >> (2 or more) i4 = i + 4 into i = phi i4 idx = i0 >> ... i4 = i + 4 llvm-svn: 137013
* Fix an obvious type. Patch by Ivan Krasin.Evan Cheng2011-08-041-1/+1
| | | | llvm-svn: 136900
* Add new atomic instructions to SCCP. No functional change, but stops debug ↵Eli Friedman2011-08-021-0/+2
| | | | | | spam. llvm-svn: 136723
* Revert r136503 and r136480 in an effort to fix non-determinism in the ↵Owen Anderson2011-08-021-22/+1
| | | | | | llvm-gcc buildbots on i386. Devang is looking into the root cause. llvm-svn: 136674
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-311-0/+1
| | | | | | | | | This adds the 'resume' instruction class, IR parsing, and bitcode reading and writing. The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with a 'landingpad' instruction (to be added later). llvm-svn: 136589
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-301-2/+0
| | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. llvm-svn: 136556
* Clear DbgValues in the end.Devang Patel2011-07-291-0/+1
| | | | llvm-svn: 136503
* Clean up debug info after reassociation.Devang Patel2011-07-291-1/+21
| | | | llvm-svn: 136480
* Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to beEli Friedman2011-07-291-0/+74
| | | | | | | | | working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) llvm-svn: 136457
OpenPOWER on IntegriCloud