Rafael Espindola 
							
						 
					 
					
						
						
							
						
						0fb7dcd48f 
					 
					
						
						
							
							Let simplify cfg simplify bb with only debug and lifetime intrinsics.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134057  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-06-29 05:25:47 +00:00 
						 
				 
			
				
					
						
							
							
								Hans Wennborg 
							
						 
					 
					
						
						
							
						
						448da519cc 
					 
					
						
						
							
							Fix PR10103: Less code for enum type translation.  
						
						... 
						
						
						
						In cases such as the attached test, where the case value for a switch
destination is used in a phi node that follows the destination, it
might be better to replace that value with the condition value of the
switch, so that more blocks can be folded away with
TryToSimplifyUncondBranchFromEmptyBlock because there are less
conflicts in the phi node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133344  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-06-18 10:28:47 +00:00 
						 
				 
			
				
					
						
							
							
								Bill Wendling 
							
						 
					 
					
						
						
							
						
						6a648b8538 
					 
					
						
						
							
							If the block that we're threading through is jumped to by an indirect branch,  
						
						... 
						
						
						
						then we don't want to set the destination in the indirect branch to the
destination. This is because the indirect branch needs its destinations to have
had their block addresses taken. This isn't so of the new critical edge that's
split during this process. If it turns out that the destination block has only
one predecessor, and that being a BB with an indirect branch, then it won't be
marked as 'used' and may be removed.
PR10072
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132638  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-06-04 09:42:04 +00:00 
						 
				 
			
				
					
						
							
							
								Frits van Bommel 
							
						 
					 
					
						
						
							
						
						5649ba70fb 
					 
					
						
						
							
							Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.  
						
						... 
						
						
						
						I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131855  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-22 16:24:18 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						d3a1788da1 
					 
					
						
						
							
							Reapply r131605. This time with a fix, which is to use NoFolder.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131673  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-19 20:52:46 +00:00 
						 
				 
			
				
					
						
							
							
								Rafael Espindola 
							
						 
					 
					
						
						
							
						
						216dde91d1 
					 
					
						
						
							
							revert 131605 to fix PR9946.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131620  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-19 02:26:30 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						1f5812bd99 
					 
					
						
						
							
							Use IRBuilder.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131609  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-19 00:13:33 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						1aa89a2f91 
					 
					
						
						
							
							Use IRBuilder while simplifying unreachable.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131607  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-19 00:09:21 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						0b4ccdc98c 
					 
					
						
						
							
							Use IRBuilder while simplifying conditional branch.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131605  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 23:59:51 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						02dd5418d2 
					 
					
						
						
							
							Use IRBuilder while simplifying branch.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131598  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 23:18:47 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						176ec40cb1 
					 
					
						
						
							
							Use IRBuilder while simplifying return instruction.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131580  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 21:33:11 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						b55d924b1e 
					 
					
						
						
							
							Spread use of IRBuilder even more.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131571  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 20:53:17 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						007349dafd 
					 
					
						
						
							
							Use IRBuilder while simplifying switch instruction.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131566  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 20:35:38 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						d46ba26a6b 
					 
					
						
						
							
							Use IRBuilder while simplifying unwind.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131561  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 20:01:18 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						d3372b85e6 
					 
					
						
						
							
							Use IRBuilder while simplifying terminator.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131552  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 18:43:31 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						a23812cfbd 
					 
					
						
						
							
							Use IRBuilder while simplifying unconditional branch.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131551  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 18:28:48 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						f60364de44 
					 
					
						
						
							
							Use IRBuilder while folding two entry PHINode.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131548  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 18:16:44 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						3e410c6607 
					 
					
						
						
							
							Set up IRBuilder for use during simplification.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131545  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-18 18:01:27 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						d80e8ed2fa 
					 
					
						
						
							
							Preseve line numbers while simplifying CFG.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131508  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-17 23:29:05 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						10fcfb53fd 
					 
					
						
						
							
							SimplifyCFG: Use ComputeMaskedBits to prune dead cases from switch instructions.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131345  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-05-14 15:57:25 +00:00 
						 
				 
			
				
					
						
							
							
								Peter Collingbourne 
							
						 
					 
					
						
						
							
						
						57808b3da0 
					 
					
						
						
							
							SimplifyCFG: Expose phi node folding cost threshold as command line parameter  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130528  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-29 18:47:38 +00:00 
						 
				 
			
				
					
						
							
							
								Peter Collingbourne 
							
						 
					 
					
						
						
							
						
						f15907fead 
					 
					
						
						
							
							SimplifyCFG: Add CostRemaining parameter to DominatesMergePoint  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130527  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-29 18:47:31 +00:00 
						 
				 
			
				
					
						
							
							
								Peter Collingbourne 
							
						 
					 
					
						
						
							
						
						8a70192b51 
					 
					
						
						
							
							SimplifyCFG: Add Trunc, ZExt and SExt to the list of cheap instructions for phi node folding  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130526  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-29 18:47:25 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						3c6e746b5f 
					 
					
						
						
							
							rework FoldBranchToCommonDest to exit earlier when there is a bonus  
						
						... 
						
						
						
						instruction around, reducing work.
