20d9ce21ef 
								
							 
						 
						
							
							
								
								Move SCEV::dominates and properlyDominates to ScalarEvolution.  
							
							... 
							
							
							
							llvm-svn: 119570 
							
						 
						
							2010-11-17 21:41:58 +00:00  
				
					
						
							
							
								 
						
							
								afd6db9932 
								
							 
						 
						
							
							
								
								Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member  
							
							... 
							
							
							
							functions of ScalarEvolution, in preparation for memoization and
other optimizations.
llvm-svn: 119562 
							
						 
						
							2010-11-17 21:23:15 +00:00  
				
					
						
							
							
								 
						
							
								39d77131a1 
								
							 
						 
						
							
							
								
								Before replacing a phi node with a different value, it  
							
							... 
							
							
							
							needs to be checked that this won't break LCSSA form.
Change the existing checking method to a more direct one:
rather than seeing if all predecessors belong to the loop,
check that the replacing value is either not in any loop or
is in a loop that contains the phi node.
llvm-svn: 119556 
							
						 
						
							2010-11-17 20:49:12 +00:00  
				
					
						
							
							
								 
						
							
								d3a32ae4c8 
								
							 
						 
						
							
							
								
								Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr  
							
							... 
							
							
							
							instead of in SCEVAddRecExpr's constructor, in preparation for an
upcoming change.
llvm-svn: 119554 
							
						 
						
							2010-11-17 20:48:38 +00:00  
				
					
						
							
							
								 
						
							
								ed75631743 
								
							 
						 
						
							
							
								
								Fix ScalarEvolution's range memoization to avoid using a  
							
							... 
							
							
							
							default ctor with ConstantRange.
llvm-svn: 119550 
							
						 
						
							2010-11-17 20:23:08 +00:00  
				
					
						
							
							
								 
						
							
								d06f50e2db 
								
							 
						 
						
							
							
								
								Have ScalarEvolution use SimplifyInstruction rather than hasConstantValue.  
							
							... 
							
							
							
							While there, add a note about an inefficiency I noticed.
llvm-svn: 119458 
							
						 
						
							2010-11-17 04:18:45 +00:00  
				
					
						
							
							
								 
						
							
								761065e3b7 
								
							 
						 
						
							
							
								
								Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.  
							
							... 
							
							
							
							This fixes some extreme compile times on unrolled sha512 code.
llvm-svn: 119455 
							
						 
						
							2010-11-17 02:44:44 +00:00  
				
					
						
							
							
								 
						
							
								dcb354b234 
								
							 
						 
						
							
							
								
								Make ScalarEvolution::forgetLoop forget all contained loops too, because  
							
							... 
							
							
							
							they may have ValuesAtScopes map entries referencing their outer loops.
This fixes a user-after-free reported in PR8471.
llvm-svn: 117698 
							
						 
						
							2010-10-29 20:16:10 +00:00  
				
					
						
							
							
								 
						
							
								6c18d1aac0 
								
							 
						 
						
							
							
								
								Get rid of static constructors for pass registration.  Instead, every pass exposes an initializeMyPassFunction(), which  
							
							... 
							
							
							
							must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.
Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.
I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.
llvm-svn: 116820 
							
						 
						
							2010-10-19 17:21:58 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								8e4c19ac44 
								
							 
						 
						
							
							
								
								Don't add the operand count to SCEV uniquing data; FoldingSetNodeID  
							
							... 
							
							
							
							already knows its own length, so this is redundant.
llvm-svn: 115521 
							
						 
						
							2010-10-04 17:24:08 +00:00  
				
					
						
							
							
								 
						
							
								47308d5da3 
								
							 
						 
						
							
							
								
								Reapply r112432, now that the real problem is addressed.  
							
							... 
							
							
							
							llvm-svn: 112667 
							
						 
						
							2010-08-31 22:53:17 +00:00  
				
					
						
							
							
								 
						
							
								f01a5eed1e 
								
							 
						 
						
							
							
								
								Reapply r112433, now that the real problem is addressed.  
							
							... 
							
							
							
							llvm-svn: 112666 
							
						 
						
							2010-08-31 22:52:12 +00:00  
				
					
						
							
							
								 
						
							
								aabfc52790 
								
							 
						 
						
							
							
								
								Revert r110916. This patch is buggy because the code inside the  
							
							... 
							
							
							
							inner loop doesn't update all the variables in the outer loop.
