Devang Patel
17cd20c077
Avoid spliting loops where two split condition branches are not independent.
...
llvm-svn: 41148
2007-08-18 00:00:32 +00:00
Devang Patel
fded73828f
When one branch of condition is eliminated then head of the other
...
branch is not necessary immediate dominators of merge blcok in all cases.
llvm-svn: 41144
2007-08-17 21:59:16 +00:00
Owen Anderson
5173494693
Factor out some code into a helper function.
...
llvm-svn: 41131
2007-08-16 22:51:56 +00:00
Owen Anderson
70ac81f489
Add some more comments to GVN.
...
llvm-svn: 41129
2007-08-16 22:02:55 +00:00
Devang Patel
423d18e306
Dominance frontier is now required.
...
llvm-svn: 41096
2007-08-15 03:34:53 +00:00
Devang Patel
315ea9c519
Cleanup removeBlocks.
...
Use dominance frontier to fixup incoming edges of successor blocks not domianted by DeadBB.
Use df_iterator to walk and delete basic blocks dominated by DeadBB.
llvm-svn: 41095
2007-08-15 03:31:47 +00:00
Reid Spencer
2cfe29fc0b
Remove unneeded header file.
...
llvm-svn: 41094
2007-08-15 03:01:04 +00:00
Devang Patel
b0924a406a
Avoid triangle loops.
...
llvm-svn: 41093
2007-08-15 02:14:55 +00:00
Devang Patel
1dd44d7501
Break infinite loop.
...
llvm-svn: 41091
2007-08-14 23:59:17 +00:00
Devang Patel
d39b9d41bb
Avoid nested loops at the moment.
...
llvm-svn: 41090
2007-08-14 23:53:57 +00:00
Devang Patel
7ff808f08e
Fix dominance frontier update while removing blocks.
...
llvm-svn: 41082
2007-08-14 18:35:57 +00:00
Owen Anderson
b970937b06
Eliminate PHI nodes with constant values during normal GVN processing, even when
...
they're not related to eliminating a load.
llvm-svn: 41081
2007-08-14 18:33:27 +00:00
Owen Anderson
d9a7b61a64
Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.
...
llvm-svn: 41080
2007-08-14 18:16:29 +00:00
Owen Anderson
c855195b2f
Make GVN iterative.
...
llvm-svn: 41078
2007-08-14 18:04:11 +00:00
Owen Anderson
8d15350c4e
Fix a case where GVN was failing to return true when it had, in fact, modified
...
the function.
llvm-svn: 41077
2007-08-14 17:59:48 +00:00
Devang Patel
5d8b2b3293
Handle last value assignments.
...
llvm-svn: 41063
2007-08-14 01:30:57 +00:00
Devang Patel
55b6a8f212
StartValue is already calculated.
...
llvm-svn: 41062
2007-08-14 00:15:45 +00:00
Devang Patel
762259ba73
Preserve simple analysis.
...
llvm-svn: 41054
2007-08-13 22:22:13 +00:00
Devang Patel
e3ea62e49a
Preserve dominator info.
...
llvm-svn: 41053
2007-08-13 22:13:24 +00:00
Devang Patel
d1d0316041
If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.
...
llvm-svn: 41051
2007-08-13 21:59:17 +00:00
Devang Patel
63d1affed8
Split loops and do CFG cleanup.
...
llvm-svn: 41029
2007-08-12 07:02:51 +00:00
Reid Spencer
c71871ba30
Remove unused variables.
...
llvm-svn: 41028
2007-08-12 04:45:36 +00:00
Chris Lattner
50f25115cd
Transform a load from an undef/zero global into an undef/global even if we
...
have complex pointer manipulation going on. This allows us to compile
stuff like this:
__m128i foo(__m128i x){
static const unsigned int c_0[4] = { 0, 0, 0, 0 };
__m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
x = _mm_unpacklo_epi8(x, v_Zero);
return x;
}
into:
_foo:
xorps %xmm1, %xmm1
punpcklbw %xmm1, %xmm0
ret
llvm-svn: 41022
2007-08-11 18:48:48 +00:00
Devang Patel
c8cff19c2e
Clone loop.
...
llvm-svn: 40998
2007-08-10 18:07:13 +00:00
Devang Patel
d412a2a0ed
Add utility to clone loops.
...
llvm-svn: 40997
2007-08-10 17:59:47 +00:00
Devang Patel
b1160475fd
Remove unncessary duplication.
...
llvm-svn: 40979
2007-08-10 00:59:03 +00:00
Devang Patel
23c5e2dcd3
Calculate exit and start value of true loop and false loop respectively.
...
llvm-svn: 40978
2007-08-10 00:53:35 +00:00
Devang Patel
51da0a465a
ExitCondition and Induction variable are loop constraints
...
not split condition constraints.
llvm-svn: 40977
2007-08-10 00:33:50 +00:00
Chris Lattner
3548932573
when we see a unaligned load from an insufficiently aligned global or
...
alloca, increase the alignment of the load, turning it into an aligned load.
This allows us to compile:
#include <xmmintrin.h>
__m128i foo(__m128i x){
static const unsigned int c_0[4] = { 0, 0, 0, 0 };
__m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
x = _mm_unpacklo_epi8(x, v_Zero);
return x;
}
into:
_foo:
punpcklbw _c_0.5944, %xmm0
ret
.data
.lcomm _c_0.5944,16,4 # c_0.5944
instead of:
_foo:
movdqu _c_0.5944, %xmm1
punpcklbw %xmm1, %xmm0
ret
.data
.lcomm _c_0.5944,16,2 # c_0.5944
llvm-svn: 40971
2007-08-09 19:05:49 +00:00
Owen Anderson
3eba1e8f5c
Make NonLocal and None const in the right way. :-)
...
llvm-svn: 40961
2007-08-09 04:42:44 +00:00
Devang Patel
652613b1db
Traverse loop blocks' terminators to find split candidates.
...
llvm-svn: 40960
2007-08-09 01:39:01 +00:00
Devang Patel
30bf54b9d3
Add cost analysis.
...
llvm-svn: 40952
2007-08-08 22:25:28 +00:00
Devang Patel
ed9b08c44f
Preserve dom info while processing one iteration loop.
...
llvm-svn: 40947
2007-08-08 21:39:47 +00:00
Owen Anderson
f988c3ee5c
Change the None and NonLocal markers in memdep to be const.
...
llvm-svn: 40946
2007-08-08 21:39:39 +00:00
Devang Patel
a74e533c5e
Clear split info.
...
llvm-svn: 40944
2007-08-08 21:18:27 +00:00
Devang Patel
4bd07b86ae
Handle multiple split conditions.
...
llvm-svn: 40941
2007-08-08 21:02:17 +00:00
Owen Anderson
04ba98d0f5
Global values also don't undead-ify pointers in our dead alloca's set.
...
llvm-svn: 40936
2007-08-08 19:12:31 +00:00
Owen Anderson
fd772509e9
Make handleEndBlock significantly faster with one trivial improvement,
...
and one hack to avoid hitting a bad case when the alias analysis is imprecise.
llvm-svn: 40935
2007-08-08 18:38:28 +00:00
Owen Anderson
930610cceb
Small improvement: if a function doesn't access memory, we don't need to scan
...
it for potentially undeading pointers.
llvm-svn: 40933
2007-08-08 17:58:56 +00:00
Owen Anderson
ecd9348bd6
Add some comments, remove a dead argument, and simplify some control flow.
...
No functionality change.
llvm-svn: 40932
2007-08-08 17:50:09 +00:00
Owen Anderson
02298f7388
A few more small cleanups.
...
llvm-svn: 40922
2007-08-08 06:06:02 +00:00
Owen Anderson
a9facda8db
First round of cleanups from Chris' feedback.
...
llvm-svn: 40919
2007-08-08 04:52:29 +00:00
Devang Patel
62f8bf41c3
Embrace patch review feedback.
...
llvm-svn: 40915
2007-08-08 01:51:27 +00:00
Devang Patel
08504a95b0
Fix new compare instruction's signness. Caught by Chris during review.
...
llvm-svn: 40912
2007-08-07 23:17:52 +00:00
Owen Anderson
2c98f8ee3c
Don't insert nearly as many redundant phi nodes.
...
llvm-svn: 40909
2007-08-07 23:12:31 +00:00
Devang Patel
92d6834fd7
Use eraseFromParent().
...
llvm-svn: 40903
2007-08-07 17:45:35 +00:00
David Greene
310b0d7e39
Fix comment typo
...
llvm-svn: 40898
2007-08-07 16:52:03 +00:00
David Greene
7eea029403
Fix GLIBCXX_DEBUG error triggered by incrementing erased iterator.
...
llvm-svn: 40897
2007-08-07 16:44:38 +00:00
Devang Patel
228dc09ff6
Begin loop index split pass.
...
llvm-svn: 40883
2007-08-07 00:25:56 +00:00
Nick Lewycky
34cf98c558
It's safe to fold not of fcmp.
...
llvm-svn: 40870
2007-08-06 20:04:16 +00:00