Evan Cheng
3f22fffe94
- If a def is dead, do not spill it.
...
- If the defs of a spilled rematerializable MI are dead after the spill store is deleted, delete
the def MI as well.
llvm-svn: 41086
2007-08-14 23:25:37 +00:00
Evan Cheng
859a52072e
Test case for PR1596.
...
llvm-svn: 41085
2007-08-14 23:21:10 +00:00
Evan Cheng
94168a4ed0
Fix for PR1596: AdjustCopiesBackFrom() should conservatively check if any of its sub-registers may overlap with the interval of the copy that's being coalesced.
...
llvm-svn: 41084
2007-08-14 23:19:28 +00:00
Evan Cheng
6cb9fd7be5
If a MI's def is remat as well as spilled, and the store is later deemed dead, mark the def operand as isDead.
...
llvm-svn: 41083
2007-08-14 20:23:13 +00:00
Devang Patel
33ba97d747
Fix dominance frontier update while removing blocks.
...
llvm-svn: 41082
2007-08-14 18:35:57 +00:00
Owen Anderson
bc271a02fd
Eliminate PHI nodes with constant values during normal GVN processing, even when
...
they're not related to eliminating a load.
llvm-svn: 41081
2007-08-14 18:33:27 +00:00
Owen Anderson
398602a6eb
Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.
...
llvm-svn: 41080
2007-08-14 18:16:29 +00:00
Ted Kremenek
c48affb81f
Removed dead variable "hadError" in ParseReturnStmt.
...
llvm-svn: 41079
2007-08-14 18:14:14 +00:00
Owen Anderson
676070d503
Make GVN iterative.
...
llvm-svn: 41078
2007-08-14 18:04:11 +00:00
Owen Anderson
a7b220f23a
Fix a case where GVN was failing to return true when it had, in fact, modified
...
the function.
llvm-svn: 41077
2007-08-14 17:59:48 +00:00
Ted Kremenek
e68f1aad65
Added support for additional format string checking for the printf
...
family of functions. Previous functionality only included checking to
see if the format string was a string literal. Now we check parse the
format string (if it is a literal) and perform the following checks:
(1) Warn if: number conversions (e.g. "%d") != number data arguments.
(2) Warn about missing format strings (e.g., "printf()").
(3) Warn if the format string is not a string literal.
(4) Warn about the use se of '%n' conversion. This conversion is
discouraged for security reasons.
(5) Warn about malformed conversions. For example '%;', '%v'; these
are not valid.
(6) Warn about empty format strings; e.g. printf(""). Although these
can be optimized away by the compiler, they can be indicative of
broken programmer logic. We may need to add additional support to
see when such cases occur within macro expansion to avoid false
positives.
(7) Warn if the string literal is wide; e.g. L"%d".
(8) Warn if we detect a '\0' character WITHIN the format string.
Test cases are included.
llvm-svn: 41076
2007-08-14 17:39:48 +00:00
Devang Patel
367260c0df
Assert sooner. Fix wordings.
...
llvm-svn: 41075
2007-08-14 16:53:52 +00:00
Devang Patel
f120013eca
No need to use iterator to erase basic block.
...
llvm-svn: 41074
2007-08-14 16:53:24 +00:00
Chris Lattner
687dbf1a99
tcl seems to hate |& for some reason.
...
llvm-svn: 41073
2007-08-14 16:19:35 +00:00
Chris Lattner
0e92458068
switch this to use fastcc to avoid fpstack traffic on x86-32. Switch to
...
using the count script instead of wc -l
llvm-svn: 41072
2007-08-14 16:14:10 +00:00
Evan Cheng
5c6d53d2ff
Update test case. A spill should now be deleted.
...
llvm-svn: 41070
2007-08-14 09:16:00 +00:00
Evan Cheng
234386509b
If a spilled value is being reused and the use is a kill, that means there are
...
no more uses within the MBB and the spilled value isn't live out of the MBB.
Then it's safe to delete the spill store.
llvm-svn: 41069
2007-08-14 09:11:18 +00:00
Evan Cheng
5e221dbe8f
Spiller reuse test case.
...
llvm-svn: 41068
2007-08-14 05:51:03 +00:00
Evan Cheng
78a8806f4f
If a rematerializable def is not deleted, i.e. it is also spilled, check if the
...
spilled value is available for reuse.
llvm-svn: 41067
2007-08-14 05:42:54 +00:00
Evan Cheng
74c69f7588
Kill info update bugs.
...
llvm-svn: 41064
2007-08-14 01:56:58 +00:00
Devang Patel
dbe8497d45
Handle last value assignments.
...
llvm-svn: 41063
2007-08-14 01:30:57 +00:00
Devang Patel
f74ccbb4e8
StartValue is already calculated.
...
llvm-svn: 41062
2007-08-14 00:15:45 +00:00
Evan Cheng
2814fe847d
Now capable of rematerializing coalesced live intervals.
...
llvm-svn: 41061
2007-08-13 23:54:16 +00:00
Evan Cheng
33820da1da
Re-implement trivial rematerialization. This allows def MIs whose live intervals that are coalesced to be rematerialized.
...
llvm-svn: 41060
2007-08-13 23:45:17 +00:00
Evan Cheng
b2823dac69
Fix a typo pointd out by Maarten ter Huurne.
...
llvm-svn: 41059
2007-08-13 23:27:11 +00:00
Ted Kremenek
86aeed9236
Added documentation to StringLiteral noting that the strings returned by
...
getStrData() are not null-terminated, and the lengths of these strings should
be determined using getByteLength().
llvm-svn: 41055
2007-08-13 22:26:47 +00:00
Devang Patel
948653915f
Preserve simple analysis.
...
llvm-svn: 41054
2007-08-13 22:22:13 +00:00
Devang Patel
b8a41bb4f1
Preserve dominator info.
...
llvm-svn: 41053
2007-08-13 22:13:24 +00:00
Devang Patel
c0fa0c52b3
Add methods to erase basic block entry.
...
llvm-svn: 41052
2007-08-13 22:10:29 +00:00
Devang Patel
da48cf40db
If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.
...
llvm-svn: 41051
2007-08-13 21:59:17 +00:00
Chris Lattner
2b40caa861
move assertion into mutex guard, a partial fix for PR1606.
...
llvm-svn: 41050
2007-08-13 20:08:16 +00:00
Dan Gohman
ccb3611881
When x86 addresses matching exceeds its recursion limit, check to
...
see if the base register is already occupied before assuming it can be
used. This fixes bogus code generation in the accompanying testcase.
llvm-svn: 41049
2007-08-13 20:03:06 +00:00
Chris Lattner
4e7f673f65
Fix PR1607
...
llvm-svn: 41048
2007-08-13 18:42:37 +00:00
Chris Lattner
3251377104
test that the ptr-to-method is succefully eliminated, leaving just the vtable dispatch.
...
llvm-svn: 41047
2007-08-13 17:17:03 +00:00
Chris Lattner
aadc778782
Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
...
Into: inttoptr (i64 0 to i8*) -> null
This occurs in the example in PR1602. With this fixed, we now compile
the example in PR1602 into fully "devirtualized" code:
define void @_Z1g1S(%struct.S* noalias %s) {
entry: %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i32 (...)***> [#uses=1] %tmp16 = load i32 (...)*** %tmp131415, align 4 ; <i32 (...)**> [#uses=1]
%tmp26277 = load i32 (...)** %tmp16 ; <i32 (...)*> [#uses=1]
%tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)* ; <void (%struct.S*)*> [#uses=1]
tail call void %tmp2829( %struct.S* %s )
ret void
}
This still has the vtable dispatch (as required) but does not have any pointer
to method cruft left.
llvm-svn: 41046
2007-08-13 17:09:08 +00:00
Evan Cheng
5ca98c657d
Kill info update bugs.
...
llvm-svn: 41043
2007-08-13 07:12:23 +00:00
Reid Spencer
ab13178928
Make use of the llvm-ld tool's new ability to read input from stdin to extract
...
the list of link time passes to be run, just as for opt, with the
-debug-pass=Arguments option.
llvm-svn: 41040
2007-08-13 06:19:51 +00:00
Reid Spencer
7c38b0dc15
Don't build llvm-stub twice.
...
llvm-svn: 41039
2007-08-13 00:25:47 +00:00
Chris Lattner
1399f64e3b
oops, forgot to commit this.
...
llvm-svn: 41034
2007-08-12 16:55:14 +00:00
Reid Spencer
f3317d5286
Change casts from old style to new style. This helps document the details
...
better, gives the compiler a chance to validate the cast and reduces warnings
if the user turns on -Wold-style-cast option.
llvm-svn: 41033
2007-08-12 08:12:35 +00:00
Devang Patel
f258578206
Split loops and do CFG cleanup.
...
llvm-svn: 41029
2007-08-12 07:02:51 +00:00
Reid Spencer
9f90f965de
Remove unused variables.
...
llvm-svn: 41028
2007-08-12 04:45:36 +00:00
Evan Cheng
af21e9550e
No need to remove dead range from soon-to-be-dead live interval. Its val# may be out of whack.
...
llvm-svn: 41024
2007-08-12 01:26:19 +00:00
Chris Lattner
460e34afed
constant fold ptrtoint(inttoptr) with target data when available. This allows
...
us to fold the entry block of PR1602 to false instead of:
br i1 icmp eq (i32 and (i32 ptrtoint (void (%struct.S*)* inttoptr (i64
1 to void (%struct.S*)*) to i32), i32 1), i32 0), label %cond_next, label
%cond_true
llvm-svn: 41023
2007-08-11 23:49:01 +00:00
Chris Lattner
99c8ee2977
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
llvm-svn: 41022
2007-08-11 18:48:48 +00:00
Chris Lattner
750b3dfcf5
expand a note
...
llvm-svn: 41021
2007-08-11 18:19:07 +00:00
Chris Lattner
ee44ab5b5f
With evan's explicit flag representation, hopefully we will finally be
...
able to 3-addressify away stuff like this:
movl %ecx, %eax
decl %eax
llvm-svn: 41020
2007-08-11 18:16:46 +00:00
Reid Spencer
3687007119
Now that llvm-ld can accept - as input from stdin, use this feature to extract
...
the pass arguments that it supports.
llvm-svn: 41019
2007-08-11 16:11:22 +00:00
Reid Spencer
2dc9f13278
Fix a comment typo noticed by Sandro Magi.
...
llvm-svn: 41018
2007-08-11 15:57:56 +00:00
Bill Wendling
cdbd82ee37
64-bit SSSE3 ops that use MMX registers don't require 16-byte alignment.
...
Make a 'memop' pattern just for them.
llvm-svn: 41017
2007-08-11 09:52:53 +00:00