llvm-svn: 112665 
							
						 
						
							2010-08-31 22:50:31 +00:00  
				
					
						
							
							
								 
						
							
								90f29bcd90 
								
							 
						 
						
							
							
								
								Revert r112432. It appears to be exposing a problem in the emacs build.  
							
							... 
							
							
							
							llvm-svn: 112638 
							
						 
						
							2010-08-31 20:58:44 +00:00  
				
					
						
							
							
								 
						
							
								444c24a9f0 
								
							 
						 
						
							
							
								
								Speculatively revert r112433.  
							
							... 
							
							
							
							llvm-svn: 112608 
							
						 
						
							2010-08-31 17:56:47 +00:00  
				
					
						
							
							
								 
						
							
								d1da5cdfee 
								
							 
						 
						
							
							
								
								Restructure the {A,+,B}<L> * {C,+,D}<L> folding so that it folds  
							
							... 
							
							
							
							all applicable addrecs before recursing on getMulExpr, instead of
recursing on getMulExpr for each one.
llvm-svn: 112433 
							
						 
						
							2010-08-29 15:16:58 +00:00  
				
					
						
							
							
								 
						
							
								3e6fc18943 
								
							 
						 
						
							
							
								
								Batch up subtracts along with adds, when analyzing long chains of  
							
							... 
							
							
							
							operations.
llvm-svn: 112432 
							
						 
						
							2010-08-29 15:10:06 +00:00  
				
					
						
							
							
								 
						
							
								7712d2900d 
								
							 
						 
						
							
							
								
								Micro-optimize GroupByComplexity.  
							
							... 
							
							
							
							llvm-svn: 112431 
							
						 
						
							2010-08-29 15:07:13 +00:00  
				
					
						
							
							
								 
						
							
								0f2de01355 
								
							 
						 
						
							
							
								
								Hold AddRec->getLoop() in a variable, to make the Mul code more consistent  
							
							... 
							
							
							
							with the Add code.
llvm-svn: 112430 
							
						 
						
							2010-08-29 14:55:19 +00:00  
				
					
						
							
							
								 
						
							
								028c18158a 
								
							 
						 
						
							
							
								
								Rename a variable, for consistency.  
							
							... 
							
							
							
							llvm-svn: 112429 
							
						 
						
							2010-08-29 14:53:34 +00:00  
				
					
						
							
							
								 
						
							
								28a84d4ba1 
								
							 
						 
						
							
							
								
								Use iterators instead of indices.  
							
							... 
							
							
							
							llvm-svn: 112428 
							
						 
						
							2010-08-29 14:52:02 +00:00  
				
					
						
							
							
								 
						
							
								fe22f1d3cc 
								
							 
						 
						
							
							
								
								Fix an index calculation thinko.  
							
							... 
							
							
							
							llvm-svn: 112337 
							
						 
						
							2010-08-28 00:39:27 +00:00  
				
					
						
							
							
								 
						
							
								15871f23e3 
								
							 
						 
						
							
							
								
								When merging adjacent operands, scan ahead and merge all equal  
							
							... 
							
							
							
							adjacent operands at once, instead of just two at a time.
llvm-svn: 112299 
							
						 
						
							2010-08-27 21:39:59 +00:00  
				
					
						
							
							
								 
						
							
								c866bf4fec 
								
							 
						 
						
							
							
								
								Make the {A,+,B}<L> + {C,+,D}<L>  -->  Other + {A+C,+,B+D}<L>  
							
							... 
							
							
							
							transformation collect all the addrecs with the same loop
add combine them at once rather than starting everything over
at the first chance.
llvm-svn: 112290 
							
						 
						
							2010-08-27 20:45:56 +00:00  
				
					
						
							
							
								 
						
							
								9bad2fb378 
								
							 
						 
						
							
							
								
								Switch ScalarEvolution's main Value*->SCEV* map from std::map  
							
							... 
							
							
							
							to DenseMap.
