8ac477ffb5 
								
							 
						 
						
							
							
								
								Begin adding static dependence information to passes, which will allow us to  
							
							... 
							
							
							
							perform initialization without static constructors AND without explicit initialization
by the client.  For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve.  I hope to be able to relax
the latter requirement in the future.
llvm-svn: 116334 
							
						 
						
							2010-10-12 19:48:12 +00:00  
				
					
						
							
							
								 
						
							
								df7a4f2515 
								
							 
						 
						
							
							
								
								Now with fewer extraneous semicolons!  
							
							... 
							
							
							
							llvm-svn: 115996 
							
						 
						
							2010-10-07 22:25:06 +00:00  
				
					
						
							
							
								 
						
							
								99c985c37d 
								
							 
						 
						
							
							
								
								Fix PR8247: JumpThreading can cause a block to become unreachable while still having predecessor, if it is part of a self-loop.  
							
							... 
							
							
							
							Because of this, we cannot use the Simplify* APIs, as they can assert-fail on unreachable code.  Since it's not easy to determine
if a given threading will cause a block to become unreachable, simply defer simplifying simplification to later InstCombine and/or
DCE passes.
llvm-svn: 115082 
							
						 
						
							2010-09-29 20:34:41 +00:00  
				
					
						
							
							
								 
						
							
								d361aac3d0 
								
							 
						 
						
							
							
								
								Remove the option to disable LazyValueInfo in JumpThreading, as it is now  
							
							... 
							
							
							
							on by default and has received significant testing.
llvm-svn: 113852 
							
						 
						
							2010-09-14 20:57:41 +00:00  
				
					
						
							
							
								 
						
							
								e6214557e7 
								
							 
						 
						
							
							
								
								Change lower atomic pass to use IntrinsicInst to simplify it a bit.  
							
							... 
							
							
							
							llvm-svn: 113114 
							
						 
						
							2010-09-05 20:10:47 +00:00  
				
					
						
							
							
								 
						
							
								05ef361b5e 
								
							 
						 
						
							
							
								
								eliminate some non-obvious casts.  UndefValue isa Constant.  
							
							... 
							
							
							
							llvm-svn: 113113 
							
						 
						
							2010-09-05 20:03:09 +00:00  
				
					
						
							
							
								 
						
							
								6778149f7e 
								
							 
						 
						
							
							
								
								Reapply commit 112699, speculatively reverted by echristo, since  
							
							... 
							
							
							
							I'm sure it is harmless.  Original commit message:
If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.
llvm-svn: 112810 
							
						 
						
							2010-09-02 08:14:03 +00:00  
				
					
						
							
							
								 
						
							
								73f988cafa 
								
							 
						 
						
							
							
								
								JumpThreading keeps LazyValueInfo up to date, so we don't need to rerun it  
							
							... 
							
							
							
							if we schedule another LVI-using pass afterwards.
llvm-svn: 112722 
							
						 
						
							2010-09-01 18:27:22 +00:00  
				
					
						
							
							
								 
						
							
								a5d315c665 
								
							 
						 
						
							
							
								
								Speculatively revert 112699 and 112702, they seem to be causing  
							
							... 
							
							
							
							self host errors on clang-x86-64.
llvm-svn: 112719 
							
						 
						
							2010-09-01 17:29:10 +00:00  
				
					
						
							
							
								 
						
							
								f7b18437b5 
								
							 
						 
						
							
							
								
								If PrototypeValue is erased in the middle of using the SSAUpdator  
							
							... 
							
							
							
							then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.
llvm-svn: 112699 
							
						 
						
							2010-09-01 10:29:33 +00:00  
				
					
						
							
							
								 
						
							
								3c84ecb067 
								
							 
						 
						
							
							
								
								More cleanups of my JumpThreading transforms, including extracting some duplicated code into a helper function.  
							
							... 
							
							
							
							llvm-svn: 112634 
							
						 
						
							2010-08-31 20:26:04 +00:00  
				
					
						
							
							
								 
						
							
								6fdcb172a9 
								
							 
						 
						
							
							
								
								Add an RAII helper to make cleanup of the RecursionSet more fool-proof.  
							
							... 
							
							
							
							llvm-svn: 112628 
							
						 
						
							2010-08-31 19:24:27 +00:00  
				
					
						
							
							
								 
						
							
								cd4de7f399 
								
							 
						 
						
							
							
								
								Refactor my fix for PR5652 to terminate the predecessor lookups after the first failure.  
							
							... 
							
							
							
							llvm-svn: 112620 
							
						 
						
							2010-08-31 18:48:48 +00:00  
				
					
						
							
							
								 
						
							
								3997a07fb9 
								
							 
						 
						
							
							
								
								More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly constant-fold undef, and be more careful with its return value.  
							
							... 
							
							
							
							This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's
