ddb265b905 
								
							 
						 
						
							
							
								
								Now that ScalarEvolution::print writes to the correct stream, there is  
							
							... 
							
							
							
							no need to redirect stderr into stdout.
llvm-svn: 47009 
							
						 
						
							2008-02-12 15:12:40 +00:00  
				
					
						
							
							
								 
						
							
								995624f44d 
								
							 
						 
						
							
							
								
								Change negative grep into positive one in my yesterday's testcase.  
							
							... 
							
							
							
							llvm-svn: 47008 
							
						 
						
							2008-02-12 15:10:35 +00:00  
				
					
						
							
							
								 
						
							
								1d2c27b23e 
								
							 
						 
						
							
							
								
								Fix PR2002. Suppose n is the initial value for the induction  
							
							... 
							
							
							
							variable (with step 1) and m is its final value. Then, the correct trip 
count is SMAX(m,n)-n. Previously, we used SMAX(0,m-n), but m-n may 
overflow and can't in general be interpreted as signed.
Patch by Nick Lewycky.
llvm-svn: 47007 
							
						 
						
							2008-02-12 15:09:36 +00:00  
				
					
						
							
							
								 
						
							
								3716d023ab 
								
							 
						 
						
							
							
								
								Test case for annotate builtin.  
							
							... 
							
							
							
							llvm-svn: 46999 
							
						 
						
							2008-02-12 07:46:33 +00:00  
				
					
						
							
							
								 
						
							
								b21301fbe7 
								
							 
						 
						
							
							
								
								Fix some test cases.  
							
							... 
							
							
							
							llvm-svn: 46998 
							
						 
						
							2008-02-12 07:22:46 +00:00  
				
					
						
							
							
								 
						
							
								adae053b53 
								
							 
						 
						
							
							
								
								If the LHS of the comparison is a loop-invariant we also want to move it  
							
							... 
							
							
							
							to the RHS. This simple change allows to compute loop iteration count 
for loops with condition similar to the one in the testcase (which seems 
to be quite common).
llvm-svn: 46959 
							
						 
						
							2008-02-11 18:37:34 +00:00  
				
					
						
							
							
								 
						
							
								d2d9764cc8 
								
							 
						 
						
							
							
								
								Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an  
							
							... 
							
							
							
							arbitrary iteration.
The patch:
1) changes SCEVSDivExpr into SCEVUDivExpr,
2) replaces PartialFact() function with BinomialCoefficient(); the 
computations (essentially, the division) in BinomialCoefficient() are 
performed with the apprioprate bitwidth necessary to avoid overflow; 
unsigned division is used instead of the signed one.
Computations in BinomialCoefficient() require support from the code 
generator for APInts. Currently, we use a hack rounding up the 
neccessary bitwidth to the nearest power of 2. The hack is easy to turn 
off in future.
One remaining issue: we assume the divisor of the binomial coefficient 
formula can be computed accurately using 16 bits. It means we can handle 
AddRecs of length up to 9. In future, we should use APInts to evaluate 
the divisor.
Thanks to Nicholas for cooperation!
llvm-svn: 46955 
							
						 
						
							2008-02-11 11:03:14 +00:00  
				
					
						
							
							
								 
						
							
								ad4d57a2f5 
								
							 
						 
						
							
							
								
								Determine whether a spill kills the register it's spilling before insertion rather than trying to undo the kill marker afterwards.  
							
							... 
							
							
							
							llvm-svn: 46953 
							
						 
						
							2008-02-11 08:30:52 +00:00  
				
					
						
							
							
								 
						
							
								3a4be0fdef 
								
							 
						 
						
							
							
								
								Rename MRegisterInfo to TargetRegisterInfo.  
							
							... 
							
							
							
							llvm-svn: 46930 
							
						 
						
							2008-02-10 18:45:23 +00:00  
				
					
						
							
							
								 
						
							
								43a2ed8611 
								
							 
						 
						
							
							
								
								Alignment of struct containing vectors depends on  
							
							... 
							
							
							
							whether SSE is present, on Darwin anyway.  Make it
