Commit Graph

517 Commits

Author SHA1 Message Date
Devang Patel
afc407ea51 Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 07:24:40 +00:00
Chris Lattner
a79dd432b3 Fix a bug in my patch last night that broke InstCombine/2007-10-12-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:05:47 +00:00
Chris Lattner
cb324cfc32 testcase for PR1728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 05:29:53 +00:00
Devang Patel
f9193de25b Lower memcpy if it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 17:21:57 +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
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
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
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
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
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
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
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
Chris Lattner
e29459e3b5 This xform isn't safe, removing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40378 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-21 21:27:27 +00:00
Dan Gohman
9941f7426d Optimize alignment of loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40102 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20 16:34:21 +00:00
Chris Lattner
e2ece3f479 rename function to avoid llvm-upgrade warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39895 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 04:09:00 +00:00
Chris Lattner
4241e4da85 Implement shift-simplify.ll:test[45].
First teach instcombine that sign bit checks only demand the 
sign bit, this allows simplify demanded bits to hack on 
expressions better.

Second, teach instcombine that ashr is useless if only the
sign bit is demanded.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39880 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 20:54:51 +00:00
Chris Lattner
a0141b90a3 Implement shift-simplify.ll:test3, turning:
(X << 31) <s 0  --> (X&1) != 0

This happens dozens of times in the CFE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39879 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 20:42:37 +00:00
John Criswell
e644ef7b09 Convert .cvsignore files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 16:35:07 +00:00
Chris Lattner
e47f30f5e6 new testcase miscompiled by instcombine, reduced from perl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37691 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 18:09:25 +00:00
Chris Lattner
3dcf510ba1 add vector versions of this test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37588 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 06:22:32 +00:00
Chris Lattner
546fdae370 testcase for PR1510
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37583 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 05:57:20 +00:00
Lauro Ramos Venancio
a1cca17d77 Add a test for PR1499.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 17:10:02 +00:00
Chris Lattner
74b9a814f6 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-19 06:50:37 +00:00
Chris Lattner
24bb504e15 New testcase that crashes instcombine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37056 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-15 00:15:49 +00:00
Chris Lattner
2e3ce7d97a new testcase that crashes instcombine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36983 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-11 05:55:38 +00:00
Chris Lattner
86c7745fb4 remove an old xfailed test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36810 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05 22:42:02 +00:00
Chris Lattner
a993dd0cfc un-xfail this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36808 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05 22:41:13 +00:00
Chris Lattner
51e04da381 new testacse for PR1384
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05 01:59:05 +00:00
Chris Lattner
947780b1f9 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36520 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-28 00:54:45 +00:00
Reid Spencer
eb1d74e0c8 For PR1319:
Remove && from the end of the lines to prevent tests from throwing run
lines into the background. Also, clean up places where the same command
is run multiple times by using a temporary file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36142 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 17:36:08 +00:00
Reid Spencer
7c65d4345e For PR1319:
Make use of the END. facility on all files > 1K so that we aren't wasting CPU
cycles searching for RUN: lines that we'll never find.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36059 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 07:38:21 +00:00
Reid Spencer
a20c22f190 Fix this test in a slightly more obvious way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 07:37:04 +00:00
Zhou Sheng
e9989b9152 This test case is incorrect. Remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36048 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 05:59:49 +00:00
Reid Spencer
6f6b250058 Keep lines a reasonable length.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36043 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 04:54:53 +00:00
Jeff Cohen
723de95d1e Patch supplied by gabor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36042 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 03:09:23 +00:00
Chris Lattner
9838939b3a new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 01:00:37 +00:00
Owen Anderson
ea37270ef2 XFAIL this for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:57:41 +00:00
Chris Lattner
32b4c12e6b new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36024 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:00:51 +00:00
Reid Spencer
78fb2acea2 Changes to fix problems with "make check". Apparently you can redefine
functions and Tcl's just tickled with that. The fix is to give the "new"
test system a different interface function name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 22:51:29 +00:00
Chris Lattner
2caf0ec7ad manually upgrade test. Add a new test2. I have no way to see if this works
because of the tclification.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36019 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 22:27:33 +00:00
Reid Spencer
d733ae8f5d This test should have been updated with llvm 1.7!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36014 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 20:21:37 +00:00