llvm-svn: 112281 
							
						 
						
							2010-08-27 18:55:03 +00:00  
				
					
						
							
							
								 
						
							
								2706567c5c 
								
							 
						 
						
							
							
								
								Optimize SCEVComplexityCompare. Use a 3-way return instead of a 2-way  
							
							... 
							
							
							
							return to avoid needing two calls to test for equivalence, and sort
addrecs by their degree before examining their operands.
llvm-svn: 112267 
							
						 
						
							2010-08-27 15:26:01 +00:00  
				
					
						
							
							
								 
						
							
								797a1dbb1c 
								
							 
						 
						
							
							
								
								To create a copy of a SmallVector with an element removed from the  
							
							... 
							
							
							
							middle, copy the elements in two groups, rather than copying all the
elements and then doing an erase on the middle of the result. These
are SmallVectors, so we shouldn't expect to hit dynamic allocation
in the common case.
llvm-svn: 111151 
							
						 
						
							2010-08-16 16:57:24 +00:00  
				
					
						
							
							
								 
						
							
								0d0cc18af5 
								
							 
						 
						
							
							
								
								Tidy whitespace.  
							
							... 
							
							
							
							llvm-svn: 111147 
							
						 
						
							2010-08-16 16:34:09 +00:00  
				
					
						
							
							
								 
						
							
								c29eeaecec 
								
							 
						 
						
							
							
								
								Add a comment.  
							
							... 
							
							
							
							llvm-svn: 111145 
							
						 
						
							2010-08-16 16:31:39 +00:00  
				
					
						
							
							
								 
						
							
								7eac4961d7 
								
							 
						 
						
							
							
								
								Use const_iterator in a few places.  
							
							... 
							
							
							
							llvm-svn: 111144 
							
						 
						
							2010-08-16 16:30:01 +00:00  
				
					
						
							
							
								 
						
							
								74c61503b1 
								
							 
						 
						
							
							
								
								Use iterators instead of indices in a few more places.  
							
							... 
							
							
							
							llvm-svn: 111143 
							
						 
						
							2010-08-16 16:27:53 +00:00  
				
					
						
							
							
								 
						
							
								f29618236e 
								
							 
						 
						
							
							
								
								Micro-optimize SCEVConstant comparison.  
							
							... 
							
							
							
							llvm-svn: 111142 
							
						 
						
							2010-08-16 16:25:35 +00:00  
				
					
						
							
							
								 
						
							
								3688ea5c7d 
								
							 
						 
						
							
							
								
								Move SCEVNAryExpr's virtual member functions out of line, and convert  
							
							... 
							
							
							
							them to iterators.
llvm-svn: 111140 
							
						 
						
							2010-08-16 16:21:27 +00:00  
				
					
						
							
							
								 
						
							
								d6925bbe0d 
								
							 
						 
						
							
							
								
								Use iterators instead of indices in simple cases.  
							
							... 
							
							
							
							llvm-svn: 111138 
							
						 
						
							2010-08-16 16:16:11 +00:00  
				
					
						
							
							
								 
						
							
								b6c773ec2e 
								
							 
						 
						
							
							
								
								Avoid gratuitous inefficiency in ifndef NDEBUG code.  
							
							... 
							
							
							
							llvm-svn: 111137 
							
						 
						
							2010-08-16 16:13:54 +00:00  
				
					
						
							
							
								 
						
							
								e5fb1036e6 
								
							 
						 
						
							
							
								
								Make one getAddExpr call when analyzing a+b+c+d+e+... instead of one  
							
							... 
							
							
							
							for each add instruction. Ditto for Mul.
llvm-svn: 111136 
							
						 
						
							2010-08-16 16:03:49 +00:00  
				
					
						
							
							
								 
						
							
								b094b39111 
								
							 
						 
						
							
							
								
								Delete an unused function.  
							
							... 
							
							
							
							llvm-svn: 111135 
							
						 
						
							2010-08-16 15:57:14 +00:00  
				
					
						
							
							
								 
						
							
								0c436ab356 
								
							 
						 
						
							
							
								
								Various optimizations. Don't compare two loops' depths  
							
							... 
							
							
							
							when they are the same loop. Don't compare two instructions'
