Commit Graph

1922 Commits

Author SHA1 Message Date
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
Owen Anderson
9fed589912 Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:20:52 +00:00
Owen Anderson
830db6a00e Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:16:06 +00:00
Owen Anderson
666f6fe0ce Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:11:11 +00:00
Owen Anderson
1c2763d3fe Fix a bug that was causing several miscompilations on SPEC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:56:05 +00:00
Chris Lattner
5543a856ff Replacing a cast with another one does not reduce the number of
casts in the input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:23:38 +00:00
Chris Lattner
b014678eb3 Disable an xform that causes an infinite loop. This fixes PR1594
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 16:56:32 +00:00
Chris Lattner
684b22df79 wrap some long lines. Major offenders that are left include
gvn, gvnpre, dse, and predsimplify.  To see these, use:

  make check-line-length



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 16:53:43 +00:00
Devang Patel
1ff61385c8 Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589, again



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40737 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 15:25:57 +00:00
Chris Lattner
951626b437 Enhance instcombine to be more aggressive about folding casts of
operations of casts.  This implements InstCombine/zext-fold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 06:11:14 +00:00
Chris Lattner
9dd7a5178f Fix PR1575 and test/Transforms/CondProp/2007-08-01-InvalidRead.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40720 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:47:05 +00:00
Devang Patel
2f2e519083 Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:24:50 +00:00