09f410b6d7 
								
							 
						 
						
							
							
								
								Split ParameterAttributes.h, putting the complicated  
							
							... 
							
							
							
							stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.
llvm-svn: 47504 
							
						 
						
							2008-02-22 22:17:59 +00:00  
				
					
						
							
							
								 
						
							
								3b8eb704fc 
								
							 
						 
						
							
							
								
								Fixed a typo.  
							
							... 
							
							
							
							llvm-svn: 47478 
							
						 
						
							2008-02-22 10:00:35 +00:00  
				
					
						
							
							
								 
						
							
								360c86aed5 
								
							 
						 
						
							
							
								
								Add explicit keywords.  
							
							... 
							
							
							
							llvm-svn: 47382 
							
						 
						
							2008-02-20 16:44:09 +00:00  
				
					
						
							
							
								 
						
							
								18991d78fa 
								
							 
						 
						
							
							
								
								Fix newly-introduced 4.3 warnings  
							
							... 
							
							
							
							llvm-svn: 47375 
							
						 
						
							2008-02-20 12:07:57 +00:00  
				
					
						
							
							
								 
						
							
								1bfd121321 
								
							 
						 
						
							
							
								
								Make Transforms to be 4.3 warnings-clean  
							
							... 
							
							
							
							llvm-svn: 47371 
							
						 
						
							2008-02-20 11:26:25 +00:00  
				
					
						
							
							
								 
						
							
								579f07135a 
								
							 
						 
						
							
							
								
								Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.  
							
							... 
							
							
							
							llvm-svn: 47367 
							
						 
						
							2008-02-20 11:08:44 +00:00  
				
					
						
							
							
								 
						
							
								b4724dbda2 
								
							 
						 
						
							
							
								
								When performing return slot optimization, remember to inform memdep when we're removing the memcpy.  
							
							... 
							
							
							
							llvm-svn: 47364 
							
						 
						
							2008-02-20 08:23:02 +00:00  
				
					
						
							
							
								 
						
							
								89268bc6e2 
								
							 
						 
						
							
							
								
								Expand ParameterAttributes to 32 bits (in preparation  
							
							... 
							
							
							
							for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.
llvm-svn: 47342 
							
						 
						
							2008-02-19 21:38:47 +00:00  
				
					
						
							
							
								 
						
							
								032fb2eda9 
								
							 
						 
						
							
							
								
								remove the lower packed pass.  It can never work and even the parts that  
							
							... 
							
							
							
							could work don't work fully.  This fixes PR1705.  Oh yeah, we don't have
packed types anymore either ;-)
llvm-svn: 47322 
							
						 
						
							2008-02-19 07:39:17 +00:00  
				
					
						
							
							
								 
						
							
								e92e303582 
								
							 
						 
						
							
							
								
								Refactor this method a bit, and correct a test that was completely wrong but happened to work out anyways. :-)  
							
							... 
							
							
							
							llvm-svn: 47321 
							
						 
						
							2008-02-19 07:07:51 +00:00  
				
					
						
							
							
								 
						
							
								f7b7ba9c5a 
								
							 
						 
						
							
							
								
								isa+cast -> dyncast.  
							
							... 
							
							
							
							llvm-svn: 47320 
							
						 
						
							2008-02-19 06:53:20 +00:00  
				
					
						
							
							
								 
						
							
								c130e3afc4 
								
							 
						 
						
							
							
								
								simplify  this code again, try 2 :)  
							
							... 
							
							
							
							llvm-svn: 47319 
							
						 
						
							2008-02-19 06:52:38 +00:00  
				
					
						
							
							
								 
						
							
								e71d6e37b2 
								
							 
						 
						
							
							
								
								Fix a comment.  
							
							... 
							
							
							
							llvm-svn: 47318 
							
						 
						
							2008-02-19 06:51:23 +00:00  
				
					
						
							
							
								 
						
							
								806cbde53b 
								
							 
						 
						
							
							
								
								Major improvements to yesterday's return slot optimization.  Remove some unneccessary constraints,  
							
							... 
							
							
							
							and add some others that should have been in from the first place.  Document the whole thing better.
llvm-svn: 47315 
							
						 
						
							2008-02-19 06:35:43 +00:00  
				
					
						
							
							
								 
						
							
								0fe6bce9ce 
								
							 
						 
						
							
							
								
								fdiv/frem of undef can produce undef, because the undef operand  
							
							... 
							
							
							
							can be a SNaN.  We could be more aggressive and turn this into 
unreachable, but that is less nice, and not really worth it.
llvm-svn: 47313 
							
						 
						
							2008-02-19 06:12:18 +00:00  
				
					
						
							
							
								 
						
							
								c0c3cd8e27 
								
							 
						 
						
							
							
								
								Factor the profitability check for return slot optimization out into a static function.  
							
							... 
							
							
							
							At some point in the future, this check will become smarter.