explicit.
llvm-svn: 46909 
							
						 
						
							2008-02-09 19:04:25 +00:00  
				
					
						
							
							
								 
						
							
								26f75e2576 
								
							 
						 
						
							
							
								
								Fix PR 1995.  
							
							... 
							
							
							
							llvm-svn: 46898 
							
						 
						
							2008-02-08 22:49:13 +00:00  
				
					
						
							
							
								 
						
							
								3b3286d4bc 
								
							 
						 
						
							
							
								
								It's not always safe to fold movsd into xorpd, etc. Check the alignment of the load address first to make sure it's 16 byte aligned.  
							
							... 
							
							
							
							llvm-svn: 46893 
							
						 
						
							2008-02-08 21:20:40 +00:00  
				
					
						
							
							
								 
						
							
								8d59dd119b 
								
							 
						 
						
							
							
								
								Added missing entries in X86 load / store folding tables.  
							
							... 
							
							
							
							llvm-svn: 46866 
							
						 
						
							2008-02-08 00:12:56 +00:00  
				
					
						
							
							
								 
						
							
								a20a773654 
								
							 
						 
						
							
							
								
								Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.  
							
							... 
							
							
							
							Before:
_main:
        subq    $8, %rsp
        leaq    _X(%rip), %rax
        movsd   8(%rax), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret
Now:
_main:
        subq    $8, %rsp
        movsd   _X+8(%rip), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret
Notice there is another idiotic codegen issue that needs to be fixed asap:
xorl    %ecx, %ecx
movl    %ecx, %eax
llvm-svn: 46850 
							
						 
						
							2008-02-07 08:53:49 +00:00  
				
					
						
							
							
								 
						
							
								127b41500c 
								
							 
						 
						
							
							
								
								It's PR1925, not PR1609.  
							
							... 
							
							
							
							llvm-svn: 46825 
							
						 
						
							2008-02-06 22:07:17 +00:00  
				
					
						
							
							
								 
						
							
								c676a0329c 
								
							 
						 
						
							
							
								
								Temporarily reverting:  
							
							... 
							
							
							
							http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057882.html 
This is causing a miscompilation on PPC G5 and just now seeing it on iMac x86-64.
llvm-svn: 46822 
						
							2008-02-06 20:03:07 +00:00  
				
					
						
							
							
								 
						
							
								1ec748c784 
								
							 
						 
						
							
							
								
								Fix a number of local register allocator issues: PR1609.  
							
							... 
							
							
							
							llvm-svn: 46821 
							
						 
						
							2008-02-06 19:16:53 +00:00  
				
					
						
							
							
								 
						
							
								87fbd66f9f 
								
							 
						 
						
							
							
								
								Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.  
							
							... 
							
							
							
							llvm-svn: 46776 
							
						 
						
							2008-02-05 22:50:29 +00:00  
				
					
						
							
							
								 
						
							
								8d78b0597b 
								
							 
						 
						
							
							
								
								If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead).  
							
							... 
							
							
							
							llvm-svn: 46763 
							
						 
						
							2008-02-05 20:04:18 +00:00  
				
					
						
							
							
								 
						
							
								682a7dc653 
								
							 
						 
						
							
							
								
								Fix a bug compiling PR1978 (perhaps not the only one though) which  
							
							... 
							
							
							
							was incorrectly simplifying "x == (gep x, 1, i)" into false, even 
though i could be negative.  As it turns out, all the code to 
handle this already existed, we just need to disable the incorrect
optimization case and let the general case handle it.
llvm-svn: 46739 
							
						 
						
							2008-02-05 04:45:32 +00:00  
				
					
						
							
							
								 
						
							
								baba47f1ea 
								
							 
						 
						
							
							
								
								This should also work on x86 now.  
							
							... 
							
							
							
							llvm-svn: 46730 
							
						 
						
							2008-02-05 00:25:31 +00:00  
				
					
						
							
							
								 
						
							
								3342d4083f 
								
							 
						 
						
							
							
								
								Crashes LegalizeTypes with "Do not know how to  
							
							... 
							
							
							
							expand the result of this operator!" (node: ctlz).
llvm-svn: 46713 
							
						 
						
							2008-02-04 18:07:02 +00:00  
				
					
						
							
							
								 
						
							
								ff1a444879 
								
							 
						 
						
							
							
								
								Crashes LegalizeTypes with "Do not know how to split  
							
							... 
							
							
							
							this operator's operand" (node: extract_subvector).
llvm-svn: 46712 
							
						 
						
							2008-02-04 18:05:42 +00:00  
				
					
						
							
							
								 
						
							
								69f90ccb17 
								
							 
						 
						
							
							
								
								remove target triple to make this test more "generic"  
							
							... 
							
							
							
							llvm-svn: 46711 
							
						 
						
							2008-02-04 18:02:37 +00:00  
				
					
						
							
							
								 
						
							
								331cd706f5 
								
							 
						 
						
							
							
								
								Crashed the new type legalizer.  Not likely to catch  
							
							... 
							
							
							
							any bugs in the future since to get the crash you also
