43dc11c525 
								
							 
						 
						
							
							
								
								Add strncpy libcall creator.  Use it when it should be used.  
							
							... 
							
							
							
							llvm-svn: 98219 
							
						 
						
							2010-03-11 01:25:07 +00:00  
				
					
						
							
							
								 
						
							
								4f2fd2d2be 
								
							 
						 
						
							
							
								
								Re-commit 97860 with fix. getMallocAllocatedType may return null.  
							
							... 
							
							
							
							llvm-svn: 98000 
							
						 
						
							2010-03-08 22:54:36 +00:00  
				
					
						
							
							
								 
						
							
								1810d77cb4 
								
							 
						 
						
							
							
								
								Let the fallthrough handle whether or not we've changed anything  
							
							... 
							
							
							
							before we try to optimize.
llvm-svn: 97876 
							
						 
						
							2010-03-06 10:59:25 +00:00  
				
					
						
							
							
								 
						
							
								a7fb58f5f5 
								
							 
						 
						
							
							
								
								Migrate _chk call lowering from SimplifyLibCalls to InstCombine. Stub  
							
							... 
							
							
							
							out the remainder of the calls that we should lower in some way and
move the tests to the new correct directory. Fix up tests that are now
optimized more than they were before by -instcombine.
llvm-svn: 97875 
							
						 
						
							2010-03-06 10:50:38 +00:00  
				
					
						
							
							
								 
						
							
								d8b43d0e59 
								
							 
						 
						
							
							
								
								Temporarily revert:  
							
							... 
							
							
							
							Log:
Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.
Modified:
   llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
   llvm/trunk/test/Transforms/InstCombine/objsize.ll
It appears to be causing swb and nightly test failures.
llvm-svn: 97866 
							
						 
						
							2010-03-06 03:11:35 +00:00  
				
					
						
							
							
								 
						
							
								afdc7d3aab 
								
							 
						 
						
							
							
								
								Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.  
							
							... 
							
							
							
							llvm-svn: 97860 
							
						 
						
							2010-03-06 01:01:42 +00:00  
				
					
						
							
							
								 
						
							
								fffdad58ac 
								
							 
						 
						
							
							
								
								Instcombine should turn llvm.objectsize of a alloca with static size to an integer.  
							
							... 
							
							
							
							llvm-svn: 97827 
							
						 
						
							2010-03-05 20:47:23 +00:00  
				
					
						
							
							
								 
						
							
								43d6ff7701 
								
							 
						 
						
							
							
								
								Add missing break for Intrinsic::objectsize case. It was falling through to the following Intrinsic::bswap code. I have no idea why it wasn't breaking stuff.  
							
							... 
							
							
							
							llvm-svn: 97774 
							
						 
						
							2010-03-05 01:22:47 +00:00  
				
					
						
							
							
								 
						
							
								3688b8fa68 
								
							 
						 
						
							
							
								
								Instcombine constant folding can normalize gep with negative index to index with large offset. When instcombine objsize checking transformation sees these geps where the offset seemingly point out of bound, it should just return "i don't know" rather than asserting.  
							
							... 
							
							
							
							llvm-svn: 96825 
							
						 
						
							2010-02-22 23:34:00 +00:00  
				
					
						
							
							
								 
						
							
								19d0b47b1f 
								
							 
						 
						
							
							
								
								There are two ways of checking for a given type, for example isa<PointerType>(T)  
							
							... 
							
							
							
							and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.
llvm-svn: 96344 
							
						 
						
							2010-02-16 11:11:14 +00:00  
				
					
						
							
							
								 
						
							
								9dff9bec31 
								
							 
						 
						
							
							
								
								Uniformize the names of type predicates: rather than having isFloatTy and  
							
							... 
							
							
							
							isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!
llvm-svn: 96223 
							
						 
						
							2010-02-15 16:12:20 +00:00  
				
					
						
							
							
								 
						
							
								843a4cc43c 
								
							 
						 
						
							
							
								
								Fix a problem where we had bitcasted operands that gave us  
							
							... 
							
							
							
							odd offsets since the bitcasted pointer size and the offset pointer
size are going to be different types for the GEP vs base object.
llvm-svn: 96134 
							
						 
						
							2010-02-13 23:38:01 +00:00  
				
					
						
							
							
								 
						
							
								cccdc13662 
								
							 
						 
						
							
							
								
								Make sure that ConstantExpr offsets also aren't off of extern  
							
							... 
							
							
							
							symbols.
Thanks to Duncan Sands for the testcase!
llvm-svn: 95877 
							
						 
						
							2010-02-11 17:44:04 +00:00  
				
					
						
							
							
								 
						
							
								531ea566a6 
								
							 
						 
						
							
							
								
								Add ConstantExpr handling to Intrinsic::objectsize lowering.  
							
							... 
							
							
							
							Update testcase accordingly now that we can optimize another
section.
llvm-svn: 95846 
							
						 
						
							2010-02-11 01:48:54 +00:00  
				
					
						
							
							
								 
						
							
								7b7028fd24 
								
							 
						 
						
							
							
								
								Move Intrinsic::objectsize lowering back to InstCombineCalls and  
							
							... 
							
							
							
							enable constant 0 offset lowering.
llvm-svn: 95691 
							
						 
						
							2010-02-09 21:24:27 +00:00  
				
					
						
							
							
								 
						
							
								04371b4f12 
								
							 
						 
						
							
							
								
								Remove this code for now. I have a better idea and will rewrite with  
							
							... 
							
							
							
							that in mind.