llvm-svn: 47310 
							
						 
						
							2008-02-19 03:27:34 +00:00  
				
					
						
							
							
								 
						
							
								551b8eeb5c 
								
							 
						 
						
							
							
								
								An sret parameter is required to be the first parameter, so there's no need to loop  
							
							... 
							
							
							
							over all the parameters of the callee looking for it.
llvm-svn: 47309 
							
						 
						
							2008-02-19 03:15:29 +00:00  
				
					
						
							
							
								 
						
							
								336824f102 
								
							 
						 
						
							
							
								
								Cleanup some of my patches from yesterday.  Refactor the check for which xform  
							
							... 
							
							
							
							to apply to a memcpy into processInstruction.  Also, fix a bug in the check due to
missing braces.
llvm-svn: 47307 
							
						 
						
							2008-02-19 03:09:45 +00:00  
				
					
						
							
							
								 
						
							
								ffca8e99b2 
								
							 
						 
						
							
							
								
								Fix Transforms/GVN/memcpy.ll, which Chris broke in r47275 by reordering the branches.  memcpy's are a kind of CallInst.  
							
							... 
							
							
							
							llvm-svn: 47305 
							
						 
						
							2008-02-19 02:53:23 +00:00  
				
					
						
							
							
								 
						
							
								fefd0202c9 
								
							 
						 
						
							
							
								
								Correctly fold divide-by-constant, even when faced with overflow.  
							
							... 
							
							
							
							llvm-svn: 47287 
							
						 
						
							2008-02-18 22:48:05 +00:00  
				
					
						
							
							
								 
						
							
								1e3c501cb8 
								
							 
						 
						
							
							
								
								Transforming -A + -B  -->  -(A + B) isn't safe for FP, thanks  
							
							... 
							
							
							
							to Dale for noticing this!
llvm-svn: 47276 
							
						 
						
							2008-02-18 17:50:16 +00:00  
				
					
						
							
							
								 
						
							
								0af5601028 
								
							 
						 
						
							
							
								
								minor code simplification, no functionality change.  
							
							... 
							
							
							
							llvm-svn: 47275 
							
						 
						
							2008-02-18 17:47:29 +00:00  
				
					
						
							
							
								 
						
							
								3549553262 
								
							 
						 
						
							
							
								
								Add support to GVN for performing sret return slot optimization.  This means that, if an sret function tail calls  
							
							... 
							
							
							
							another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct
return value.  llvm-gcc does not emit this by default.  Instead, it allocates space in the caller for the sret of
the tail call and then uses memcpy to copy the result into the caller's sret parameter.  This optimization detects
and optimizes that case.
llvm-svn: 47265 
							
						 
						
							2008-02-18 09:24:53 +00:00  
				
					
						
							
							
								 
						
							
								024f8c8f09 
								
							 
						 
						
							
							
								
								optimize away stackrestore calls that have no intervening alloca or call.  
							
							... 
							
							
							
							llvm-svn: 47258 
							
						 
						
							2008-02-18 06:12:38 +00:00  
				
					
						
							
							
								 
						
							
								0e7fd2f1a8 
								
							 
						 
						
							
							
								
								simplify some code, BreakUpSubtract always returns nonnull now.  
							
							... 
							
							
							
							llvm-svn: 47251 
							
						 
						
							2008-02-18 02:18:25 +00:00  
				
					
						
							
							
								 
						
							
								cc22601bc3 
								
							 
						 
						
							
							
								
								Fold (-x + -y) -> -(x+y) which promotes better association, fixing  
							
							... 
							
							
							
							the second half of PR2047
llvm-svn: 47244 
							
						 
						
							2008-02-17 21:03:36 +00:00  
				
					
						
							
							
								 
						
							
								5f08ec854f 
								
							 
						 
						
							
							
								
								fix pasto  
							
							... 
							
							
							
							llvm-svn: 47242 
							
						 
						
							2008-02-17 20:54:40 +00:00  
				
					
						
							
							
								 
						
							
								a70d138457 
								
							 
						 
						
							
							
								
								Split up subtracts into add+negate if they have a reassociable use or operand  
							
							... 
							
							
							
							that is also a subtract.  This implements PR2047 and Transforms/Reassociate/subtest2.ll 
llvm-svn: 47241 
							
						 
						
							2008-02-17 20:51:26 +00:00  
				
					
						
							
							
								 
						
							
								902537cd8d 
								
							 
						 
						
							
							
								
								make the logic for breaking up subtracts more explicit, no  
							
							... 
							
							
							
							functionality change.
llvm-svn: 47239 
							
						 
						
							2008-02-17 20:44:51 +00:00  
				
					
						
							
							
								 
						
							
								a42c3147cc 
								
							 
						 
						
							
							
								
								Fix PR2028  
							
							... 
							
							
							
							llvm-svn: 47150 
							
						 
						
							2008-02-15 01:24:49 +00:00  
				
					
						
							
							
								 
						
							
								2e622e4c2b 
								
							 
						 
						
							
							
								
								If loop header is also loop exiting block then OrigPN is incoming value for B loop header.  
							
							... 
							
							
							
							Fixes PR 2030.