handling of and/or of i1's), but never manifested before.  This patch adds a tracking set to prevent this case.
llvm-svn: 112589 
							
						 
						
							2010-08-31 07:36:34 +00:00  
				
					
						
							
							
								 
						
							
								c910acb54a 
								
							 
						 
						
							
							
								
								Re-apply r112539, being more careful to respect the return values of the constant folding methods.  Additionally,  
							
							... 
							
							
							
							use the ConstantExpr::get*() methods to simplify some constant folding.
llvm-svn: 112550 
							
						 
						
							2010-08-30 23:22:36 +00:00  
				
					
						
							
							
								 
						
							
								1ddcbbe49c 
								
							 
						 
						
							
							
								
								Revert r112539.  It accidentally introduced a miscompilation.  
							
							... 
							
							
							
							llvm-svn: 112543 
							
						 
						
							2010-08-30 22:33:41 +00:00  
				
					
						
							
							
								 
						
							
								75f6037c7c 
								
							 
						 
						
							
							
								
								Fixes and cleanups pointed out by Chris.  In general, be careful to handle 0 results from ComputeValueKnownInPredecessors  
							
							... 
							
							
							
							(indicating undef), and re-use existing constant folding APIs.
llvm-svn: 112539 
							
						 
						
							2010-08-30 22:07:52 +00:00  
				
					
						
							
							
								 
						
							
								99d4cb861b 
								
							 
						 
						
							
							
								
								Fix typos in comments.  
							
							... 
							
							
							
							llvm-svn: 112286 
							
						 
						
							2010-08-27 20:32:56 +00:00  
				
					
						
							
							
								 
						
							
								6ebbd92380 
								
							 
						 
						
							
							
								
								Use LVI to eliminate conditional branches where we've tested a related condition previously.  Update tests for this change.  
							
							... 
							
							
							
							This fixes PR5652.
llvm-svn: 112270 
							
						 
						
							2010-08-27 17:12:29 +00:00  
				
					
						
							
							
								 
						
							
								bd2ecc7e68 
								
							 
						 
						
							
							
								
								Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++.  
							
							... 
							
							
							
							llvm-svn: 112198 
							
						 
						
							2010-08-26 17:40:24 +00:00  
				
					
						
							
							
								 
						
							
								7c853e877e 
								
							 
						 
						
							
							
								
								Turn LVI on, previously detected failures should be fixed now.  
							
							... 
							
							
							
							llvm-svn: 111923 
							
						 
						
							2010-08-24 17:21:18 +00:00  
				
					
						
							
							
								 
						
							
								6ffa3f2aea 
								
							 
						 
						
							
							
								
								Turn LVI back off, I have a testcase now.  
							
							... 
							
							
							
							llvm-svn: 111834 
							
						 
						
							2010-08-23 19:59:27 +00:00  
				
					
						
							
							
								 
						
							
								630add39a6 
								
							 
						 
						
							
							
								
								Re-enable LazyValueInfo.  Monitoring for failures.  
							
							... 
							
							
							
							llvm-svn: 111816 
							
						 
						
							2010-08-23 18:12:23 +00:00  
				
					
						
							
							
								 
						
							
								aac8cbb261 
								
							 
						 
						
							
							
								
								Disable LVI while I evaluate a failure.  
							
							... 
							
							
							
							llvm-svn: 111551 
							
						 
						
							2010-08-19 19:47:08 +00:00  
				
					
						
							
							
								 
						
							
								5c87dd55d3 
								
							 
						 
						
							
							
								
								Tentatively enabled LVI by default.  I'll be monitoring for any failures.  
							
							... 
							
							
							
							llvm-svn: 111543 
							
						 
						
							2010-08-19 19:04:40 +00:00  
				
					
						
							
							
								 
						
							
								208636fa33 
								
							 
						 
						
							
							
								
								Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.  
							
							... 
							
							
							
							llvm-svn: 111382 
							
						 
						
							2010-08-18 18:39:01 +00:00  
				
					
						
							
							
								 
						
							
								3c603024bb 
								
							 
						 
						
							
							
								
								Fix PR7755: knowing something about an inval for a pred  
							
							... 
							
							
							
							from the LHS should disable reconsidering that pred on the