need hacked in fake libcall support (which creates odd
but legal trees), but since adding it doesn't hurt...
Thanks to Chris for this ultimately reduced version.
llvm-svn: 46706 
							
						 
						
							2008-02-04 09:40:27 +00:00  
				
					
						
							
							
								 
						
							
								1a78ae76e4 
								
							 
						 
						
							
							
								
								Make this test more aggressive, to cover recent improvements.  
							
							... 
							
							
							
							llvm-svn: 46695 
							
						 
						
							2008-02-04 04:55:24 +00:00  
				
					
						
							
							
								 
						
							
								c4a7c41869 
								
							 
						 
						
							
							
								
								Allow GVN to hack on memcpy's, making them open to further optimization.  
							
							... 
							
							
							
							llvm-svn: 46693 
							
						 
						
							2008-02-04 02:59:58 +00:00  
				
					
						
							
							
								 
						
							
								56178bc6ad 
								
							 
						 
						
							
							
								
								Tag this test with the PR reference.  
							
							... 
							
							
							
							llvm-svn: 46688 
							
						 
						
							2008-02-03 16:35:19 +00:00  
				
					
						
							
							
								 
						
							
								3b59214320 
								
							 
						 
						
							
							
								
								There are some cases where icmp(add) can be folded into a new icmp. Handle them.  
							
							... 
							
							
							
							llvm-svn: 46687 
							
						 
						
							2008-02-03 16:33:09 +00:00  
				
					
						
							
							
								 
						
							
								931e121ad1 
								
							 
						 
						
							
							
								
								Fixing a bug creating floating point constants of type other  
							
							... 
							
							
							
							than double through the C bindings. Thanks to Tomas Lindquist
Olsen for reporting it.
llvm-svn: 46656 
							
						 
						
							2008-02-02 01:07:50 +00:00  
				
					
						
							
							
								 
						
							
								192c07b727 
								
							 
						 
						
							
							
								
								CBackend: Implement unaligned load/store.  
							
							... 
							
							
							
							llvm-svn: 46646 
							
						 
						
							2008-02-01 21:25:59 +00:00  
				
					
						
							
							
								 
						
							
								9aa789fda3 
								
							 
						 
						
							
							
								
								Don't drop function/call return attributes like 'nounwind'.  
							
							... 
							
							
							
							llvm-svn: 46645 
							
						 
						
							2008-02-01 20:37:16 +00:00  
				
					
						
							
							
								 
						
							
								56d4903db5 
								
							 
						 
						
							
							
								
								Accept getelementptr starting at GV with all 0 indices as a  
							
							... 
							
							
							
							legitimate way of representing global variable GV in debug info.
llvm-svn: 46565 
							
						 
						
							2008-01-30 19:00:21 +00:00  
				
					
						
							
							
								 
						
							
								cee9d51be9 
								
							 
						 
						
							
							
								
								Pointers change size depending upon the target. Remove them to make the test more stable.  
							
							... 
							
							
							
							llvm-svn: 46548 
							
						 
						
							2008-01-30 05:15:15 +00:00  
				
					
						
							
							
								 
						
							
								4e4b116750 
								
							 
						 
						
							
							
								
								Make DSE much more aggressive by performing DCE earlier.  Update a testcase to reflect this increased aggressiveness.  
							
							... 
							
							
							
							llvm-svn: 46542 
							
						 
						
							2008-01-30 01:24:47 +00:00  
				
					
						
							
							
								 
						
							
								b9e5b8fb9e 
								
							 
						 
						
							
							
								
								Fix a bug where scalarrepl would discard offset if type would match.  
							
							... 
							
							
							
							In practice this can only happen on code with already undefined behavior, 
but this is still a good thing to handle correctly.
llvm-svn: 46539 
							
						 
						
							2008-01-30 00:39:15 +00:00  
				
					
						
							
							
								 
						
							
								a13e5146d4 
								
							 
						 
						
							
							
								
								Update this test case.  
							
							... 
							
							
							
							llvm-svn: 46526 
							
						 
						
							2008-01-29 19:30:05 +00:00  
				
					
						
							
							
								 
						
							
								ade0abb498 
								
							 
						 
						
							
							
								
								Don't let globalopt hack on volatile loads or stores.  
							
							... 
							
							
							
							llvm-svn: 46523 
							
						 
						
							2008-01-29 19:01:37 +00:00  
				
					
						
							
							
								 
						
							
								17819d971e 
								
							 
						 
						
							
							
								
								eliminate additions of 0.0 when they are obviously dead.  This has to be careful to  
							
							... 
							
							
							
							avoid turning -0.0 + 0.0 -> -0.0 which is incorrect.