llvm-svn: 47141 
							
						 
						
							2008-02-14 23:18:47 +00:00  
				
					
						
							
							
								 
						
							
								89acd61805 
								
							 
						 
						
							
							
								
								simplify code, no functionality change.  
							
							... 
							
							
							
							llvm-svn: 47116 
							
						 
						
							2008-02-14 07:39:01 +00:00  
				
					
						
							
							
								 
						
							
								7c77e2bc65 
								
							 
						 
						
							
							
								
								Fix PR2032. Inform the alias analysis of changes to the underlying program.  
							
							... 
							
							
							
							llvm-svn: 47111 
							
						 
						
							2008-02-14 07:11:24 +00:00  
				
					
						
							
							
								 
						
							
								0ecb76d820 
								
							 
						 
						
							
							
								
								A loop latch phi node may have uses inside loop, not just in loop header.  
							
							... 
							
							
							
							llvm-svn: 47093 
							
						 
						
							2008-02-13 22:23:07 +00:00  
				
					
						
							
							
								 
						
							
								1ee8dc97d9 
								
							 
						 
						
							
							
								
								Rename APInt's isPositive to isNonNegative, to reflect what it  
							
							... 
							
							
							
							actually does.
llvm-svn: 47090 
							
						 
						
							2008-02-13 22:09:18 +00:00  
				
					
						
							
							
								 
						
							
								22c3caab6e 
								
							 
						 
						
							
							
								
								While moving exit condition, do not drop loop latch on the floor.  
							
							... 
							
							
							
							llvm-svn: 47089 
							
						 
						
							2008-02-13 22:06:36 +00:00  
				
					
						
							
							
								 
						
							
								c281d8031b 
								
							 
						 
						
							
							
								
								Keep track of exit value operand number when operands are swapped.  
							
							... 
							
							
							
							llvm-svn: 47082 
							
						 
						
							2008-02-13 19:48:48 +00:00  
				
					
						
							
							
								 
						
							
								00dba4f734 
								
							 
						 
						
							
							
								
								Re-apply the patch to improve the optimizations of memcpy's, with several  
							
							... 
							
							
							
							bugs fixed.  This now passes PPC bootstrap.
llvm-svn: 47026 
							
						 
						
							2008-02-12 21:15:18 +00:00  
				
					
						
							
							
								 
						
							
								716c10c01e 
								
							 
						 
						
							
							
								
								Fix for bug 1996: optimize out loads of undef.  This code basically just  
							
							... 
							
							
							
							checks for a malloc/alloca immediately followed by a load.
llvm-svn: 47006 
							
						 
						
							2008-02-12 12:08:14 +00:00  
				
					
						
							
							
								 
						
							
								dcddd64424 
								
							 
						 
						
							
							
								
								Fix scalarrepl to not 'miscompile' undefined code, part  #2 .  
							
							... 
							
							
							
							This fixes the store case, my previous patch just fixed the load
case.  rdar://5707076.
llvm-svn: 46932 
							
						 
						
							2008-02-10 19:05:37 +00:00  
				
					
						
							
							
								 
						
							
								26f75e2576 
								
							 
						 
						
							
							
								
								Fix PR 1995.  
							
							... 
							
							
							
							llvm-svn: 46898 
							
						 
						
							2008-02-08 22:49:13 +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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								a82c9931f4 
								
							 
						 
						
							
							
								
								Be more precise when eliminating pointers bue to memcpy's.  This allows more  
							
							... 
							
							
							
							stores to be deleted in some cases.
llvm-svn: 46694 
							
						 
						
							2008-02-04 04:53:00 +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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								c7a4ba044b 
								
							 
						 
						
							
							
								
								Hack on vectors too.  
							
							... 
							
							
							
							llvm-svn: 46684 
							
						 
						
							2008-02-03 08:19:11 +00:00  
				
					
						
							
							
								 
						
							
								e6e3a7f6ea 
								
							 
						 
						
							
							
								
								Fold away one multiply in instcombine. This would normally be caught in  
							
							... 
							
							
							
							reassociate anyways, but they could be generated during instcombine's run.
llvm-svn: 46683 
							
						 
						
							2008-02-03 07:42:09 +00:00  
				
					
						
							
							
								 
						
							
								6b016703a9 
								
							 
						 
						
							
							
								
								Remove a couple more cases of "getNumUses() == 0". No need to walk the linked  
							
							... 
							
							
							
							list just to see if whether the list is empty.
llvm-svn: 46555 
							
						 
						
							2008-01-30 08:01:28 +00:00  
				
					
						
							
							
								 
						
							
								625e89c8b0 
								
							 
						 
						
							
							
								
								Use empty() instead of comparing size() with zero.  
							
							... 
							
							
							
							llvm-svn: 46554 
							
						 
						
							2008-01-30 07:54:16 +00:00