summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused counter.Devang Patel2008-09-081-1/+0
| | | | llvm-svn: 55924
* Remove OptimizeIVType()Devang Patel2008-09-081-206/+0
| | | | llvm-svn: 55913
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Add additional check to ensure that iv is canonicalized.Devang Patel2008-09-031-0/+1
| | | | llvm-svn: 55682
* Check iteration count.Devang Patel2008-09-031-0/+4
| | | | llvm-svn: 55680
* While removing PHI, use basicblock to identify incoming value.Devang Patel2008-09-031-2/+3
| | | | llvm-svn: 55678
* If all IV uses are extending integer IV then change the type of IV itself, ↵Devang Patel2008-09-021-0/+201
| | | | | | if possible. llvm-svn: 55674
* Do not apply the transformation if the target does not support DestTy natively.Devang Patel2008-08-271-2/+9
| | | | llvm-svn: 55433
* Fix typos and whitespaces. Other cosmetic changes based on feedback.Devang Patel2008-08-271-12/+9
| | | | llvm-svn: 55424
* If IV is used in a int-to-float cast inside the loop then try to eliminate ↵Devang Patel2008-08-261-2/+118
| | | | | | the cast operation. llvm-svn: 55374
* Revert 54821. It's miscompiling 252.eon and 447.dealIIEvan Cheng2008-08-171-118/+1
| | | | llvm-svn: 54878
* Reapply 54786. Add overflow and number of mantissa bits checks.Devang Patel2008-08-151-1/+118
| | | | llvm-svn: 54821
* Revert 54786. It's not checking for overflows, etc.Evan Cheng2008-08-151-101/+0
| | | | llvm-svn: 54813
* If IV is used in a int-to-float cast inside the loop then try to eliminate ↵Devang Patel2008-08-141-0/+101
| | | | | | the cast opeation. llvm-svn: 54786
* Rename. s/FindIVForUser/FindIVUserForCond/gDevang Patel2008-08-131-4/+4
| | | | llvm-svn: 54754
* Check sign to detect overflow before changing compare stride.Devang Patel2008-08-131-1/+8
| | | | llvm-svn: 54710
* Fix PR2355: bug in ChangeCompareStride. When the loop termination compare is ↵Evan Cheng2008-08-061-2/+2
| | | | | | the only use of its iv stride, the stride can be eliminated by moving it to another stride. If the scale is negative, swap the predicate instead of using a inverse predicate. llvm-svn: 54415
* Fix a bug in LSR's dead-PHI cleanup. If a PHI has a def-use chain thatDan Gohman2008-07-211-0/+5
| | | | | | | | | leads into a cycle involving a different PHI, LSR got stuck running around that cycle looking for the original PHI. To avoid this, keep track of visited PHIs and stop searching if we see one more than once. This fixes PR2570. llvm-svn: 53879
* Fix uninitialized use of the Changed variable.Dan Gohman2008-07-141-0/+2
| | | | llvm-svn: 53564
* Fix two serious LSR bugs.Evan Cheng2008-07-071-37/+37
| | | | | | | 1. LSR runOnLoop is always returning false regardless if any transformation is made. 2. AddUsersIfInteresting can create new instructions that are added to DeadInsts. But there is a later early exit which prevents them from being freed. llvm-svn: 53193
* Fix spelling and grammar in a comment.Dan Gohman2008-06-231-2/+2
| | | | llvm-svn: 52648
* Improve LSR's dead-phi detection to handle use-def cyclesDan Gohman2008-06-221-20/+17
| | | | | | with more than two nodes. llvm-svn: 52617
* Move LSR's private isZero function to a public SCEV memberDan Gohman2008-06-181-17/+7
| | | | | | function, and make use of it in several places. llvm-svn: 52463
* Refine the change in r52258 for avoiding use-before-def conditionsDan Gohman2008-06-161-9/+12
| | | | | | | | | when changing the stride of a comparison so that it's slightly more precise, by having it scan the instruction list to determine if there is a use of the condition after the point where the condition will be inserted. llvm-svn: 52371
* Switch over to SetVector to ensure same order of iterations do not vary ↵Evan Cheng2008-06-161-8/+9
| | | | | | across runs. llvm-svn: 52361
* Iterating over SmallPtrSet is not deterministic.Evan Cheng2008-06-161-6/+6
| | | | llvm-svn: 52339
* Protect ChangeCompareStride from situations in which it is possibleDan Gohman2008-06-131-3/+12
| | | | | | for it to generate use-before-def IR, such as in this testcase. llvm-svn: 52258
* op_iterator-ify some loops, fix 80col violationsGabor Greif2008-06-111-9/+11
| | | | llvm-svn: 52226
* Remove x86.sse2.loadh.pd and x86.sse2.loadl.pd. These will be lowered into ↵Evan Cheng2008-05-241-5/+0
| | | | | | load and shuffle instructions. llvm-svn: 51521
* When LSR is replacing an instruction, callDan Gohman2008-05-211-7/+10
| | | | | | | | | | | | | | | | | | | | ScalarEvolution::deleteValueFromRecords on it before doing the replaceAllUsesWith, because ScalarEvolution looks at the instruction's users to find SCEV references to the instruction's SCEV object in its internal maps. Move all of LSR's loop-related state clearing after processing the loop and before cleaning up dead PHI nodes. This eliminates all of LSR's SCEV references just before the calls to ScalarEvolution::deleteValueFromRecords so that when ScalarEvolution drops its own SCEV references, the reference counts will reach zero and the SCEVs will be deleted immediately. These changes fix some compiler aborts involving ScalarEvolution holding onto and reusing SCEV objects for instructions that have been deleted. No regression test unfortunately; because the symptoms were due to dangling pointers, reduced testcases ended up being fairly arbitrary. llvm-svn: 51359
* Refine the fix in r51169 to only apply when the operand val beingDan Gohman2008-05-201-3/+4
| | | | | | | | replaced is a PHI. This prevents it from inserting uses before defs in the case that it isn't a PHI and it depends on other instructions later in the block. This fixes the 447.dealII regression on x86-64. llvm-svn: 51292
* Fix a bug in LoopStrengthReduce that caused it to emit IR withDan Gohman2008-05-151-3/+21
| | | | | | | | | | | | | | | | | use-before-def. The problem comes up in code with multiple PHIs where one PHI is being rewritten in terms of the other, but the other needs to be casted first. LLVM rules requre the cast instruction to be inserted after any PHI instructions, but when instructions were inserted to replace the second PHI value with a function of the first, they were ended up going before the cast instruction. Avoid this problem by remembering the location of the cast instruction, when one is needed, and inserting the expansion of the new value after it. This fixes a bug that surfaced in 255.vortex on x86-64 when instcombine was removed from the middle of the loop optimization passes. llvm-svn: 51169
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-2/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Minor whitespace and comment cleanups.Dan Gohman2008-04-141-3/+3
| | | | llvm-svn: 49671
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-1/+1
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Remove dead options.Evan Cheng2008-03-191-13/+3
| | | | llvm-svn: 48556
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46514
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Clean up previous patch: PHI uses should not prevent iv reuse if all other ↵Evan Cheng2007-12-201-35/+16
| | | | | | uses are addresses. This trades a constant multiply for one fewer iv. llvm-svn: 45251
* Allow iv reuse if the user is a PHI node which is in turn used as addresses.Evan Cheng2007-12-191-29/+82
| | | | llvm-svn: 45230
* Remove indeterminism from a loop. We think this willDale Johannesen2007-11-171-2/+6
| | | | | | | fix an occasional nonrepeatable bootstrap failure we've been seeing on Darwin. llvm-svn: 44202
* At end of LSR, replace uses of now constant (as result of SplitCriticalEdge) ↵Evan Cheng2007-10-301-9/+33
| | | | | | PHI node with the constant value. llvm-svn: 43533
* It's not safe to tell SplitCriticalEdge to merge identical edges. It may ↵Evan Cheng2007-10-301-11/+9
| | | | | | delete the phi instruction that's being processed. llvm-svn: 43524
* - Bug fixes.Evan Cheng2007-10-291-10/+38
| | | | | | - Allow icmp rewrite using an iv / stride of a smaller integer type. llvm-svn: 43480
* Update a comment to reflect the current code.Dan Gohman2007-10-291-2/+2
| | | | llvm-svn: 43463
* Remove an unused function argument.Dan Gohman2007-10-291-6/+6
| | | | llvm-svn: 43462
* Fix a typo in a comment.Dan Gohman2007-10-291-1/+1
| | | | llvm-svn: 43461
* Avoid calling ValidStride when not all uses are addresses.Dan Gohman2007-10-291-6/+5
| | | | llvm-svn: 43460
* A number of LSR fixes:Evan Cheng2007-10-261-21/+32
| | | | | | | | | - ChangeCompareStride only reuse stride that is larger than current stride. It will let the general reuse mechanism to try to reuse a smaller stride. - Watch out for multiplication overflow in ChangeCompareStride. - Replace std::set with SmallPtrSet. llvm-svn: 43408
* Fix a crash. Make sure TLI is not null.Evan Cheng2007-10-261-1/+1
| | | | llvm-svn: 43384
OpenPOWER on IntegriCloud