loop depths when they are in the same block.
llvm-svn: 111045 
							
						 
						
							2010-08-13 21:24:58 +00:00  
				
					
						
							
							
								 
						
							
								63c020a210 
								
							 
						 
						
							
							
								
								When testing whether one loop contains another, test this directly  
							
							... 
							
							
							
							rather than testing whether the loop contains the other's header.
llvm-svn: 111039 
							
						 
						
							2010-08-13 20:23:25 +00:00  
				
					
						
							
							
								 
						
							
								3324b9ec67 
								
							 
						 
						
							
							
								
								Add a const.  
							
							... 
							
							
							
							llvm-svn: 111038 
							
						 
						
							2010-08-13 20:17:27 +00:00  
				
					
						
							
							
								 
						
							
								cf32f2bde1 
								
							 
						 
						
							
							
								
								When creating a symmetric SCEV with a constant operand, put  
							
							... 
							
							
							
							the constant operand on the left, as that's where ScalarEvolution
will end up canonicalizing to.
llvm-svn: 111037 
							
						 
						
							2010-08-13 20:17:14 +00:00  
				
					
						
							
							
								 
						
							
								ec0120a123 
								
							 
						 
						
							
							
								
								An add recurrence is loop-invariant in any loop inside of its  
							
							... 
							
							
							
							associated loop. This avoids potentially expensive traversals
of the add recurrence's operands.
llvm-svn: 111034 
							
						 
						
							2010-08-13 20:11:39 +00:00  
				
					
						
							
							
								 
						
							
								2de47777f4 
								
							 
						 
						
							
							
								
								Optimize ScalarEvolution::getAddExpr's operand factoring code by  
							
							... 
							
							
							
							having it finish processing all of the muliply operands before
starting the whole getAddExpr process over again, instead of
immediately after the first simplification.
llvm-svn: 110916 
							
						 
						
							2010-08-12 15:00:23 +00:00  
				
					
						
							
							
								 
						
							
								157847f5d1 
								
							 
						 
						
							
							
								
								Hoist some loop-invariant code out of a hot loop.  
							
							... 
							
							
							
							llvm-svn: 110915 
							
						 
						
							2010-08-12 14:52:55 +00:00  
				
					
						
							
							
								 
						
							
								e67b287451 
								
							 
						 
						
							
							
								
								Optimize ScalarEvolution::getAddExpr's duplicate operand detection  
							
							... 
							
							
							
							by having it finish processing the whole operand list before
starting the whole getAddExpr process over again, instead of
immediately after the first duplicate is found.
llvm-svn: 110914 
							
						 
						
							2010-08-12 14:46:54 +00:00  
				
					
						
							
							
								 
						
							
								f7495f286a 
								
							 
						 
						
							
							
								
								When analyzing loop exit conditions combined with and and or, don't  
							
							... 
							
							
							
							make any assumptions about when the two conditions will agree on when
to permit the loop to exit. This fixes PR7845.
llvm-svn: 110758 
							
						 
						
							2010-08-11 00:12:36 +00:00  
				
					
						
							
							
								 
						
							
								e18c2d6f99 
								
							 
						 
						
							
							
								
								Rename and reorder the arguments to isImpliedCond, for consistency and clarity.  
							
							... 
							
							
							
							llvm-svn: 110750 
							
						 
						
							2010-08-10 23:46:30 +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  
				
					
						
							
							
								 
						
							
								db764c6e3b 
								
							 
						 
						
							
							
								
								Fix a minor bug which resulted in intermediate calculations  
							
							... 
							
							
							
							using wider types than are necessary.
llvm-svn: 110241 
							
						 
						
							2010-08-04 19:52:50 +00:00  
				
					
						
							
							
								 
						
							
								7cac95778f 
								
							 
						 
						
							
							
								
								Make SCEVUnknown a CallbackVH, so that it can be notified directly  
							
							... 
							
							
							
							of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.