llvm-svn: 95402 
							
						 
						
							2010-02-05 19:04:06 +00:00  
				
					
						
							
							
								 
						
							
								107a1fbf61 
								
							 
						 
						
							
							
								
								Temporarily revert this since it appears to have caused a build  
							
							... 
							
							
							
							failure.
llvm-svn: 95294 
							
						 
						
							2010-02-04 06:41:27 +00:00  
				
					
						
							
							
								 
						
							
								42fa84a880 
								
							 
						 
						
							
							
								
								Rework constant expr and array handling for objectsize instcombining.  
							
							... 
							
							
							
							Fix bugs where we would compute out of bounds as in bounds, and where
we couldn't know that the linker could override the size of an array.
Add a few new testcases, change existing testcase to use a private
global array instead of extern.
llvm-svn: 95283 
							
						 
						
							2010-02-04 02:55:34 +00:00  
				
					
						
							
							
								 
						
							
								f12e18db21 
								
							 
						 
						
							
							
								
								If we're dealing with a zero-length array, don't lower to any  
							
							... 
							
							
							
							particular size, we just don't know what the length is yet.
llvm-svn: 95266 
							
						 
						
							2010-02-03 23:56:07 +00:00  
				
					
						
							
							
								 
						
							
								d86233c118 
								
							 
						 
						
							
							
								
								Recommit this, looks like it wasn't the cause.  
							
							... 
							
							
							
							llvm-svn: 95165 
							
						 
						
							2010-02-03 00:21:58 +00:00  
				
					
						
							
							
								 
						
							
								e67d01a9a8 
								
							 
						 
						
							
							
								
								Hopefully temporarily revert this.  
							
							... 
							
							
							
							llvm-svn: 95154 
							
						 
						
							2010-02-02 23:01:31 +00:00  
				
					
						
							
							
								 
						
							
								f9553572b7 
								
							 
						 
						
							
							
								
								Reformat my last patch slightly.  
							
							... 
							
							
							
							llvm-svn: 95147 
							
						 
						
							2010-02-02 22:29:26 +00:00  
				
					
						
							
							
								 
						
							
								4264e7e46f 
								
							 
						 
						
							
							
								
								Re-add strcmp and known size object size checking optimization.  
							
							... 
							
							
							
							Passed bootstrap and nightly test run here.
llvm-svn: 95145 
							
						 
						
							2010-02-02 22:10:43 +00:00  
				
					
						
							
							
								 
						
							
								846a52e228 
								
							 
						 
						
							
							
								
								fix rdar://7590304, a miscompilation of objc apps on arm.  The caller  
							
							... 
							
							
							
							of objc message send was getting marked arm_apcscc, but the prototype
isn't.  This is fine at runtime because objcmsgsend is implemented in
assembly.  Only turn a mismatched caller and callee into 'unreachable'
if the callee is a definition.
llvm-svn: 94986 
							
						 
						
							2010-02-01 18:11:34 +00:00  
				
					
						
							
							
								 
						
							
								2cecedf081 
								
							 
						 
						
							
							
								
								fix rdar://7590304, an infinite loop in instcombine.  In the invoke  
							
							... 
							
							
							
							case, instcombine can't zap the invoke for fear of changing the CFG.
However, we have to do something to prevent the next iteration of
instcombine from inserting another store -> undef before the invoke
thereby getting into infinite iteration between dead store elim and
store insertion.
Just zap the callee to null, which will prevent the next iteration
from doing anything.
llvm-svn: 94985 
							
						 
						
							2010-02-01 18:04:58 +00:00  
				
					
						
							
							
								 
						
							
								5a0e174863 
								
							 
						 
						
							
							
								
								Revert my last couple of patches. They appear to have broken bison.  
							
							... 
							
							
							
							llvm-svn: 94841 
							
						 
						
							2010-01-29 21:16:24 +00:00  
				
					
						
							
							
								 
						
							
								997f7ca8c5 
								
							 
						 
						
							
							
								
								Add constant support to object size handling and remove default  
							
							... 
							
							
							
							lowering. We'll either figure it out, or not and be lowered by
SelectionDAGBuild.
Add test.
llvm-svn: 94775 
							
						 
						
							2010-01-29 01:09:57 +00:00  
				
					
						
							
							
								 
						
							
								4a1d7e1506 
								
							 
						 
						
							
							
								
								Remove unnecessary dyn_cast and add a comment.  Part of a WIP.  
							
							... 
							
							
							
							llvm-svn: 93026 
							
						 
						
							2010-01-08 21:37:11 +00:00  
				
					
						
							
							
								 
						
							
								2cdb806fd8 
								
							 
						 
						
							
							
								
								Move the object size intrinsic optimization to inst-combine and make  
							
							... 
							
							
							
							it work for any integer size return type.
llvm-svn: 92853 
							
						 
						
							2010-01-06 20:04:44 +00:00  
				
					
						
							
							
								 
						
							
								d2564e3afb 
								
							 
						 
						
							
							
								
								Move remaining stuff to the isInteger predicate.  
							
							... 
							
							
							
							llvm-svn: 92771 
							
						 
						
							2010-01-05 21:05:54 +00:00  
				
					
						
							
							
								 
						
							
								7a9e47ac4b 
								
							 
						 
						
							
							
								
								split call handling out to InstCombineCalls.cpp  
							
							... 
							
							
							
							llvm-svn: 92707 
							
						 
						
							2010-01-05 07:32:13 +00:00