RHS.  However, knowing something about the pred on the RHS
shouldn't disable subsequent additions on the RHS from
happening.
llvm-svn: 111349 
							
						 
						
							2010-08-18 03:14:36 +00:00  
				
					
						
							
							
								 
						
							
								a7aed18624 
								
							 
						 
						
							
							
								
								Reapply r110396, with fixes to appease the Linux buildbot gods.  
							
							... 
							
							
							
							llvm-svn: 110460 
							
						 
						
							2010-08-06 18:33:48 +00:00  
				
					
						
							
							
								 
						
							
								bda59bd247 
								
							 
						 
						
							
							
								
								Revert r110396 to fix buildbots.  
							
							... 
							
							
							
							llvm-svn: 110410 
							
						 
						
							2010-08-06 00:23:35 +00:00  
				
					
						
							
							
								 
						
							
								755aceb5d0 
								
							 
						 
						
							
							
								
								Don't use PassInfo* as a type identifier for passes.  Instead, use the address of the static  
							
							... 
							
							
							
							ID member as the sole unique type identifier.  Clean up APIs related to this change.
llvm-svn: 110396 
							
						 
						
							2010-08-05 23:42:04 +00:00  
				
					
						
							
							
								 
						
							
								4674dd6cf5 
								
							 
						 
						
							
							
								
								Give JumpThreading+LVI a long-form cl::opt so that it's easier to toggle the default.  
							
							... 
							
							
							
							llvm-svn: 110384 
							
						 
						
							2010-08-05 22:11:31 +00:00  
				
					
						
							
							
								 
						
							
								aa7f66ba67 
								
							 
						 
						
							
							
								
								Add an initial implementation of LazyValueInfo updating for JumpThreading.  Disabled for now.  
							
							... 
							
							
							
							llvm-svn: 109424 
							
						 
						
							2010-07-26 18:48:03 +00:00  
				
					
						
							
							
								 
						
							
								a57b97e7e7 
								
							 
						 
						
							
							
								
								Fix batch of converting RegisterPass<> to INTIALIZE_PASS().  
							
							... 
							
							
							
							llvm-svn: 109045 
							
						 
						
							2010-07-21 22:09:45 +00:00  
				
					
						
							
							
								 
						
							
								a5fa885d47 
								
							 
						 
						
							
							
								
								cache results of operator*  
							
							... 
							
							
							
							llvm-svn: 108142 
							
						 
						
							2010-07-12 14:10:24 +00:00  
				
					
						
							
							
								 
						
							
								bbc25ff5cc 
								
							 
						 
						
							
							
								
								if jump threading is able to infer interesting values on both  
							
							... 
							
							
							
							the LHS and RHS of an and/or instruction, don't multiply add
known predecessor values.  This fixes the crash on testcase
from PR7498
llvm-svn: 108114 
							
						 
						
							2010-07-12 00:47:34 +00:00  
				
					
						
							
							
								 
						
							
								329ea064ed 
								
							 
						 
						
							
							
								
								jump threading can't split a critical edge from an indirectbr.  This  
							
							... 
							
							
							
							fixes PR7356.
llvm-svn: 105950 
							
						 
						
							2010-06-14 19:45:43 +00:00  
				
					
						
							
							
								 
						
							
								826bdf8c10 
								
							 
						 
						
							
							
								
								Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of  
							
							... 
							
							
							
							lib/Transforms/Utils and into lib/Analysis so that Analysis passes
can use them.
llvm-svn: 104949 
							
						 
						
							2010-05-28 16:19:17 +00:00  
				
					
						
							
							
								 
						
							
								9ae28b141f 
								
							 
						 
						
							
							
								
								fix PR6743, a case where we'd delete an instruction before using it  
							
							... 
							
							
							
							in some cases.
llvm-svn: 100937 
							
						 
						
							2010-04-10 18:26:57 +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  
				
					
						
							
							
								 
						
							
								d924f63692 
								
							 
						 
						
							
							
								
								Make jump threading honor x|undef -> true and x&undef -> false,  
							
							... 
							
							
							
							instead of considering x|undef -> x, which may not be true.
