Dan Gohman
0f8f7f179d
Add Loop contains utility methods for testing whether a loop
...
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.
llvm-svn: 91654
2009-12-18 01:24:09 +00:00
Dan Gohman
3c155aa3cd
Update various Loop optimization passes to cope with the possibility that
...
LoopSimplify form may not be available.
llvm-svn: 86175
2009-11-05 21:11:53 +00:00
Nick Lewycky
cacdc4d65a
Remove ICmpInst::isSignedPredicate which was a reimplementation
...
CmpInst::isSigned.
llvm-svn: 85037
2009-10-25 05:20:17 +00:00
Chris Lattner
5f54c5bd1c
eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
...
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Chris Lattner
f37893e7a1
Fix PR3913, patch by Jakub Staszak!
...
llvm-svn: 80327
2009-08-28 00:43:14 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson
cc33e89571
Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
...
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson
49226b1075
This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
...
llvm-svn: 75200
2009-07-09 23:48:35 +00:00
Owen Anderson
121f736d9c
"LLVMContext* " --> "LLVMContext *"
...
llvm-svn: 74878
2009-07-06 23:00:19 +00:00
Owen Anderson
6795819c9e
Second batch of passes using LLVMContext.
...
llvm-svn: 74753
2009-07-03 00:54:20 +00:00
Dan Gohman
28702fab4e
Don't try to split a loop when the controlling icmp instruction
...
doesn't have an IV-based operand. This fixes PR4471.
llvm-svn: 74399
2009-06-27 22:58:27 +00:00
Dan Gohman
2e737ac21f
Support vector casts in more places, fixing a variety of assertion
...
failures.
To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.
Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.
llvm-svn: 73431
2009-06-15 22:12:54 +00:00
Eli Friedman
334cc4e389
Fix loop-index-split to correctly preserve dominance frontiers. Part of
...
PR4238.
llvm-svn: 72244
2009-05-22 03:22:46 +00:00
Duncan Sands
880eaf5278
Allow readonly functions to unwind exceptions. Teach
...
the optimizers about this. For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.
llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Dan Gohman
8b1b8d5891
Reword and tidy up some comments.
...
llvm-svn: 70416
2009-04-29 22:01:05 +00:00
Owen Anderson
f127f4a7a9
LoopIndexSplit needs to inform the loop pass manager of the instructions it is
...
deleting, not just the basic block.
llvm-svn: 69011
2009-04-14 01:04:19 +00:00
Devang Patel
ec65625744
Loop Index Split can eliminate a loop if it can determin if loop body is executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it.
...
llvm-svn: 68071
2009-03-30 22:24:10 +00:00
Devang Patel
8c31ea5290
Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block.
...
llvm-svn: 67719
2009-03-25 23:57:48 +00:00
Devang Patel
e98e6bc27c
If branch conditions' one successor is dominating another non-latch successor then this loop's iteration space can not be restricted. In this example block bb5 is always executed.
...
llvm-svn: 65902
2009-03-02 23:39:14 +00:00
Dan Gohman
ced54f0173
LoopIndexSplit doesn't actually use ScalarEvolution.
...
llvm-svn: 64811
2009-02-17 20:50:11 +00:00
Dan Gohman
f74d17b36a
Add a utility function to LoopInfo to return the exit block
...
when the loop has exactly one exit, and make use of it in
LoopIndexSplit.
llvm-svn: 64388
2009-02-12 18:08:24 +00:00
Devang Patel
85ae609834
Ignore DbgInfoIntrinsics.
...
llvm-svn: 63923
2009-02-06 06:19:06 +00:00
Devang Patel
a8d0117253
Fix spelling.
...
Thanks Duncan!
llvm-svn: 60702
2008-12-08 17:07:24 +00:00
Devang Patel
4fcea36b8b
Rewrite code that 1) filters loops and 2) calculates new loop bounds.
...
This fixes many bugs. I will add more test cases in a separate check-in.
Some day, the code that manipulates CFG and updates dom. info could use refactoring help.
llvm-svn: 60554
2008-12-04 21:38:42 +00:00
Devang Patel
f0d6bd18d5
If the sign of exit condition and split condition does not match
...
then do not split loop index.
llvm-svn: 58995
2008-11-10 19:48:34 +00:00
Daniel Dunbar
5447f9679d
Change create*Pass factory functions to return Pass* instead of
...
LoopPass*.
- Although less precise, this means they can be used in clients
without RTTI (who would otherwise need to include LoopPass.h, which
eventually includes things using dynamic_cast). This was the
simplest solution that presented itself, but I am happy to use a
better one if available.
llvm-svn: 58010
2008-10-22 23:32:42 +00:00
Devang Patel
255fee3bce
Check loop exit predicate properly while eliminating one iteration loop.
...
This patch fixes PR 2869
llvm-svn: 57369
2008-10-10 22:02:57 +00:00
Devang Patel
378c8633e5
Fix typo, fix PR 2865.
...
llvm-svn: 57221
2008-10-06 23:22:54 +00:00
Devang Patel
1e7ddf5d31
splitLoop does not handle split condition EQ.
...
Fixes PR 2805
llvm-svn: 56321
2008-09-18 23:45:14 +00:00
Devang Patel
50c22bf69b
Do not ignore iv uses outside the loop.
...
This one slipped through cracks very well.
llvm-svn: 56284
2008-09-17 17:53:47 +00:00
Dan Gohman
e1f9be27bc
Tidy up several unbeseeming casts from pointer to intptr_t.
...
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Dan Gohman
027326ba3e
Use empty() instead of begin() == end().
...
llvm-svn: 54780
2008-08-14 18:13:49 +00:00
Devang Patel
2b56d5281d
If loop induction variable's start value is less then its exit value then do not split the loop.
...
llvm-svn: 53265
2008-07-09 00:12:01 +00:00
Dan Gohman
e9f0a28c64
Fix a typo in a comment.
...
llvm-svn: 52687
2008-06-24 18:00:21 +00:00
Devang Patel
9f385d71c2
Do not erase induction variable increment if it is used outside the loop.
...
llvm-svn: 51280
2008-05-19 22:23:55 +00:00
Gabor Greif
d61f20217a
API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
...
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Dan Gohman
bab18cae46
Clean up the use of static and anonymous namespaces. This turned up
...
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Bill Wendling
277f2a205d
Porting r50563 from Tak to mainline.
...
llvm-svn: 50564
2008-05-02 00:43:20 +00:00
Gabor Greif
6c6b8a57f3
API changes for class Use size reduction, wave 1.
...
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277
2008-04-06 20:25:17 +00:00
David Greene
0ca05878fe
Iterators folloring a SmallVector erased element are invalidated so
...
don't access cached iterators from after the erased element.
Re-apply 49056 with SmallVector support.
llvm-svn: 49106
2008-04-02 18:24:46 +00:00
Tanya Lattner
221aec3ddb
Reverting 49056 due to the build being broken.
...
llvm-svn: 49060
2008-04-01 23:41:44 +00:00
David Greene
f322cc7462
Iterators folloring a SmallVector erased element are invalidated so
...
don't access cached iterators from after the erased element.
llvm-svn: 49056
2008-04-01 22:14:23 +00:00
Devang Patel
85770c83ba
PHI->removeIncomingValue may remove PHInode.
...
Increment iterator in advance.
llvm-svn: 48890
2008-03-27 17:32:46 +00:00
Devang Patel
425514c509
Add incoming value from header only if phi node has any use inside the loop.
...
llvm-svn: 48738
2008-03-24 20:16:14 +00:00
Devang Patel
8af92b942c
If loop header is also loop exiting block then OrigPN is incoming value for B loop header.
...
Fixes PR 2030.
llvm-svn: 47141
2008-02-14 23:18:47 +00:00
Devang Patel
38de2d11a5
A loop latch phi node may have uses inside loop, not just in loop header.
...
llvm-svn: 47093
2008-02-13 22:23:07 +00:00
Devang Patel
1e71afe2df
While moving exit condition, do not drop loop latch on the floor.
...
llvm-svn: 47089
2008-02-13 22:06:36 +00:00
Devang Patel
d48bbbf07b
Keep track of exit value operand number when operands are swapped.
...
llvm-svn: 47082
2008-02-13 19:48:48 +00:00
Devang Patel
9aba178666
Fix PR 1995.
...
llvm-svn: 46898
2008-02-08 22:49:13 +00:00