Commit Graph

1933 Commits

Author SHA1 Message Date
Devang Patel
5b8ec614f5 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41095 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 03:31:47 +00:00
Reid Spencer
e9dd95ad9c Remove unneeded header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 03:01:04 +00:00
Devang Patel
3fe4f2135a Avoid triangle loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 02:14:55 +00:00
Devang Patel
4e8061cbda Avoid nested loops at the moment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 23:53:57 +00:00
Devang Patel
a6a8663894 Fix dominance frontier update while removing blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:35:57 +00:00
Owen Anderson
31f496755a Eliminate PHI nodes with constant values during normal GVN processing, even when
they're not related to eliminating a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41081 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:33:27 +00:00
Owen Anderson
36057c7834 Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41080 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:16:29 +00:00
Owen Anderson
3e75a42ee2 Make GVN iterative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:04:11 +00:00
Owen Anderson
8e8278e7fe Fix a case where GVN was failing to return true when it had, in fact, modified
the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41077 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 17:59:48 +00:00
Devang Patel
ada054a9ea Handle last value assignments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 01:30:57 +00:00
Devang Patel
ebcb52aa89 StartValue is already calculated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 00:15:45 +00:00
Devang Patel
21eca2a9cf Preserve simple analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-13 22:22:13 +00:00
Devang Patel
fc4c5f82f8 Preserve dominator info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-13 22:13:24 +00:00
Devang Patel
98147a306e Split loops and do CFG cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41029 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-12 07:02:51 +00:00
Reid Spencer
9626a9c700 Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-12 04:45:36 +00:00
Chris Lattner
8d2e88806b 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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-11 18:48:48 +00:00
Devang Patel
423c8b29b8 Clone loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 18:07:13 +00:00
Devang Patel
acb8c09e27 Remove unncessary duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 00:59:03 +00:00
Devang Patel
23a19f82a7 Calculate exit and start value of true loop and false loop respectively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 00:53:35 +00:00
Devang Patel
bacf5193cf ExitCondition and Induction variable are loop constraints
not split condition constraints.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40977 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 00:33:50 +00:00
Chris Lattner
f2369f2042 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40971 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 19:05:49 +00:00
Owen Anderson
9528f11481 Make NonLocal and None const in the right way. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40961 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 04:42:44 +00:00
Devang Patel
c9d123dca9 Traverse loop blocks' terminators to find split candidates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 01:39:01 +00:00
Devang Patel
9704fcf505 Add cost analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40952 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 22:25:28 +00:00
Devang Patel
787a713bb2 Preserve dom info while processing one iteration loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:39:47 +00:00
Owen Anderson
8cad423d94 Change the None and NonLocal markers in memdep to be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:39:39 +00:00
Devang Patel
9021c7001e Clear split info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40944 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:18:27 +00:00
Devang Patel
71554b8e3c Handle multiple split conditions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:02:17 +00:00
Owen Anderson
838014ee5b Global values also don't undead-ify pointers in our dead alloca's set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 19:12:31 +00:00
Owen Anderson
362bb52108 Make handleEndBlock significantly faster with one trivial improvement,
and one hack to avoid hitting a bad case when the alias analysis is imprecise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 18:38:28 +00:00
Owen Anderson
df359c264e Small improvement: if a function doesn't access memory, we don't need to scan
it for potentially undeading pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 17:58:56 +00:00
Owen Anderson
bb3abf41a8 Add some comments, remove a dead argument, and simplify some control flow.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 17:50:09 +00:00
Owen Anderson
c182f17aed A few more small cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 06:06:02 +00:00
Owen Anderson
6ca4cb3755 First round of cleanups from Chris' feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 04:52:29 +00:00
Devang Patel
6a2bfdaab6 Embrace patch review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 01:51:27 +00:00
Devang Patel
002fe25dd7 Fix new compare instruction's signness. Caught by Chris during review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40912 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 23:17:52 +00:00
Owen Anderson
a37226af81 Don't insert nearly as many redundant phi nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40909 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 23:12:31 +00:00
Devang Patel
8431a1cbcc Use eraseFromParent().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 17:45:35 +00:00
David Greene
32fe3de0fe Fix comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 16:52:03 +00:00
David Greene
8ff18e9c99 Fix GLIBCXX_DEBUG error triggered by incrementing erased iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40897 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 16:44:38 +00:00
Devang Patel
fee76bd9ba Begin loop index split pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 00:25:56 +00:00
Nick Lewycky
f947b3edb5 It's safe to fold not of fcmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 20:04:16 +00:00
David Greene
242be6e0ff Make this code more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40861 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 15:09:17 +00:00
Reid Spencer
81a7572f1a Silence some warnings from doxygen about @param argument name not matching the
actual argument name of the documented function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 19:35:22 +00:00
Chris Lattner
a9ff5eb76e at the end of instcombine, explicitly clear WorklistMap.
This shrinks it down to something small.  On the testcase
from PR1432, this speeds up instcombine from 0.7959s to 0.5000s,
(59%)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 08:47:58 +00:00
Nick Lewycky
7956dae870 Clean up comments, fix up some confusing code logic.
Predsimplify fails llvm-gcc bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 18:45:32 +00:00
Chandler Carruth
6994040a95 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:51:18 +00:00
Owen Anderson
ab8702787d Fix a subtle miscompilation. This allows 197.parser to be compiled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 19:59:35 +00:00
Owen Anderson
4b55c3b0f1 Fix a subtle iterator invalidation bug in a recursive algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 11:03:26 +00:00
Chris Lattner
b0e71edb6b Fix an accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:33:36 +00:00