llvm-svn: 95850 
							
						 
						
							2010-02-11 04:40:44 +00:00  
				
					
						
							
							
								 
						
							
								29b15c5cfd 
								
							 
						 
						
							
							
								
								third bug from PR6119: the xor dupe extension allows  
							
							... 
							
							
							
							for arbitrary terminators in predecessors, don't assume
it is a conditional or uncond branch.  The testcase shows
an example where they can happen with switches.
llvm-svn: 94323 
							
						 
						
							2010-01-23 19:21:31 +00:00  
				
					
						
							
							
								 
						
							
								ba2d0b89ff 
								
							 
						 
						
							
							
								
								add an early out to ProcessBranchOnXOR to speed it up,  
							
							... 
							
							
							
							handle the case when we can infer an input to the xor
from all inputs that agree, instead of going into an
infinite loop.  Another part of PR6199
llvm-svn: 94321 
							
						 
						
							2010-01-23 19:16:25 +00:00  
				
					
						
							
							
								 
						
							
								de5ab4860f 
								
							 
						 
						
							
							
								
								fix a crash in jump threading, PR6119  
							
							... 
							
							
							
							llvm-svn: 94319 
							
						 
						
							2010-01-23 18:56:07 +00:00  
				
					
						
							
							
								 
						
							
								573da8ac90 
								
							 
						 
						
							
							
								
								1) Use the new SimplifyInstructionsInBlock routine instead of the copy  
							
							... 
							
							
							
							in JT.
2) When cloning blocks for PHI or xor conditions, use
instsimplify to simplify the code as we go.  This allows us to 
squish common cases early in JT which opens up opportunities for
subsequent iterations, and allows it to completely simplify the
testcase.
llvm-svn: 93253 
							
						 
						
							2010-01-12 20:41:47 +00:00  
				
					
						
							
							
								 
						
							
								af7855d571 
								
							 
						 
						
							
							
								
								tidy up  
							
							... 
							
							
							
							llvm-svn: 93222 
							
						 
						
							2010-01-12 02:07:50 +00:00  
				
					
						
							
							
								 
						
							
								eb73bdb2e1 
								
							 
						 
						
							
							
								
								Teach jump threading to duplicate small blocks when the branch  
							
							... 
							
							
							
							condition is a xor with a phi node.  This eliminates nonsense
like this from 176.gcc in several places:
 LBB166_84:
        testl   %eax, %eax
-       setne   %al
-       xorb    %cl, %al
-       notb    %al
-       testb   $1, %al
-       je      LBB166_85
+       je      LBB166_69
+       jmp     LBB166_85
This is rdar://7391699
llvm-svn: 93221 
							
						 
						
							2010-01-12 02:07:17 +00:00  
				
					
						
							
							
								 
						
							
								6a19ed0b86 
								
							 
						 
						
							
							
								
								some cleanup, and make it obvious that ProcessJumpOnPHI only works  
							
							... 
							
							
							
							on branches by renaming it and checking for a branch at the call site.
llvm-svn: 93208 
							
						 
						
							2010-01-11 23:41:09 +00:00  
				
					
						
							
							
								 
						
							
								76e2766442 
								
							 
						 
						
							
							
								
								Use a do-while loop instead of while + boolean.  
							
							... 
							
							
							
							llvm-svn: 92912 
							
						 
						
							2010-01-07 13:50:07 +00:00  
				
					
						
							
							
								 
						
							
								1efdb45562 
								
							 
						 
						
							
							
								
								Change errs() to dbgs().  
							
							... 
							
							
							
							llvm-svn: 92614 
							
						 
						
							2010-01-05 01:27:19 +00:00  
				
					
						
							
							
								 
						
							
								f8d22fc77d 
								
							 
						 
						
							
							
								
								Metadata.h doesn't need to include ValueHandle.h anymore.  
							
							... 
							
							
							
							llvm-svn: 92211 
							
						 
						
							2009-12-28 08:20:46 +00:00  
				
					
						
							
							
								 
						
							
								6d6f10fe91 
								
							 
						 
						
							
							
								
								fix PR5698  
							
							... 
							
							
							
							llvm-svn: 90708 
							
						 
						
							2009-12-06 17:17:23 +00:00  
				
					
						
							
							
								 
						
							
								3c9aca9079 
								
							 
						 
						
							
							
								
								fix PR5640 by tracking whether a block is the header of a loop more  
							
							... 
							
							
							
							precisely, which prevents us from infinitely peeling the loop.