Greatly simplify handling of debug instructions.  There is no need to
build up a vector of them and then move them into the one predecessor
if we're processing a block.  Instead just rescan the block and *copy*
them into the pred.  If a block gets merged into multiple preds, this
will retain more debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129502  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-14 02:44:53 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						c8fbc34869 
					 
					
						
						
							
							comment cleanup, use moveBefore instead of removeFromParent+insertBefore.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129319  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-11 23:24:57 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						60d490cdc7 
					 
					
						
						
							
							Do not let debug info interfer with branch folding.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129114  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-07 23:11:25 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						949666ea16 
					 
					
						
						
							
							While hoisting common code from if/else, hoist debug info intrinsics if they match.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129078  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-07 17:27:36 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						ae6c95b58e 
					 
					
						
						
							
							Simplify. isIdenticalToWhenDefined() checks opcode.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129041  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-07 00:30:15 +00:00 
						 
				 
			
				
					
						
							
							
								Devang Patel 
							
						 
					 
					
						
						
							
						
						d418194036 
					 
					
						
						
							
							While folding branch to a common destination into a predecessor, copy dbg values also.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129035  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-04-06 22:37:20 +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 
						 
				 
			
				
					
						
							
							
								Eli Friedman 
							
						 
					 
					
						
						
							
						
						b1a6eab655 
					 
					
						
						
							
							PR9450: Make switch optimization in SimplifyCFG not dependent on the ordering  
						
						... 
						
						
						
						of pointers in an std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127650  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-03-15 02:23:35 +00:00 
						 
				 
			
				
					
						
							
							
								Eli Friedman 
							
						 
					 
					
						
						
							
						
						2adc5b6a17 
					 
					
						
						
							
							PR9420; an instruction before an unreachable is guaranteed not to have any  
						
						... 
						
						
						
						reachable uses, but there still might be uses in dead blocks.  Use the
standard solution of replacing all the uses with undef.  This is
a rare case because it's very sensitive to phase ordering in SimplifyCFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127299  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-03-09 00:48:33 +00:00 
						 
				 
			
				
					
						
							
							
								Frits van Bommel 
							
						 
					 
					
						
						
							
						
						f7b2a9d7df 
					 
					
						
						
							
							Teach SimplifyCFG that (switch (select cond, X, Y)) is better expressed as a branch.  
						
						... 
						
						
						
						Based on a patch by Alistair Lynn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126647  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-28 09:44:07 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						278be783b5 
					 
					
						
						
							
							Revert "SimplifyCFG: GEPs with just one non-constant index are also cheap."  
						
						... 
						
						
						
						Yes, there are other types than i8* and GEPs on them can produce an add+multiply.
We don't consider that cheap enough to be speculatively executed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126481  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-25 10:33:33 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						9ae59e3444 
					 
					
						
						
							
							SimplifyCFG: GEPs with just one non-constant index are also cheap.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126452  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-24 23:26:09 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						9b61c550c2 
					 
					
						
						
							
							SimplifyCFG: GEPs with constant indices are cheap enough to be executed unconditionally.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126445  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-24 22:46:11 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						33828bcb24 
					 
					
						
						
							
							SimplifyCFG: Track the number of used icmps when turning a icmp chain into a switch. If we used only one icmp, don't turn it into a switch.  
						
						... 
						
						
						
						Also prevent the switch-to-icmp transform from creating identity adds, noticed by Marius Wachtler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125056  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-07 22:37:28 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						042b27f40e 
					 
					
						
						
							
							SimplifyCFG: Also transform switches that represent a range comparison but are not sorted into sub+icmp.  
						
						... 
						
						
						
						This transforms another 1000 switches in gcc.c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124826  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-03 22:51:41 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						56442dfdcf 
					 
					
						
						
							
							SimplifyCFG: Turn switches into sub+icmp+branch if possible.  
						
						... 
						
						
						
						This makes the job of the later optzn passes easier, allowing the vast amount of
