Micah Villmow 
							
						 
					 
					
						
						
							
						
						fb384d61c7 
					 
					
						
						
							
							Revert 165732 for further review.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-10-11 21:27:41 +00:00 
						 
				 
			
				
					
						
							
							
								Micah Villmow 
							
						 
					 
					
						
						
							
						
						f3840d2c16 
					 
					
						
						
							
							Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165726  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-10-11 17:21:41 +00:00 
						 
				 
			
				
					
						
							
							
								Micah Villmow 
							
						 
					 
					
						
						
							
						
						3574eca1b0 
					 
					
						
						
							
							Move TargetData to DataLayout.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-10-08 16:38:25 +00:00 
						 
				 
			
				
					
						
							
							
								Sylvestre Ledru 
							
						 
					 
					
						
						
							
						
						94c22716d6 
					 
					
						
						
							
							Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See:  http://en.wikipedia.org/wiki/If_and_only_if  Commit 164767  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-09-27 10:14:43 +00:00 
						 
				 
			
				
					
						
							
							
								Sylvestre Ledru 
							
						 
					 
					
						
						
							
						
						7e2c793a2b 
					 
					
						
						
							
							Fix a typo 'iff' => 'if'  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-09-27 09:59:43 +00:00 
						 
				 
			
				
					
						
							
							
								Jakob Stoklund Olesen 
							
						 
					 
					
						
						
							
						
						7ee3ca10f5 
					 
					
						
						
							
							Revert remaining part of r93200: "Disable folding sext(trunc(x)) -> x"  
						
						... 
						
						
						
						This fixes PR5997.
These transforms were disabled because codegen couldn't deal with other
uses of trunc(x). This is now handled by the peephole pass.
This causes no regressions on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159003  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-06-22 16:36:43 +00:00 
						 
				 
			
				
					
						
							
							
								Nuno Lopes 
							
						 
					 
					
						
						
							
						
						b47f3ea224 
					 
					
						
						
							
							replace usage of EmitGEPOffset() with TargetData::getIndexedOffset() when the GEP offset is known to be constant.  
						
						... 
						
						
						
						With this change, we avoid relying on the IR Builder to constant fold the operations.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158829  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-06-20 17:30:51 +00:00 
						 
				 
			
				
					
						
							
							
								Stepan Dyatkovskiy 
							
						 
					 
					
						
						
							
						
						3f71cf14b2 
					 
					
						
						
							
							Small fix in InstCombineCasts.cpp. Restored "alloca + bitcast" reducing for case when alloca's size is calculated within the "add/sub/... nsw".  
						
						... 
						
						
						
						Also added fix to 2011-06-13-nsw-alloca.ll test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156231  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-05-05 07:09:40 +00:00 
						 
				 
			
				
					
						
							
							
								Rafael Espindola 
							
						 
					 
					
						
						
							
						
						26c8dcc692 
					 
					
						
						
							
							Always compute all the bits in ComputeMaskedBits.  
						
						... 
						
						
						
						This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcombine
to simplify cases like the one in the included testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154011  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-04-04 12:51:34 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						7302d80490 
					 
					
						
						
							
							Remove some dead code and tidy things up now that vectors use ConstantDataVector  
						
						... 
						
						
						
						instead of always using ConstantVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149912  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-02-06 21:56:39 +00:00 
						 
				 
			
				
					
						
							
							
								David Blaikie 
							
						 
					 
					
						
						
							
						
						4d6ccb5f68 
					 
					
						
						
							
							More dead code removal (using -Wunreachable-code)  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2012-01-20 21:51:11 +00:00 
						 
				 
			
				
					
						
							
							
								Dan Gohman 
							
						 
					 
					
						
						
							
						
						ce16339930 
					 
					
						
						
							
							The powers that be have decided that LLVM IR should now support 16-bit  
						
						... 
						
						
						
						"half precision" floating-point with a first-class type.