llvm-svn: 90211 
							
						 
						
							2009-12-01 06:04:43 +00:00  
				
					
						
							
							
								 
						
							
								9d9812a636 
								
							 
						 
						
							
							
								
								make PRE of loads preserve the alignment of the moved load instruction.  
							
							... 
							
							
							
							llvm-svn: 88865 
							
						 
						
							2009-11-15 19:58:31 +00:00  
				
					
						
							
							
								 
						
							
								5f037b6439 
								
							 
						 
						
							
							
								
								fix a bug handling 'not x' when x is undef.  
							
							... 
							
							
							
							llvm-svn: 88864 
							
						 
						
							2009-11-15 19:57:43 +00:00  
				
					
						
							
							
								 
						
							
								5f6b8b2bcb 
								
							 
						 
						
							
							
								
								use getPredicateOnEdge to fold comparisons through PHI nodes,  
							
							... 
							
							
							
							which implements GCC PR18046.  This also gets us 360 more
jump threads on 176.gcc.
llvm-svn: 86953 
							
						 
						
							2009-11-12 05:24:05 +00:00  
				
					
						
							
							
								 
						
							
								22db4b5e0c 
								
							 
						 
						
							
							
								
								various fixes to the lattice transfer functions.  
							
							... 
							
							
							
							llvm-svn: 86952 
							
						 
						
							2009-11-12 04:57:13 +00:00  
				
					
						
							
							
								 
						
							
								c893c4ed10 
								
							 
						 
						
							
							
								
								switch jump threading to use getPredicateOnEdge in one place  
							
							... 
							
							
							
							making the new LVI stuff smart enough to subsume some special
cases in the old code.  Disable them when LVI is around, the
testcase still passes.
llvm-svn: 86951 
							
						 
						
							2009-11-12 04:37:50 +00:00  
				
					
						
							
							
								 
						
							
								ba45616958 
								
							 
						 
						
							
							
								
								with the new code we can thread non-instruction values.  This  
							
							... 
							
							
							
							allows us to handle the test10 testcase.
llvm-svn: 86924 
							
						 
						
							2009-11-12 01:41:34 +00:00  
				
					
						
							
							
								 
						
							
								3f80d85191 
								
							 
						 
						
							
							
								
								this argument can be an arbitrary value, it doesn't need to be an instruction.  
							
							... 
							
							
							
							llvm-svn: 86923 
							
						 
						
							2009-11-12 01:37:43 +00:00  
				
					
						
							
							
								 
						
							
								d5e25436a1 
								
							 
						 
						
							
							
								
								expose edge information and switch j-t to use it.  
							
							... 
							
							
							
							llvm-svn: 86920 
							
						 
						
							2009-11-12 01:29:10 +00:00  
				
					
						
							
							
								 
						
							
								67146695b6 
								
							 
						 
						
							
							
								
								pass TD into a SimplifyCmpInst call.  Add another case that  
							
							... 
							
							
							
							uses LVI info when -enable-jump-threading-lvi is passed.
llvm-svn: 86886 
							
						 
						
							2009-11-11 22:31:38 +00:00  
				
					
						
							
							
								 
						
							
								fde1f8d0d8 
								
							 
						 
						
							
							
								
								stub out some LazyValueInfo interfaces, and have JumpThreading  
							
							... 
							
							
							
							start using them in a trivial way when -enable-jump-threading-lvi
is passed.  enable-jump-threading-lvi will be my playground for 
awhile.
llvm-svn: 86789 
							
						 
						
							2009-11-11 02:08:33 +00:00  
				
					
						
							
							
								 
						
							
								3a2ae908fe 
								
							 
						 
						
							
							
								
								add a fixme  
							
							... 
							
							
							
							llvm-svn: 86766 
							
						 
						
							2009-11-11 00:21:58 +00:00  
				
					
						
							
							
								 
						
							
								9518fbb54e 
								
							 
						 
						
							
							
								
								implement a TODO by teaching jump threading about "xor x, 1".  
							
							... 
							
							
							
							llvm-svn: 86739 
							
						 
						
							2009-11-10 22:39:16 +00:00  
				
					
						
							
							
								 
						
							
								852d6d64ff 
								
							 
						 
						
							
							
								
								move some generally useful functions out of jump threading  
							
							... 
							
							
							
							into libanalysis and transformutils.
