Commit Graph

1441 Commits

Author SHA1 Message Date
Devang Patel
bc2265abe1 Relax unsafe use check. If there is one unconditional use inside the loop then it is safe to promote value even if there is another conditional use inside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 18:12:58 +00:00
Devang Patel
a6dff2faeb Handle multiple induction variables.
This fixes PR714.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42309 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 18:24:48 +00:00
Devang Patel
453a844128 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();                            



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 17:31:19 +00:00
Devang Patel
128459b85b Do not promote null values because it may be unsafe to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 20:02:42 +00:00
Devang Patel
3f65f02d25 Fix PR1692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42209 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21 21:18:19 +00:00
Duncan Sands
d7944ca61c Testcase for PR1678.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 18:56:24 +00:00
Nick Lewycky
1af92b05d5 Excuse me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 00:57:00 +00:00
Nick Lewycky
e29578afd5 Fix optimization. %x = sub %x, %y does not imply that %y is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 00:48:36 +00:00
Devang Patel
f2038b1d93 Avoid unsafe promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42149 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 20:18:51 +00:00
Gabor Greif
d84c3ab4a7 rename test, it is obviously misspelled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 21:42:39 +00:00
Devang Patel
e3bfb88898 Fix PR1657
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 01:54:42 +00:00
Dan Gohman
5d066ff7f0 Instcombine x-((x/y)*y) into a remainder operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 17:31:57 +00:00
Chris Lattner
402a7888a9 remove obsolete tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-15 17:38:04 +00:00
Duncan Sands
bba5037740 Test that a call to a trampoline is turned into a call to
the underlying nested function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 15:07:50 +00:00
Chris Lattner
75e3bd5bf2 remove obsolete testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 23:51:41 +00:00
Chris Lattner
a0ef5ed742 Fix a buggy constant folding transformation when handling aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 23:42:42 +00:00
Dale Johannesen
0c82b9de77 Add missing llvm-dis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41813 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 22:47:59 +00:00
Chris Lattner
8d9455d4e4 Prevent tailcallelim from breaking "recursive" calls to builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 20:58:55 +00:00
Devang Patel
9c7a9f186c Filter exit conditions which are not yet handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41800 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 18:33:42 +00:00
Chris Lattner
a54c7eb157 Don't zap back to back volatile load/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07 05:33:03 +00:00
Nick Lewycky
5a5ff9d7df When the two operands of an icmp are equal, there are five possible predicates
that would make the icmp true. Fixes PR1637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 01:10:22 +00:00
Dale Johannesen
c2ec2baf3d Change all floating constants that are not exactly
representable to use hex format.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41722 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-05 17:50:36 +00:00
Anton Korobeynikov
9f528e6280 Don't promote volatile loads/stores. This is needed (for example) to handle setjmp/longjmp properly.
This fixes PR1520.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:43:30 +00:00
Devang Patel
be97c986e1 Constant split values needs upper bound and lower bound check, just like any other split value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 01:09:14 +00:00
Devang Patel
4a69da9cb0 While calculating upper loop bound for first loop and lower loop bound for second loop, take care of edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 00:56:38 +00:00
Devang Patel
d651f657f2 Do not split loops rejected by processOneIterationLoop().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41194 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 20:24:15 +00:00
Devang Patel
7bfd5dba38 Add loop index split tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-17 22:02:15 +00:00
Dan Gohman
43c3db37f6 Convert tests using "grep -c ... | grep ..." to use the count script.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41100 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 13:49:33 +00:00
Dan Gohman
28beeeac4d Convert tests using "| wc -l | grep ..." to use the count script.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 13:36:28 +00:00
Chris Lattner
ce7c40cf4b oops, forgot to commit this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-12 16:55:14 +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
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
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
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
Chris Lattner
576c8da518 I don't have time to restore this functionality right now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:43:39 +00:00
Chris Lattner
ce4eaecb2e Reduced testcase for PR1594
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:11:24 +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
28ae151c48 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:23:50 +00:00
Owen Anderson
268479f454 Forgot to update these files for the FastDSE changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40674 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 16:53:51 +00:00
Owen Anderson
f6a05f949f Rename FastDSE to just DSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:36:51 +00:00
Owen Anderson
b95f9d565f Fix a failure I accidentally caused in my last commit by mishandling the
removal of redundant phis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40650 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:18:28 +00:00
Lauro Ramos Venancio
c7d1114ade Fix a bug in GetKnownAlignment of packed structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:13:21 +00:00
Dan Gohman
b1576f56c8 Change the x86 assembly output to use tab characters to separate the
mnemonics from their operands instead of single spaces. This makes the
assembly output a little more consistent with various other compilers
(f.e. GCC), and slightly easier to read. Also, update the regression
tests accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40648 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:11:57 +00:00
Owen Anderson
054ab94bff Fix a misoptimization in aha.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40642 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 17:43:14 +00:00
Devang Patel
fee0a9c7ef Bunch of tests to check loop passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40629 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 08:04:17 +00:00
Owen Anderson
4f9ba7c40c Fix a bug caused by indiscriminantly asking for the dominators of a predecessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40595 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 16:57:08 +00:00
Owen Anderson
a377a24771 Fix a bug introduced in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40542 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:57:04 +00:00
Owen Anderson
45537917ee Fix a couple more bugs in the phi construction by pulling in code that does
almost the same things from LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40540 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:26:51 +00:00