This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.
llvm-svn: 110086 
							
						 
						
							2010-08-02 23:49:30 +00:00  
				
					
						
							
							
								 
						
							
								40b31ad3ee 
								
							 
						 
						
							
							
								
								Prefix `next' iterator operation with `llvm::'.  
							
							... 
							
							
							
							Fixes potential ambiguity problems on VS 2010.
Patch by nobled!
llvm-svn: 110029 
							
						 
						
							2010-08-02 06:00:15 +00:00  
				
					
						
							
							
								 
						
							
								ef6d5933a6 
								
							 
						 
						
							
							
								
								Speculatively revert r109705 since it seems to be causing some build bot  
							
							... 
							
							
							
							angst.
llvm-svn: 109718 
							
						 
						
							2010-07-29 01:25:38 +00:00  
				
					
						
							
							
								 
						
							
								3d6ac44d96 
								
							 
						 
						
							
							
								
								Factor out some of the code for updating old SCEVUnknown values, and  
							
							... 
							
							
							
							extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.
Add a ScalarEvolution unittest to test for this situation.
llvm-svn: 109705 
							
						 
						
							2010-07-29 00:17:55 +00:00  
				
					
						
							
							
								 
						
							
								7a066723d0 
								
							 
						 
						
							
							
								
								Make SCEVCallbackVH::allUsesReplacedWith update the old SCEVUnknown  
							
							... 
							
							
							
							object, as it may still be referenced by SCEVs not cleaned up by the
use list traversal.
Also, in ScalarEvolution::forgetValue, only check for a SCEVUnknown
object for the original value, not for any value in the use list,
because other SCEVUnknown values aren't necessary obsolete at that
point.
llvm-svn: 109570 
							
						 
						
							2010-07-28 01:09:07 +00:00  
				
					
						
							
							
								 
						
							
								8aeb0fb5ca 
								
							 
						 
						
							
							
								
								Make SCEVCallbackVH::allUsesReplacedWith unconditionally delete  
							
							... 
							
							
							
							the old value.
llvm-svn: 109567 
							
						 
						
							2010-07-28 00:28:25 +00:00  
				
					
						
							
							
								 
						
							
								5ae3102459 
								
							 
						 
						
							
							
								
								Micro-optimize SCEVComplexityCompare.  
							
							... 
							
							
							
							llvm-svn: 109267 
							
						 
						
							2010-07-23 21:20:52 +00:00  
				
					
						
							
							
								 
						
							
								992db006d0 
								
							 
						 
						
							
							
								
								Add a const qualifier.  
							
							... 
							
							
							
							llvm-svn: 109266 
							
						 
						
							2010-07-23 21:18:55 +00:00  
				
					
						
							
							
								 
						
							
								dde79d8f1a 
								
							 
						 
						
							
							
								
								mass elimination of reliance on automatic iterator dereferencing  
							
							... 
							
							
							
							llvm-svn: 109103 
							
						 
						
							2010-07-22 13:36:47 +00:00  
				
					
						
							
							
								 
						
							
								a57b97e7e7 
								
							 
						 
						
							
							
								
								Fix batch of converting RegisterPass<> to INTIALIZE_PASS().  
							
							... 
							
							
							
							llvm-svn: 109045 
							
						 
						
							2010-07-21 22:09:45 +00:00  
				
					
						
							
							
								 
						
							
								46f00a25f9 
								
							 
						 
						
							
							
								
								Add a fast path for x - x.  
							
							... 
							
							
							
							llvm-svn: 108855 
							
						 
						
							2010-07-20 16:53:00 +00:00  
				
					
						
							
							
								 
						
							
								64b1e82a7c 
								
							 
						 
						
							
							
								
								Teach ScalarEvolution how to fold trunc(undef) and anyext(undef) to undef.  
							
							... 
							
							
							
							This helps LSR behave more consistently on bugpoint-reduced testcases.
llvm-svn: 108451 
							
						 
						
							2010-07-15 20:02:11 +00:00  
				
					
						
							
							
								 
						
							
								f638f4ff84 
								
							 
						 
						
							
							
								
								In ScalarEvolution::forgetValue, eliminate any SCEVUnknown  
							
							... 
							
							
							
							entries associated with the value being erased in the
