Commit Graph

31962 Commits

Author SHA1 Message Date
Evan Cheng
1e341729dd Relex assertions to account for additional implicit def / use operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36430 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 07:12:14 +00:00
Chris Lattner
79b3bd395d If an alloca only has two types of uses: 1) reads 2) a memcpy/memmove that
copies from a constant global, then we can change the reads to read from the
global instead of from the alloca.  This eliminates the alloca and the memcpy,
and promotes secondary optimizations (because the loads are now loads from
a constant global).

This is important for a common C idiom:

void foo() {
   int A[] = {1,2,3,4,5,6,7,8,9...};
   ... only reads of A ...
}

For some reason, people forget to mark the array static or const.

This triggers on these multisource benchmarks:
JM/ldecode: block_pos, [3 x [4 x [4 x i32]]]
FreeBench/mason: m, [18 x i32], inlined 4 times
MiBench/office-stringsearch: search_strings, [1332 x i8*]
MiBench/office-stringsearch: find_strings, [1333 x i8*]
Prolangs-C++/city: dirs, [9 x i8*], inlined 4 places

and these spec benchmarks:
177.mesa: message, [8 x [32 x i8]]
186.crafty: bias_rl45, [64 x i32]
186.crafty: diag_sq, [64 x i32]
186.crafty: empty, [9 x i8]
186.crafty: xlate, [15 x i8]
186.crafty: status, [13 x i8]
186.crafty: bdinfo, [25 x i8]
445.gobmk: routines, [16 x i8*]
458.sjeng: piece_rep, [14 x i8*]
458.sjeng: t, [13 x i32], inlined 4 places.
464.h264ref: block8x8_idx, [3 x [4 x [4 x i32]]]
464.h264ref: block_pos, [3 x [4 x [4 x i32]]]
464.h264ref: j_off_tab, [12 x i32]

This implements Transforms/ScalarRepl/memcpy-from-global.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36429 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 06:40:51 +00:00
Chris Lattner
54c4d40beb new testcase, should be able to eliminate the alloca and memcpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36428 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 06:29:34 +00:00
Chris Lattner
1a34b7bf9a simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36427 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 05:49:09 +00:00
Chris Lattner
a10b29b84b refactor the SROA code out into its own method, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36426 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 05:02:56 +00:00
Chris Lattner
ea84c5ee95 support for >4G stack frames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:30:24 +00:00
Chris Lattner
e47b1446d8 support for >4G frames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:29:06 +00:00
Chris Lattner
618078016d support >4G stack frames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:25:10 +00:00
Chris Lattner
a401b1e1c5 support > 4G stack objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36422 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:20:54 +00:00
Owen Anderson
ab0e4d38f0 Undo my previous changes. Since my approach to this problem is being revised,
this approach is no longer appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:18:54 +00:00
Chris Lattner
6266c18ea1 allow support for 64-bit stack objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36420 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:08:28 +00:00
Chris Lattner
be7d83ec0e allow 64-bit stack objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36419 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 04:07:31 +00:00
Chris Lattner
4aa8495de7 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 01:51:33 +00:00
Devang Patel
75abc1ed06 Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048376.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36417 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 00:37:04 +00:00
Devang Patel
193b585f1b New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36416 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 00:35:37 +00:00
Chris Lattner
5fa4c43f14 testcase for PR1352
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36415 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 00:26:05 +00:00
Dale Johannesen
82434387dd fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36414 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 00:14:49 +00:00
Chris Lattner
964dd86054 Be more careful about folding op(x, undef) when we have vector operands.
This fixes CodeGen/X86/2007-04-24-VectorCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36413 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 00:00:45 +00:00
Chris Lattner
3d4a548978 new testcase that crashes llc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 00:00:12 +00:00
Dale Johannesen
2fcdf64ddd Add me
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 23:48:30 +00:00
Chris Lattner
6c2d260161 Fix PR1351 and CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 22:51:03 +00:00
Chris Lattner
10161db780 testcase for PR1351
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 22:49:57 +00:00
Bill Wendling
b635d3faac Testcases for MMX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36408 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 22:28:30 +00:00
Bill Wendling
a2c38ae90d Update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36407 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:20:03 +00:00
Bill Wendling
b53e98eb30 Add the PADDQ to the list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36406 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:19:14 +00:00
Bill Wendling
69dc5332de Add the final MMX instructions. Correct a few wrong patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:18:37 +00:00
Bill Wendling
6dd29e08f7 Remove some invalid instructions from this check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36404 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:17:46 +00:00
Bill Wendling
2f9bb1a0a4 Support for the special case of a vector with the canonical form:
vector_shuffle v1, v2, <2, 6, 3, 7>

I.e.

         vector_shuffle v, undef, <2, 2, 3, 3>

MMX only has a shuffle for v4i16 vectors. It needs to use the unpackh for
this type of operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:16:55 +00:00
Bill Wendling
95b3955034 Assertion when using a 1-element vector for an add operation. Get the
real vector type in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36402 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:13:23 +00:00
Devang Patel
93675f4cdd New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36401 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 21:05:52 +00:00
Devang Patel
d53b69d9c2 New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36400 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 19:24:39 +00:00
Devang Patel
1f7a9bc982 Add myself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36399 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 18:49:33 +00:00
Chris Lattner
f66d20da61 ensure that every error return sets a message (and goes through Error, for
easy breakpointing).

Fix bugs reading constantexpr geps.  We now can disassemble kc++ global
initializers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36398 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 18:15:21 +00:00
Chris Lattner
084a844d6d fix memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36397 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 17:22:05 +00:00
Chris Lattner
4ab2d2009e fix a memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36396 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 17:20:52 +00:00
Chris Lattner
253bb78adb comentate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36395 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 15:54:42 +00:00
Chris Lattner
f581c3b81e implement reading and writing of constant exprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 07:07:11 +00:00
Chris Lattner
c9c448ffa2 add records for constant exprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36393 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 07:03:08 +00:00
Owen Anderson
3a2b58f3ad Rollback some changes that adversely affected performance. I'm currently rethinking
my approach to this, so hopefully I'll find a way to do this without making this slower.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36392 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 06:40:39 +00:00
Chris Lattner
522b7b104c implement support for reading aggregate constants, including handling forward
constant references, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36391 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 05:48:56 +00:00
Chris Lattner
0eef08046e add supprot for FP constants, wide integers, and fix the encoding of MININT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36390 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 04:04:35 +00:00
Chris Lattner
e16504eb4e read basic constants: null, undef, integers <= 64bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 03:30:34 +00:00
Chris Lattner
631a8ed3ff fix off-by-one computing size for section abbrevs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36388 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 03:29:47 +00:00
Scott Michel
f147a8d56e Use '-1U' where '-1UL' is obvious overkill, eliminating gcc warnings about
tests always being true in the process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 01:24:20 +00:00
Chris Lattner
e84bcb922d move check to the right place :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:21:45 +00:00
Chris Lattner
6dbfd7bfbc track global inits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36385 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:18:21 +00:00
Chris Lattner
2edd22b959 Emit module-level constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:16:04 +00:00
Dale Johannesen
00d56b96e5 modify per review commentary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 23:33:31 +00:00
Chris Lattner
2c783e46c3 add codes for constants table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36382 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 23:29:59 +00:00
Christopher Lamb
df1349546f Fix bug in isFloatingPoint()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36381 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 22:50:40 +00:00