icmp transforms to chew on it.
We transform 840 switches in gcc.c, leading to a 16k byte shrink of the resulting
binary on i386-linux.
The testcase from README.txt now compiles into
  decl  %edi
  cmpl  $3, %edi
  sbbl  %eax, %eax
  andl  $1, %eax
  ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124724  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-02-02 15:56:22 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						c3f507f98a 
					 
					
						
						
							
							Re-apply r124518 with fix. Watch out for invalidated iterator.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124526  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-29 04:46:23 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						b0a42fdb36 
					 
					
						
						
							
							Revert r124518. It broke Linux self-host.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124522  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-29 02:43:04 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						5e6940788f 
					 
					
						
						
							
							Re-commit r124462 with fixes. Tail recursion elim will now dup ret into unconditional predecessor to enable TCE on demand.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124518  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-29 01:29:26 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						1b5c0cb71d 
					 
					
						
						
							
							Revert r124462. There are a few big regressions that I need to fix first.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124478  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-28 07:12:38 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						40f64cb0de 
					 
					
						
						
							
							- Stop simplifycfg from duplicating "ret" instructions into unconditional  
						
						... 
						
						
						
						branches. PR8575, rdar://5134905, rdar://8911460.
- Allow codegen tail duplication to dup small return blocks after register
  allocation is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124462  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-28 02:19:21 +00:00 
						 
				 
			
				
					
						
							
							
								Frits van Bommel 
							
						 
					 
					
						
						
							
						
						65fdded319 
					 
					
						
						
							
							Factor the actual simplification out of SimplifyIndirectBrOnSelect and into a new helper function so it can be reused in e.g. an upcoming SimplifySwitchOnSelect.  
						
						... 
						
						
						
						No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123234  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2011-01-11 12:52:11 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						a37029cd24 
					 
					
						
						
							
							simplify this a bit.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122156  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-12-18 20:22:49 +00:00 
						 
				 
			
				
					
						
							
							
								Benjamin Kramer 
							
						 
					 
					
						
						
							
						
						14c0987bd9 
					 
					
						
						
							
							SimplifyCFG: Ranges can be larger than 64 bits. Fixes Release-selfhost build.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122054  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-12-17 10:48:14 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						e27db74a60 
					 
					
						
						
							
							improve switch formation to handle small range  
						
						... 
						
						
						
						comparisons formed by comparisons.  For example,
this:
void foo(unsigned x) {
  if (x == 0 || x == 1 || x == 3 || x == 4 || x == 6) 
    bar();
}
compiles into:
_foo:                                   ## @foo
## BB#0:                                ## %entry
	cmpl	$6, %edi
	ja	LBB0_2
## BB#1:                                ## %entry
	movl	%edi, %eax
	movl	$91, %ecx
	btq	%rax, %rcx
	jb	LBB0_3
instead of:
_foo:                                   ## @foo
## BB#0:                                ## %entry
	cmpl	$2, %edi
	jb	LBB0_4
## BB#1:                                ## %switch.early.test
	cmpl	$6, %edi
	ja	LBB0_3
## BB#2:                                ## %switch.early.test
	movl	%edi, %eax
	movl	$88, %ecx
	btq	%rax, %rcx
	jb	LBB0_4
This catches a bunch of cases in GCC, which look like this:
 %804 = load i32* @which_alternative, align 4, !tbaa !0 
 %805 = icmp ult i32 %804, 2
 %806 = icmp eq i32 %804, 3
 %or.cond121 = or i1 %805, %806
 %807 = icmp eq i32 %804, 4
 %or.cond124 = or i1 %or.cond121, %807
 br i1 %or.cond124, label %.thread, label %808
turning this into a range comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122045  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-12-17 06:20:15 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						ba3c815570 
					 
					
						
						
							
							make qsort predicate more conformant by returning 0 for equal values.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121838  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2010-12-15 04:52:41 +00:00