This patch adds basic IR support (but not codegen support).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-12-17 00:04:22 +00:00 
						 
				 
			
				
					
						
							
							
								Chad Rosier 
							
						 
					 
					
						
						
							
						
						00737bdb48 
					 
					
						
						
							
							Last bit of TargetLibraryInfo propagation.  Also fixed a case for TargetData  
						
						... 
						
						
						
						where it appeared beneficial to pass.
More of rdar://10500969
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145630  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-12-01 21:29:16 +00:00 
						 
				 
			
				
					
						
							
							
								Chad Rosier 
							
						 
					 
					
						
						
							
						
						caebb1e00b 
					 
					
						
						
							
							Whitespace.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145470  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-11-30 01:59:59 +00:00 
						 
				 
			
				
					
						
							
							
								Chad Rosier 
							
						 
					 
					
						
						
							
						
						3d925d24e8 
					 
					
						
						
							
							Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo.  Disable  
						
						... 
						
						
						
						(fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is 
specified.
rdar://10466410
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145460  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-11-29 23:57:10 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						a9390a4d5f 
					 
					
						
						
							
							Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit.  
						
						... 
						
						
						
						If someone prefers %tmp42 to %42, run instnamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-09-27 20:39:19 +00:00 
						 
				 
			
				
					
						
							
							
								Nadav Rotem 
							
						 
					 
					
						
						
							
						
						89879ec76b 
					 
					
						
						
							
							Fixes following the CR by Chris and Duncan:  
						
						... 
						
						
						
						Optimize chained bitcasts of the form A->B->A.
Undo r138722 and change isEliminableCastPair to allow this case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138756  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-08-29 19:58:36 +00:00 
						 
				 
			
				
					
						
							
							
								Nadav Rotem 
							
						 
					 
					
						
						
							
						
						be6ceb6ebc 
					 
					
						
						
							
							Bitcasts are transitive. Bitcast-Bitcast-X becomes Bitcast-X.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138722  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-08-28 11:51:08 +00:00 
						 
				 
			
				
					
						
							
							
								Jay Foad 
							
						 
					 
					
						
						
							
						
						a9203109f4 
					 
					
						
						
							
							Convert GetElementPtrInst to use ArrayRef.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-07-25 09:48:08 +00:00 
						 
				 
			
				
					
						
							
							
								Jay Foad 
							
						 
					 
					
						
						
							
						
						0a2a60ace9 
					 
					
						
						
							
							Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use  
						
						... 
						
						
						
						ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135761  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-07-22 08:16:57 +00:00 
						 
				 
			
				
					
						
							
							
								Eli Friedman 
							
						 
					 
					
						
						
							
						
						747032522f 
					 
					
						
						
							
							Clean up includes of llvm/Analysis/ConstantFolding.h so it's included where it's used and not included where it isn't.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135628  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-07-20 21:57:23 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						db125cfaf5 
					 
					
						
						
							
							land David Blaikie's patch to de-constify Type, with a few tweaks.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-07-18 04:54:35 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						93a635c82c 
					 
					
						
						
							
							It's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is another use of sqrt. rdar://9763193  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135058  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-07-13 19:08:16 +00:00 
						 
				 
			
				
					
						
							
							
								Bob Wilson 
							
						 
					 
					
						
						
							
						
						e2e86f6bca 
					 
					
						
						
							
							Reapply a fixed version of r133285.  
						
						... 
						
						
						
						This tightens up checking for overflow in alloca sizes, based on feedback
from Duncan and John about the change in r132926.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134749  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-07-08 22:09:33 +00:00 
						 
				 
			
				
					
						
							
							
								Chad Rosier 
							
						 
					 
					
						
						
							
						
						66638b2333 
					 
					
						
						
							
							Revert r133285.  Causing odd failures on Dragonegg.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133301  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-06-17 22:08:25 +00:00 
						 
				 
			
				
					
						
							
							
								Stuart Hastings 
							
						 
					 
					
						
						
							
						
						3761c34e03 
					 
					
						
						
							
							Relocate NUW test to cover all binary ops in a dynamic alloca expr.  
						
						... 
						
						
						
						Followup to 132926.  rdar://problem/9265821
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133285  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-06-17 20:21:52 +00:00 
						 
				 
			
				
					
						
							
							
								Stuart Hastings 
							
						 
					 
					
						
						
							
						
						7ac8f8f341 
					 
					
						
						
							
							Avoid fusing bitcasts with dynamic allocas if the amount-to-allocate  
						
						... 
						
						
						
						might overflow.  Re-typing the alloca to a larger type (e.g. double)
hoists a shift into the alloca, potentially exposing overflow in the
expression.  rdar://problem/9265821
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132926  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-06-13 18:48:49 +00:00 
						 
				 
			
				
					
						
							
							
								Eli Friedman 
							
						 
					 
					
						
						
							
						
						a311c34d2a 
					 
					
						
						
							
							Final step of instcombine debuginfo; switch a couple more places over to InsertNewInstWith, and use setDebugLoc for the cases which can't be easily handled by the automated mechanisms.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132167  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-27 00:19:40 +00:00 
						 
				 
			
				
					
						
							
							
								Eli Friedman 
							
						 
					 
					
						
						
							
						
						107ffd58f7 
					 
					
						
						
							
							More instcombine simplifications towards better debug locations.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131596  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 23:11:30 +00:00 
						 
				 
			
				
					
						
							
							
								Eli Friedman 
							
						 
					 
					
						
						
							
						
						3e22cb9ec3 
					 
					
						
						
							
							Use ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in instcombine.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131512  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 00:32:01 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						f5b75932b8 
					 
					
						
						
							
							While SimplifyDemandedBits constant folds this, we can't rely on it here.  
						
						... 
						
						
						
						It's possible to craft an input that hits the recursion limits in a way
that SimplifyDemandedBits doesn't simplify the icmp but ComputeMaskedBits
can infer which bits are zero.
No test case as it depends on too many other things. Fixes PR9609.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128777  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-02 18:50:58 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						406a650237 
					 
					
						
						
							
							Fix comment.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128745  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-01 22:29:18 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						5337fabdc4 
					 
					
						
						
							
							Tweaks to the icmp+sext-to-shifts optimization to address Frits' comments:  
						
						... 
						
						
						
						- Localize the check if an icmp has one use to a place where we know we're
  introducing something that's likely more expensive than a sext from i1.
- Add an assert to make sure a case that would lead to a miscompilation is
  folded away earlier.
- Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128744  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-01 22:22:11 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						ce1498bdbe 
					 
					
						
						
							
							Fix build.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128733  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-01 20:15:16 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						0baa94a13b 
					 
					
						
						
							
							InstCombine: Turn icmp + sext into bitwise/integer ops when the input has only one unknown bit.  
						
						... 
						
						
						
						int test1(unsigned x) { return (x&8) ? 0 : -1; }
int test3(unsigned x) { return (x&8) ? -1 : 0; }
before (x86_64):
_test1:
	andl	$8, %edi
	cmpl	$1, %edi
	sbbl	%eax, %eax
	ret
_test3:
	andl	$8, %edi
	cmpl	$1, %edi
	sbbl	%eax, %eax
	notl	%eax
	ret
after:
_test1:
	shrl	$3, %edi
	andl	$1, %edi
	leal	-1(%rdi), %eax
	ret
_test3:
	shll	$28, %edi
	movl	%edi, %eax
	sarl	$31, %eax
	ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128732  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-01 20:09:10 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						0a30c42008 
					 
					
						
						
							
							InstCombine: Move (sext icmp) transforms into their own method. No intended functionality change.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128731  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-01 20:09:03 +00:00 
						 
				 
			
				
					
						
							
							
								Jay Foad 
							
						 
					 
					
						
						
							
						
						3ecfc861b4 
					 
					
						
						
							
							Remove PHINode::reserveOperandSpace(). Instead, add a parameter to  
						
						... 
						
						
						
						PHINode::Create() giving the (known or expected) number of operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-03-30 11:28:46 +00:00 
						 
				 
			
				
					
						
							
							
								Jay Foad 
							
						 
					 
					
						
						
							
						
						d8b4fb4aab 
					 
					
						
						
							
							(Almost) always call reserveOperandSpace() on newly created PHINodes.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-03-30 11:19:20 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						5aa3fa6d82 
					 
					
						
						
							
							llvm.dbg.declare intrinsic does not use any llvm::Values. It's magic!  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127282  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-03-08 22:12:11 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						2ca5c8644e 
					 
					
						
						
							
							convert ConstantVector::get to use ArrayRef.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-15 00:14:00 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						7583190422 
					 
					
						
						
							
							revert my ConstantVector patch, it seems to have made the llvm-gcc  
						
						... 
						
						
						
						builders unhappy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-14 18:15:46 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						283c8caccd 
					 
					
						
						
							
							Switch ConstantVector::get to use ArrayRef instead of a pointer+size  
						
						... 
						
						
						
						idiom.  Change various clients to simplify their code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-14 07:55:32 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						62fe406dc2 
					 
					
						
						
							
							implement an instcombine xform that canonicalizes casts outside of and-with-constant operations.  
						
						... 
						
						
						
						This fixes rdar://8808586 which observed that we used to compile:
union xy {
        struct x { _Bool b[15]; } x;
        __attribute__((packed))
        struct y {
                __attribute__((packed)) unsigned long b0to7;
                __attribute__((packed)) unsigned int b8to11;
                __attribute__((packed)) unsigned short b12to13;
                __attribute__((packed)) unsigned char b14;
        } y;
};
struct x
foo(union xy *xy)
{
        return xy->x;
}
into:
_foo:                                   ## @foo
	movq	(%rdi), %rax
	movabsq	$1095216660480, %rcx    ## imm = 0xFF00000000
	andq	%rax, %rcx
	movabsq	$-72057594037927936, %rdx ## imm = 0xFF00000000000000
	andq	%rax, %rdx
	movzbl	%al, %esi
	orq	%rdx, %rsi
	movq	%rax, %rdx
	andq	$65280, %rdx            ## imm = 0xFF00
	orq	%rsi, %rdx
	movq	%rax, %rsi
	andq	$16711680, %rsi         ## imm = 0xFF0000
	orq	%rdx, %rsi
	movl	%eax, %edx
	andl	$-16777216, %edx        ## imm = 0xFFFFFFFFFF000000
	orq	%rsi, %rdx
	orq	%rcx, %rdx
	movabsq	$280375465082880, %rcx  ## imm = 0xFF0000000000
	movq	%rax, %rsi
	andq	%rcx, %rsi
	orq	%rdx, %rsi
	movabsq	$71776119061217280, %r8 ## imm = 0xFF000000000000
	andq	%r8, %rax
	orq	%rsi, %rax
	movzwl	12(%rdi), %edx
	movzbl	14(%rdi), %esi
	shlq	$16, %rsi
	orl	%edx, %esi
	movq	%rsi, %r9
	shlq	$32, %r9
	movl	8(%rdi), %edx
	orq	%r9, %rdx
	andq	%rdx, %rcx
	movzbl	%sil, %esi
	shlq	$32, %rsi
	orq	%rcx, %rsi
	movl	%edx, %ecx
	andl	$-16777216, %ecx        ## imm = 0xFFFFFFFFFF000000
	orq	%rsi, %rcx
	movq	%rdx, %rsi
	andq	$16711680, %rsi         ## imm = 0xFF0000
	orq	%rcx, %rsi
	movq	%rdx, %rcx
	andq	$65280, %rcx            ## imm = 0xFF00
	orq	%rsi, %rcx
	movzbl	%dl, %esi
	orq	%rcx, %rsi
	andq	%r8, %rdx
	orq	%rsi, %rdx
	ret
We now compile this into:
_foo:                                   ## @foo
## BB#0:                                ## %entry
	movzwl	12(%rdi), %eax
	movzbl	14(%rdi), %ecx
	shlq	$16, %rcx
	orl	%eax, %ecx
	shlq	$32, %rcx
	movl	8(%rdi), %edx
	orq	%rcx, %rdx
	movq	(%rdi), %rax
	ret
A small improvement :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123520  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-15 06:32:33 +00:00 
						 
				 
			
				
					
						
							
							
								Bill Wendling 
							
						 
					 
					
						
						
							
						
						2d0537cdd8 
					 
					
						
						
							
							Whitespace fixes. No functionality change.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122110  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-12-17 23:27:41 +00:00 
						 
				 
			
				
					
						
							
							
								Nate Begeman 
							
						 
					 
					
						
						
							
						
						9a3dc55202 
					 
					
						
						
							
							Add vector versions of some existing scalar transforms to aid codegen in matching psign & pblend operations to the IR produced by clang/gcc for their C idioms.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122105  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-12-17 23:12:19 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						979ed44feb 
					 
					
						
						
							
							Fix a serious performance regression introduced by r108687 on linux:  
						
						... 
						
						
						
						turning (fptrunc (sqrt (fpext x))) -> (sqrtf x)  is great, but we have
to delete the original sqrt as well.  Not doing so causes us to do 
two sqrt's when building with -fmath-errno (the default on linux).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113260  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-09-07 20:01:38 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						157d4ead36 
					 
					
						
						
							
							for completeness, allow undef also.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112351  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-08-28 03:36:51 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						7900779543 
					 
					
						
						
							
							handle the constant case of vector insertion.  For something  
						
						... 
						
						
						
						like this:
struct S { float A, B, C, D; };
struct S g;
struct S bar() { 
  struct S A = g;
  ++A.B;
  A.A = 42;
  return A;
}
we now generate:
_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	12(%rax), %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	unpcklps	%xmm0, %xmm1
	addss	LCPI1_0(%rip), %xmm2
	pshufd	$16, %xmm2, %xmm2
	movss	LCPI1_1(%rip), %xmm0
	pshufd	$16, %xmm0, %xmm0
	unpcklps	%xmm2, %xmm0
	ret
instead of:
_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	12(%rax), %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	unpcklps	%xmm0, %xmm1
	addss	LCPI1_0(%rip), %xmm2
	movd	%xmm2, %eax
	shlq	$32, %rax
	addq	$1109917696, %rax       ## imm = 0x42280000
	movd	%rax, %xmm0
	ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112345  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-08-28 01:50:57 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						3dd08734c1 
					 
					
						
						
							
							optimize bitcasts from large integers to vector into vector  
						
						... 
						
						
						
						element insertion from the pieces that feed into the vector.
This handles a pattern that occurs frequently due to code
generated for the x86-64 abi.  We now compile something like
this:
struct S { float A, B, C, D; };
struct S g;
struct S bar() { 
  struct S A = g;
  ++A.A;
  ++A.C;
  return A;
}
into all nice vector operations:
_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	12(%rax), %xmm3
	pshufd	$16, %xmm2, %xmm2
	unpcklps	%xmm2, %xmm0
	addss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	pshufd	$16, %xmm3, %xmm2
	unpcklps	%xmm2, %xmm1
	ret
instead of icky integer operations:
_bar:                                   ## @bar
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	movd	%xmm0, %ecx
	movl	4(%rax), %edx
	movl	12(%rax), %esi
	shlq	$32, %rdx
	addq	%rcx, %rdx
	movd	%rdx, %xmm0
	addss	8(%rax), %xmm1
	movd	%xmm1, %eax
	shlq	$32, %rsi
	addq	%rax, %rsi
	movd	%rsi, %xmm1
	ret
This resolves rdar://8360454
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112343  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-08-28 01:20:38 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						29cc0b3660 
					 
					
						
						
							
							Implement a pretty general logical shift propagation  
						
						... 
						
						
						
						framework, which is good at ripping through bitfield
operations.  This generalize a bunch of the existing
xforms that instcombine does, such as 
  (x << c) >> c -> and
to handle intermediate logical nodes.  This is useful for
ripping up the "promote to large integer" code produced by
SRoA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112304  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-08-27 22:24:38 +00:00