1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

80 Commits

Author SHA1 Message Date
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
Devang Patel
86ff705c22 Filter loops that subtract induction variables.
These loops are not yet handled.

Fix PR 1912.

llvm-svn: 46484
2008-01-29 02:20:41 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Devang Patel
c47f68e747 If ExitValue operand is also defined in Loop header then
insert new ExitValue after this operand definition.

This fixes PR1828.

llvm-svn: 44539
2007-12-03 19:17:21 +00:00
Devang Patel
d98abb62ce Handle multiple induction variables.
This fixes PR714.

llvm-svn: 42309
2007-09-25 18:24:48 +00:00
Devang Patel
f35e6c1181 doh..
llvm-svn: 42300
2007-09-25 17:43:08 +00:00
Devang Patel
de9d1c3654 Add transformation to update loop interation space. Now,
for (i=A; i<N; i++) {
  if (i < X && i > Y)
    do_something();
}

is transformed into

U=min(N,X); L=max(A,Y);
for (i=L;i<U;i++)
  do_somethihg();                            

llvm-svn: 42299
2007-09-25 17:31:19 +00:00
Devang Patel
b741c56cfc Fix PR1692
llvm-svn: 42209
2007-09-21 21:18:19 +00:00
Devang Patel
57b0b31257 Don't increment invalid iterator.
llvm-svn: 42178
2007-09-20 23:01:50 +00:00
Devang Patel
339bee9291 Relax loop ExitCondition predicate restriction.
llvm-svn: 42122
2007-09-19 00:28:47 +00:00
Devang Patel
2883f5cc94 Filter loops where split condition's false branch is not empty. For example
for (int i = 0; i < N; ++i) {
  if (i == somevalue)
    dosomething();
   else
    dosomethingelse();
}

llvm-svn: 42121
2007-09-19 00:15:16 +00:00
Devang Patel
03df2adc31 Bail out early, before modifying anything.
llvm-svn: 42120
2007-09-19 00:11:01 +00:00
Devang Patel
9806df698b Work is incomplete. Loop is not modified at all right now.
llvm-svn: 42119
2007-09-19 00:08:13 +00:00
Devang Patel
578a1ae12a Do not eliminate loop when it is invalid to do so. For example,
for(int i = 0; i < N; i++) {
	if ( i == XYZ) {
		A;
	else
		B;
	}
	C;
	D;
}

llvm-svn: 42058
2007-09-17 21:01:05 +00:00
Devang Patel
14b9a01c02 Skeleton for transformations to truncate loop's iteration space.
llvm-svn: 42054
2007-09-17 20:39:48 +00:00
Bill Wendling
843ac5aebe Temporary reverting r41817
(http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070910/053370.html). It's
causing SPASS to fail.

llvm-svn: 41938
2007-09-14 01:13:55 +00:00
Devang Patel
8f8fe2f0da Avoid negative logic.
llvm-svn: 41829
2007-09-11 01:10:45 +00:00
Devang Patel
9bc265b94a Refactor code into a separate method.
llvm-svn: 41826
2007-09-11 00:42:56 +00:00
Devang Patel
49ffe783eb Clear split info object.
llvm-svn: 41823
2007-09-11 00:23:56 +00:00
Devang Patel
8394964f1a Split condition does not have to be ICmpInst in all cases.
llvm-svn: 41822
2007-09-11 00:12:56 +00:00
Devang Patel
82374f7476 Check all terminators inside loop.
llvm-svn: 41821
2007-09-10 23:57:58 +00:00
Devang Patel
ce76c29be0 Swap exit condition operands if it works.
llvm-svn: 41817
2007-09-10 23:34:06 +00:00
Devang Patel
76790c1b28 Filter exit conditions which are not yet handled.
llvm-svn: 41800
2007-09-10 18:33:42 +00:00
Devang Patel
c649f24384 Use simpler test to filter loops.
llvm-svn: 41516
2007-08-27 21:34:31 +00:00
Devang Patel
cbfa564c1c Move exit condition and exit branch from exiting block into loop header and dominator info. This avoid execution of dead iteration. Loop is already filter in the beginning such that this change is safe.
llvm-svn: 41394
2007-08-25 02:39:24 +00:00
Devang Patel
d961a55c5a Constant split values needs upper bound and lower bound check, just like any other split value.
llvm-svn: 41389
2007-08-25 01:09:14 +00:00
Devang Patel
027410a7aa While calculating upper loop bound for first loop and lower loop bound for second loop, take care of edge cases.
llvm-svn: 41387
2007-08-25 00:56:38 +00:00
Devang Patel
c46dc61548 Fix regression that I caused yesterday night while adding logic to select appropriate split condition branch.
llvm-svn: 41365
2007-08-24 19:32:26 +00:00
Devang Patel
0b351a64db It is not safe to execute split condition's true branch first all the time. If split
condition predicate is GT or GE then execute false branch first.

llvm-svn: 41358
2007-08-24 06:17:19 +00:00
Devang Patel
59af13f0cf Reject ICMP_NE as index split condition.
llvm-svn: 41357
2007-08-24 06:02:25 +00:00
Devang Patel
4b52632179 Tightenup loop filter.
llvm-svn: 41356
2007-08-24 05:36:56 +00:00
Devang Patel
8b1d0a1ad2 Remove incomplete cost analysis.
llvm-svn: 41354
2007-08-24 05:21:13 +00:00
Devang Patel
4ad7c57729 Remove dead code.
llvm-svn: 41295
2007-08-22 21:07:41 +00:00
Devang Patel
798ba45c39 Fix typo.
llvm-svn: 41292
2007-08-22 20:55:18 +00:00
Devang Patel
59b8967a74 Cosmetic change
"True Loop" and "False Loop" naming terminology to refer two loops
after loop cloning is confusing. Instead just use A_Loop and B_Loop.

llvm-svn: 41287
2007-08-22 19:33:29 +00:00
Devang Patel
797fbef078 Refactor loop condition check in a separate function.
llvm-svn: 41282
2007-08-22 18:27:01 +00:00
Devang Patel
7e6f9f4779 Fix thinko.
Starting value of second loop's induction variable can not be lower 
then starting value of original loop's induction variable.

llvm-svn: 41280
2007-08-22 18:07:47 +00:00
Devang Patel
60f5256cd1 Rename bunch of variables.
llvm-svn: 41250
2007-08-21 21:12:02 +00:00
Devang Patel
4fe5509c7d Preserve LCSSA.
llvm-svn: 41246
2007-08-21 19:47:46 +00:00