folding set map.  These entries used to be harmless, because
a SCEVUnknown doesn't store any information about its Value*,
so having a new Value allocated at the old Value's address
wasn't a problem. But now that ScalarEvolution is storing more
information about values, this is no longer safe.
llvm-svn: 107316 
							
						 
						
							2010-06-30 20:21:12 +00:00  
				
					
						
							
							
								 
						
							
								c0cca7fdda 
								
							 
						 
						
							
							
								
								Revert the part of r107257 which introduced new logic for using  
							
							... 
							
							
							
							nsw and nuw flags from IR Instructions. On further consideration,
this isn't valid.
llvm-svn: 107298 
							
						 
						
							2010-06-30 17:27:11 +00:00  
				
					
						
							
							
								 
						
							
								16206132b6 
								
							 
						 
						
							
							
								
								Improve ScalarEvolution's nsw and nuw preservation.  
							
							... 
							
							
							
							llvm-svn: 107257 
							
						 
						
							2010-06-30 07:16:37 +00:00  
				
					
						
							
							
								 
						
							
								9396b42ca4 
								
							 
						 
						
							
							
								
								When computing a new ConservativeResult, intersect it with  
							
							... 
							
							
							
							the old one instead of replacing it, to be more precise.
llvm-svn: 107256 
							
						 
						
							2010-06-30 06:58:35 +00:00  
				
					
						
							
							
								 
						
							
								ae36b1ed42 
								
							 
						 
						
							
							
								
								Fix ScalarEvolution's tripcount computation for chains of loops  
							
							... 
							
							
							
							where each loop's induction variable's start value is the exit
value of a preceding loop.
llvm-svn: 107224 
							
						 
						
							2010-06-29 23:43:06 +00:00  
				
					
						
							
							
								 
						
							
								90db61d638 
								
							 
						 
						
							
							
								
								Just as its not safe to blindly transfer the nsw bit from an add  
							
							... 
							
							
							
							instruction to an add scev, it's not safe to blindly transfer the
inbounds flag from a gep instruction to an nsw on the scev for the
gep.
llvm-svn: 107117 
							
						 
						
							2010-06-29 01:41:41 +00:00  
				
					
						
							
							
								 
						
							
								89dd42af31 
								
							 
						 
						
							
							
								
								Eliminate a redundant FoldingSet lookup.  
							
							... 
							
							
							
							llvm-svn: 106872 
							
						 
						
							2010-06-25 18:47:08 +00:00  
				
					
						
							
							
								 
						
							
								5235cc2c25 
								
							 
						 
						
							
							
								
								Don't try to preserve pointer types in SCEVConstants; the old code  
							
							... 
							
							
							
							was over-complicated.
llvm-svn: 106760 
							
						 
						
							2010-06-24 16:47:03 +00:00  
				
					
						
							
							
								 
						
							
								3ace9f4e3d 
								
							 
						 
						
							
							
								
								Make the trunc code consistent with the zext and sext code in its  
							
							... 
							
							
							
							handling of pointer types.
llvm-svn: 106757 
							
						 
						
							2010-06-24 16:33:38 +00:00  
				
					
						
							
							
								 
						
							
								75c6b0bb1f 
								
							 
						 
						
							
							
								
								Replace ScalarEvolution's private copy of getLoopPredecessor  
							
							... 
							
							
							
							with LoopInfo's public copy.
llvm-svn: 106603 
							
						 
						
							2010-06-22 23:43:28 +00:00  
				
					
						
							
							
								 
						
							
								f820bd327d 
								
							 
						 
						
							
							
								
								Allow "exhaustive" trip count evaluation on phi nodes with all  
							
							... 
							
							
							
							constant operands.
llvm-svn: 106537 
							
						 
						
							2010-06-22 13:15:46 +00:00  
				
					
						
							
							
								 
						
							
								dd41bba517 
								
							 
						 
						
							
							
								
								Use A.append(...) instead of A.insert(A.end(), ...) when A is a  
							
							... 
							
							
							
							SmallVector, and other SmallVector simplifications.