llvm-svn: 86735 
							
						 
						
							2009-11-10 22:26:15 +00:00  
				
					
						
							
							
								 
						
							
								40b15f220d 
								
							 
						 
						
							
							
								
								improve comment.  
							
							... 
							
							
							
							llvm-svn: 86723 
							
						 
						
							2009-11-10 21:45:09 +00:00  
				
					
						
							
							
								 
						
							
								80e7e5a429 
								
							 
						 
						
							
							
								
								Make jump threading eliminate blocks that just contain phi nodes,  
							
							... 
							
							
							
							debug intrinsics, and an unconditional branch when possible.  This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.
llvm-svn: 86722 
							
						 
						
							2009-11-10 21:40:01 +00:00  
				
					
						
							
							
								 
						
							
								38c44ea6b0 
								
							 
						 
						
							
							
								
								make jump threading recursively simplify expressions instead of doing it  
							
							... 
							
							
							
							just one level deep.  On the testcase we go from getting this:
F1:                                               ; preds = %T2
  %F = and i1 true, %cond                         ; <i1> [#uses=1]
  br i1 %F, label %X, label %Y
to a fully threaded:
F1:                                               ; preds = %T2
  br label %Y
This changes gets us to the point where we're forming (too many) switch 
instructions on doug's strswitch testcase.
llvm-svn: 86646 
							
						 
						
							2009-11-10 01:57:31 +00:00  
				
					
						
							
							
								 
						
							
								be11db6894 
								
							 
						 
						
							
							
								
								don't invalidate PN, rewrite of this code is in progress anyway.  
							
							... 
							
							
							
							llvm-svn: 86639 
							
						 
						
							2009-11-10 01:19:06 +00:00  
				
					
						
							
							
								 
						
							
								fb7f87d5a3 
								
							 
						 
						
							
							
								
								add a new SimplifyInstruction API, which is like ConstantFoldInstruction,  
							
							... 
							
							
							
							except that the result may not be a constant.  Switch jump threading to 
use it so that it gets things like (X & 0) -> 0, which occur when phi preds
are deleted and the remaining phi pred was a zero.
llvm-svn: 86637 
							
						 
						
							2009-11-10 01:08:51 +00:00  
				
					
						
							
							
								 
						
							
								c1f19071f8 
								
							 
						 
						
							
							
								
								rename SimplifyCompare -> SimplifyCmpInst and split it into  
							
							... 
							
							
							
							Simplify[IF]Cmp pieces.  Add some predicates to CmpInst to 
determine whether a predicate is fp or int.
llvm-svn: 86624 
							
						 
						
							2009-11-09 23:28:39 +00:00  
				
					
						
							
							
								 
						
							
								800aad3dda 
								
							 
						 
						
							
							
								
								use instructionsimplify instead of a weak clone of ad-hoc folding stuff.  
							
							... 
							
							
							
							llvm-svn: 86616 
							
						 
						
							2009-11-09 23:00:14 +00:00  
				
					
						
							
							
								 
						
							
								2978ca7b79 
								
							 
						 
						
							
							
								
								stub out a new form of BasicBlock::RemovePredecessorAndSimplify which  
							
							... 
							
							
							
							simplifies instruction users of PHIs when the phi is eliminated.  This
will be moved to transforms/utils after some other refactoring.
llvm-svn: 86603 
							
						 
						
							2009-11-09 22:32:36 +00:00  
				
					
						
							
							
								 
						
							
								ea465e221e 
								
							 
						 
						
							
							
								
								comment typos pointed out by Duncan  
							
							... 
							
							
							
							llvm-svn: 86497 
							
						 
						
							2009-11-09 00:41:49 +00:00  
				
					
						
							
							
								 
						
							
								5ff7f5672e 
								
							 
						 
						
							
							
								
								reapply 86289, 86278, 86270, 86267, 86266 & 86264 plus a fix  
							
							... 
							
							
							
							(making pred factoring only happen if threading is guaranteed
to be successful).
This now survives an X86-64 bootstrap of llvm-gcc.
llvm-svn: 86355 
							
						 
						
							2009-11-07 08:05:03 +00:00  
				
					
						
							
							
								 
						
							
								3a42e7ac65 
								
							 
						 
						
							
							
								
								Revert following patches to fix llvmgcc bootstrap.  
							
							... 
							
							
							
							86289, 86278, 86270, 86267, 86266 & 86264
Chris, please take a look.
llvm-svn: 86321 
							
						 
						
							2009-11-07 01:32:59 +00:00  
				
					
						
							
							
								 
						
							
								8f77e948e5 
								
							 
						 
						
							
							
								
								Avoid "ambiguous 'else'" warning from gcc.  
							
							... 
							
							
							
							llvm-svn: 86314 
							
						 
						
							2009-11-07 00:26:47 +00:00  
				
					
						
							
							
								 
						
							
								eb690feaef 
								
							 
						 
						
							
							
								
								Fix a bug where we'd call SplitBlockPredecessors with a pred in the  
							
							... 
							
							
							
							set only once even if it has multiple edges to BB.
llvm-svn: 86299 
							
						 
						
							2009-11-06 23:19:58 +00:00  
				
					
						
							
							
								 
						
							
								a70917b2f4 
								
							 
						 
						
							
							
								
								Remove function left over from other jump threading cleanup.  
							
							... 
							
							
							
							llvm-svn: 86289 
							
						 
						
							2009-11-06 21:24:57 +00:00  
				
					
						
							
							
								 
						
							
								a8b9ce3f07 
								
							 
						 
						
							
							
								
								Fix a problem discovered on self host.  
							
							... 
							
							
							
							llvm-svn: 86278 
							
						 
						
							2009-11-06 19:21:48 +00:00  
				
					
						
							
							
								 
						
							
								d91a7960bf 
								
							 
						 
						
							
							
								
								remove more code subsumed by r86264  
							
							... 
							
							
							
							llvm-svn: 86270 
							
						 
						
							2009-11-06 18:24:32 +00:00  
				
					
						
							
							
								 
						
							
								899ef22acb 
								
							 
						 
						
							
							
								
								eliminate some more code subsumed by r86264  
							
							... 
							
							
							
							llvm-svn: 86267 
							
						 
						
							2009-11-06 18:22:54 +00:00  
				
					
						
							
							
								 
						
							
								2f6184f6aa 
								
							 
						 
						
							
							
								
								remove now redundant code, r86264 handles this case.  
							
							... 
							
							
							
							llvm-svn: 86266 
							
						 
						
							2009-11-06 18:20:58 +00:00  
				
					
						
							
							
								 
						
							
								68d2417e05 
								
							 
						 
						
							
							
								
								Extend jump threading to support much more general threading  
							
							... 
							
							
							
							predicates.  This allows us to jump thread things like:
_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit119:
  %tmp1.i24166 = phi i8 [ 1, %bb5.i117 ], [ %tmp1.i24165, %_Z....exit ], [ %tmp1.i24165, %bb4.i114 ] 
  %toBoolnot.i87 = icmp eq i8 %tmp1.i24166, 0     ; <i1> [#uses=1]
  %tmp4.i90 = icmp eq i32 %tmp2.i, 6              ; <i1> [#uses=1]
  %or.cond173 = and i1 %toBoolnot.i87, %tmp4.i90  ; <i1> [#uses=1]
  br i1 %or.cond173, label %bb4.i96, label %_ZN12...
Where it is "obvious" that when coming from %bb5.i117 that the 'and' is always 
false.  This triggers a surprisingly high number of times in the testsuite, 
and gets us closer to generating good code for doug's strswitch testcase.
This also make a bunch of other code in jump threading redundant, I'll rip
out in the next patch.  This survived an enable-checking llvm-gcc bootstrap.
llvm-svn: 86264 
							
						 
						
							2009-11-06 18:15:14 +00:00  
				
					
						
							
							
								 
						
							
								46b5c642b9 
								
							 
						 
						
							
							
								
								remove a bunch of extraneous LLVMContext arguments  
							
							... 
							
							
							
							from various APIs, addressing PR5325.
llvm-svn: 86231 
							
						 
						
							2009-11-06 04:27:31 +00:00  
				
					
						
							
							
								 
						
							
								a09062758b 
								
							 
						 
						
							
							
								
								improve DSE when TargetData is not around, based on work by  
							
							... 
							
							
							
							Hans Wennborg!
llvm-svn: 86067 
							
						 
						
							2009-11-04 23:20:12 +00:00  
				
					
						
							
							
								 
						
							
								85c85c5e04 
								
							 
						 
						
							
							
								
								when folding duplicate conditions, delete the  
							
							... 
							
							
							
							now-probably-dead instruction tree feeding it.
llvm-svn: 83778 
							
						 
						
							2009-10-11 18:39:58 +00:00  
				
					
						
							
							
								 
						
							
								97b1405207 
								
							 
						 
						
							
							
								
								implement a transformation in jump threading that is currently  
							
							... 
							
							
							
							done by condprop, but do it in a much more general form.  The
basic idea is that we can do a limited form of tail duplication
in the case when we have a branch on a phi.  Moving the branch
up in to the predecessor block makes instruction selection
much easier and encourages chained jump threadings.
llvm-svn: 83759 
							
						 
						
							2009-10-11 07:24:57 +00:00  
				
					
						
							
							
								 
						
							
								6ce85e85f5 
								
							 
						 
						
							
							
								
								restructure some code, no functionality change.  
							
							... 
							
							
							
							llvm-svn: 83756 
							
						 
						
							2009-10-11 04:40:21 +00:00  
				
					
						
							
							
								 
						
							
								f466bc84c9 
								
							 
						 
						
							
							
								
								factor some code better and move a function, no functionality change.  
							
							... 
							
							
							
							llvm-svn: 83755 
							
						 
						
							2009-10-11 04:33:43 +00:00  
				
					
						
							
							
								 
						
							
								f99a74e24b 
								
							 
						 
						
							
							
								
								make jump threading on a phi with undef inputs happen.  
							
							... 
							
							
							
							llvm-svn: 83754 
							
						 
						
							2009-10-11 04:18:15 +00:00  
				
					
						
							
							
								 
						
							
								84095071ea 
								
							 
						 
						
							
							
								
								Change jump threading to use the new SSAUpdater class instead of  
							
							... 
							
							
							
							DemoteRegToStack.  This makes it more efficient (because it isn't
creating a ton of load/stores that are eventually removed by a later
mem2reg), and more slightly more effective (because those load/stores
don't get in the way of threading).
llvm-svn: 83706 
							
						 
						
							2009-10-10 09:05:58 +00:00  
				
					
						
							
							
								 
						
							
								42fb7452df 
								
							 
						 
						
							
							
								
								Instruction::clone does not need to take an LLVMContext&. Remove that and  
							
							... 
							
							
							
							update all the callers.
llvm-svn: 82889 
							
						 
						
							2009-09-27 07:38:41 +00:00  
				
					
						
							
							
								 
						
							
								2dd09dbdf7 
								
							 
						 
						
							
							
								
								eliminate VISIBILITY_HIDDEN from Transforms/Scalar.  PR4861  
							
							... 
							
							
							
							llvm-svn: 80766 
							
						 
						
							2009-09-02 06:11:42 +00:00  
				
					
						
							
							
								 
						
							
								55f1c09e31 
								
							 
						 
						
							
							
								
								Push LLVMContexts through the IntegerType APIs.  
							
							... 
							
							
							
							llvm-svn: 78948 
							
						 
						
							2009-08-13 21:58:54 +00:00  
				
					
						
							
							
								 
						
							
								23a204d91b 
								
							 
						 
						
							
							
								
								Move getTrue() and getFalse() to 2.5-like APIs.  
							
							... 
							
							
							
							llvm-svn: 77685 
							
						 
						
							2009-07-31 17:39:07 +00:00  
				
					
						
							
							
								 
						
							
								b292b8ce70 
								
							 
						 
						
							
							
								
								Move more code back to 2.5 APIs.  
							
							... 
							
							
							
							llvm-svn: 77635 
							
						 
						
							2009-07-30 23:03:37 +00:00  
				
					
						
							
							
								 
						
							
								487375e9a2 
								
							 
						 
						
							
							
								
								Move ConstantExpr to 2.5 API.  
							
							... 
							
							
							
							llvm-svn: 77494 
							
						 
						
							2009-07-29 18:55:55 +00:00  
				
					
						
							
							
								 
						
							
								6115b39ffd 
								
							 
						 
						
							
							
								
								Remove Value::getName{Start,End}, the last of the old Name APIs.  
							
							... 
							
							
							
							llvm-svn: 77152 
							
						 
						
							2009-07-26 09:48:23 +00:00