llvm-svn: 46499 
							
						 
						
							2008-01-29 06:52:45 +00:00  
				
					
						
							
							
								 
						
							
								95bf1d4d7b 
								
							 
						 
						
							
							
								
								Add a testcase for eliminating memcpy's at the end of functions.  Forgot to commit this with my last commit.  
							
							... 
							
							
							
							llvm-svn: 46497 
							
						 
						
							2008-01-29 06:40:32 +00:00  
				
					
						
							
							
								 
						
							
								f4e5e556fd 
								
							 
						 
						
							
							
								
								Add target triples to these so they don't fail on linux.  
							
							... 
							
							
							
							llvm-svn: 46496 
							
						 
						
							2008-01-29 06:26:07 +00:00  
				
					
						
							
							
								 
						
							
								1e7ec74ad3 
								
							 
						 
						
							
							
								
								This would be better done as an executable test.  
							
							... 
							
							
							
							llvm-svn: 46493 
							
						 
						
							2008-01-29 06:04:54 +00:00  
				
					
						
							
							
								 
						
							
								aaaeee2ac0 
								
							 
						 
						
							
							
								
								After recent changes we fail to optimize this test  
							
							... 
							
							
							
							sufficiently to have it pass.  I'm removing it from
the testsuite and adding it to PR452 instead.
llvm-svn: 46492 
							
						 
						
							2008-01-29 05:57:23 +00:00  
				
					
						
							
							
								 
						
							
								67fa0521b6 
								
							 
						 
						
							
							
								
								Filter loops that subtract induction variables.  
							
							... 
							
							
							
							These loops are not yet handled.
Fix PR 1912.
llvm-svn: 46484 
							
						 
						
							2008-01-29 02:20:41 +00:00  
				
					
						
							
							
								 
						
							
								ceae3bbf4d 
								
							 
						 
						
							
							
								
								Overhaul Cell SPU's addressing mode internals so that there are now  
							
							... 
							
							
							
							only two addressing mode nodes, SPUaform and SPUindirect (vice the
three previous ones, SPUaform, SPUdform and SPUxform). This improves
code somewhat because we now avoid using reg+reg addressing when
it can be avoided. It also simplifies the address selection logic,
which was the main point for doing this.
Also, for various global variables that would be loaded using SPU's
A-form addressing, prefer D-form offs[reg] addressing, keeping the
base in a register if the variable is used more than once.
llvm-svn: 46483 
							
						 
						
							2008-01-29 02:16:57 +00:00  
				
					
						
							
							
								 
						
							
								7bcf58f8a4 
								
							 
						 
						
							
							
								
								New test.  
							
							... 
							
							
							
							llvm-svn: 46479 
							
						 
						
							2008-01-29 01:10:04 +00:00  
				
					
						
							
							
								 
						
							
								f0b7d4993f 
								
							 
						 
						
							
							
								
								Add test to make sure that #pragma mark/error doesn't error if there are  
							
							... 
							
							
							
							unbalanced quotes.
llvm-svn: 46476 
							
						 
						
							2008-01-29 00:41:29 +00:00  
				
					
						
							
							
								 
						
							
								2a80ba8c7c 
								
							 
						 
						
							
							
								
								Pure/const functions with ByVal parameters cannot  
							
							... 
							
							
							
							be marked readonly either.
llvm-svn: 46456 
							
						 
						
							2008-01-28 19:25:47 +00:00  
				
					
						
							
							
								 
						
							
								a116071547 
								
							 
						 
						
							
							
								
								this test is now compiled into the right thing.  
							
							... 
							
							
							
							llvm-svn: 46454 
							
						 
						
							2008-01-28 17:38:46 +00:00  
				
					
						
							
							
								 
						
							
								54af54fe08 
								
							 
						 
						
							
							
								
								Make this more likely to be passed byval.  
							
							... 
							
							
							
							llvm-svn: 46451 
							
						 
						
							2008-01-28 10:35:11 +00:00