llvm-svn: 106452 
							
						 
						
							2010-06-21 19:47:52 +00:00  
				
					
						
							
							
								 
						
							
								866971ed3d 
								
							 
						 
						
							
							
								
								Fix ScalarEvolution's "exhaustive" trip count evaluation code to avoid  
							
							... 
							
							
							
							assuming that loops are in canonical form, as ScalarEvolution doesn't
depend on LoopSimplify itself. Also, with indirectbr not all loops can
be simplified. This fixes PR7416.
llvm-svn: 106389 
							
						 
						
							2010-06-19 14:17:24 +00:00  
				
					
						
							
							
								 
						
							
								24ceda8eb0 
								
							 
						 
						
							
							
								
								Revert r106304 (105548 and friends), which are the SCEVComplexityCompare  
							
							... 
							
							
							
							optimizations. There is still some nondeterminism remaining.
llvm-svn: 106306 
							
						 
						
							2010-06-18 19:54:20 +00:00  
				
					
						
							
							
								 
						
							
								4c807fca97 
								
							 
						 
						
							
							
								
								Reapply 105540, 105542, and 105548, and revert r105732.  
							
							... 
							
							
							
							llvm-svn: 106304 
							
						 
						
							2010-06-18 19:26:04 +00:00  
				
					
						
							
							
								 
						
							
								45073042eb 
								
							 
						 
						
							
							
								
								Reapply 105546.  
							
							... 
							
							
							
							llvm-svn: 106302 
							
						 
						
							2010-06-18 19:12:32 +00:00  
				
					
						
							
							
								 
						
							
								9136d9fbf8 
								
							 
						 
						
							
							
								
								Reapply 105544.  
							
							... 
							
							
							
							llvm-svn: 106301 
							
						 
						
							2010-06-18 19:09:27 +00:00  
				
					
						
							
							
								 
						
							
								3d8a9d7490 
								
							 
						 
						
							
							
								
								Remove getIntegerSCEV; it's redundant with getConstant, and getConstant  
							
							... 
							
							
							
							is more consistent with the ConstantInt API.
llvm-svn: 106281 
							
						 
						
							2010-06-18 14:33:50 +00:00  
				
					
						
							
							
								 
						
							
								8f5954f42c 
								
							 
						 
						
							
							
								
								Simplify this code.  
							
							... 
							
							
							
							llvm-svn: 106254 
							
						 
						
							2010-06-17 23:34:09 +00:00  
				
					
						
							
							
								 
						
							
								ae83e1f5cb 
								
							 
						 
						
							
							
								
								Revert 105540, 105542, 105544, 105546, and 105548 to unbreak bootstrapping.  
							
							... 
							
							
							
							llvm-svn: 105740 
							
						 
						
							2010-06-09 18:59:43 +00:00  
				
					
						
							
							
								 
						
							
								ebf2e977cf 
								
							 
						 
						
							
							
								
								The FoldingSet hash data includes pointer values, so it isn't  
							
							... 
							
							
							
							determinstic. Instead, give SCEV objects an arbitrary sequence
number.
llvm-svn: 105548 
							
						 
						
							2010-06-07 19:36:14 +00:00  
				
					
						
							
							
								 
						
							
								3553feed79 
								
							 
						 
						
							
							
								
								Optimize this code somewhat by taking advantage of the fact  
							
							... 
							
							
							
							that the operands are sorted.
llvm-svn: 105546 
							
						 
						
							2010-06-07 19:20:57 +00:00  
				
					
						
							
							
								 
						
							
								a2effb6452 
								
							 
						 
						
							
							
								
								Micro-optimize this, to speed up this hotspot in debug builds a little.  
							
							... 
							
							
							
							llvm-svn: 105544 
							
						 
						
							2010-06-07 19:16:37 +00:00  
				
					
						
							
							
								 
						
							
								18a4b46404 
								
							 
						 
						
							
							
								
								Micro-optimize this.  
							
							... 
							
							
							
							llvm-svn: 105542 
							
						 
						
							2010-06-07 19:12:54 +00:00  
				
					
						
							
							
								 
						
							
								70910a6ab6 
								
							 
						 
						
							
							
								
								Optimize ScalarEvolution's SCEVComplexityCompare predicate: don't go  
							
							... 
							
							
							
							scrounging through SCEVUnknown contents and SCEVNAryExpr operands;
instead just do a simple deterministic comparison of the precomputed
hash data.
Also, since this is more precise, it eliminates the need for the slow
N^2 duplicate detection code.
llvm-svn: 105540 
							
						 
						
							2010-06-07 19:06:13 +00:00  
				
					
						
							
							
								 
						
							
								a3b6c4b529 
								
							 
						 
						
							
							
								
								ConstantFoldConstantExpression can theoretically return null.  
							
							... 
							
							
							
							llvm-svn: 104948 
							
						 
						
							2010-05-28 16:12:08 +00:00  
				
					
						
							
							
								 
						
							
								70a3b12193 
								
							 
						 
						
							
							
								
								Use the SCEVAddRecExpr::getPostIncExpr utility function instead  
							
							... 
							
							
							
							of doing the same thing manually.
llvm-svn: 102997 
							
						 
						
							2010-05-04 01:12:27 +00:00  
				
					
						
							
							
								 
						
							
								5f18c547da 
								
							 
						 
						
							
							
								
								Fix a copy+pasto.  
							
							... 
							
							
							
							llvm-svn: 102996 
							
						 
						
							2010-05-04 01:11:15 +00:00  
				
					
						
							
							
								 
						
							
								1d2ded75e2 
								
							 
						 
						
							
							
								
								Use getConstant instead of getIntegerSCEV. The two are basically the  
							
							... 
							
							
							
							same, now that getConstant has overloads consistent with ConstantInt::get.
llvm-svn: 102965 
							
						 
						
							2010-05-03 22:09:21 +00:00  
				
					
						
							
							
								 
						
							
								267700c5aa 
								
							 
						 
						
							
							
								
								Silence warnings about -1 being converted to an unsigned value.  
							
							... 
							
							
							
							Also, pass true for isSigned even when creating constants for unsigned
comparisons, because the point is to create an all-ones constant,
rather than UINT64_MAX, even for integers wider than 64 bits.
llvm-svn: 102946 
							
						 
						
							2010-05-03 20:23:47 +00:00  
				
					
						
							
							
								 
						
							
								b5025c72eb 
								
							 
						 
						
							
							
								
								Use isTrueWhenEqual and isFalseWhenEqual instead of assuming that  
							
							... 
							
							
							
							SimplifyICmpOperands will simplify such cases to EQ or NE. This makes
the correcntess of the code independent on SimplifyICmpOperands doing
certain simplifications.
llvm-svn: 102927 
							
						 
						
							2010-05-03 18:00:24 +00:00  
				
					
						
							
							
								 
						
							
								d18dc2c876 
								
							 
						 
						
							
							
								
								In ScalarEvolution::print, don't bother printing out the SCEVs for  
							
							... 
							
							
							
							comparison instructions, since they aren't interesting, despite having
integer result types.
llvm-svn: 102925 
							
						 
						
							2010-05-03 17:03:23 +00:00  
				
					
						
							
							
								 
						
							
								df564cacaf 
								
							 
						 
						
							
							
								
								In SimplifyICmpOperands, avoid needlessly swapping the operands in the  
							
							... 
							
							
							
							case where both are addrecs in unrelated loops.
llvm-svn: 102924 
							
						 
						
							2010-05-03 17:00:11 +00:00  
				
					
						
							
							
								 
						
							
								81585c18e1 
								
							 
						 
						
							
							
								
								Factor out the new <= and >= analysis code into SimplifyICmpOperands.  
							
							... 
							
							
							
							llvm-svn: 102922 
							
						 
						
							2010-05-03 16:35:17 +00:00  
				
					
						
							
							
								 
						
							
								a0a8a7fe40 
								
							 
						 
						
							
							
								
								Set isSigned to true when creating an all-ones integer constant, even  
							
							... 
							
							
							
							for unsigned purposes, so >64-bit integer values get a full all-ones
value.
llvm-svn: 102739 
							
						 
						
							2010-04-30 19:22:39 +00:00