6f5bf6a718 
								
							 
						 
						
							
							
								
								Rename some variables, only increment BI once at the start of the loop instead of throughout it.  
							
							... 
							
							
							
							llvm-svn: 60339 
							
						 
						
							2008-12-01 07:35:54 +00:00  
				
					
						
							
							
								 
						
							
								f00aae4968 
								
							 
						 
						
							
							
								
								pull the predMap densemap out of the inner loop of performPRE, so  
							
							... 
							
							
							
							that it isn't reallocated all the time.  This is a tiny speedup for
GVN: 3.90->3.88s
llvm-svn: 60338 
							
						 
						
							2008-12-01 07:29:03 +00:00  
				
					
						
							
							
								 
						
							
								9ce8995d24 
								
							 
						 
						
							
							
								
								Make GVN be more intelligent about redundant load  
							
							... 
							
							
							
							elimination: when finding dependent load/stores, realize that
they are the same if aliasing claims must alias instead of relying
on the pointers to be exactly equal.  This makes load elimination
more aggressive.  For example, on 403.gcc, we had:
<     68 gvn    - Number of instructions PRE'd
< 152718 gvn    - Number of instructions deleted
<  49699 gvn    - Number of loads deleted
<   6153 memdep - Number of dirty cached non-local responses
< 169336 memdep - Number of fully cached non-local responses
< 162428 memdep - Number of uncached non-local responses
now we have:
>     64 gvn    - Number of instructions PRE'd
> 153623 gvn    - Number of instructions deleted
>  49856 gvn    - Number of loads deleted
>   5022 memdep - Number of dirty cached non-local responses
> 159030 memdep - Number of fully cached non-local responses
> 162443 memdep - Number of uncached non-local responses
That's an extra 157 loads deleted and extra 905 other instructions nuked.
This slows down GVN very slightly, from 3.91 to 3.96s.
llvm-svn: 60314 
							
						 
						
							2008-12-01 01:31:36 +00:00  
				
					
						
							
							
								 
						
							
								7e61dafc95 
								
							 
						 
						
							
							
								
								Reimplement the non-local dependency data structure in terms of a sorted  
							
							... 
							
							
							
							vector instead of a densemap.  This shrinks the memory usage of this thing
substantially (the high water mark) as well as making operations like
scanning it faster.  This speeds up memdep slightly, gvn goes from
3.9376 to 3.9118s on 403.gcc
This also splits out the statistics for the cached non-local case to
differentiate between the dirty and clean cached case.  Here's the stats
for 403.gcc:
  6153 memdep - Number of dirty cached non-local responses
169336 memdep - Number of fully cached non-local responses
162428 memdep - Number of uncached non-local responses
yay for caching :)
llvm-svn: 60313 
							
						 
						
							2008-12-01 01:15:42 +00:00  
				
					
						
							
							
								 
						
							
								8541edec44 
								
							 
						 
						
							
							
								
								Cache analyses in ivars and add some useful DEBUG output.  
							
							... 
							
							
							
							This speeds up GVN from 4.0386s to 3.9376s.
llvm-svn: 60310 
							
						 
						
							2008-12-01 00:40:32 +00:00  
				
					
						
							
							
								 
						
							
								80c7d81e81 
								
							 
						 
						
							
							
								
								improve indentation, do cheap checks before expensive ones,  
							
							... 
							
							
							
							remove some fixme's.  This speeds up GVN very slightly on 403.gcc 
(4.06->4.03s)
llvm-svn: 60309 
							
						 
						
							2008-11-30 23:39:23 +00:00  
				
					
						
							
							
								 
						
							
								3ff6d01586 
								
							 
						 
						
							
							
								
								Fix a fixme by making memdep's handling of allocations more logical.  
							
							... 
							
							
							
							If we see that a load depends on the allocation of its memory with no
intervening stores, we now return a 'None' depedency instead of "Normal".
This tweaks GVN to do its optimization with the new result.
llvm-svn: 60267 
							
						 
						
							2008-11-30 01:39:32 +00:00  
				
					
						
							
							
								 
						
							
								1c6b62eb4d 
								
							 
						 
						
							
							
								
								Change MemDep::getNonLocalDependency to return its results as  
							
							... 
							
							
							
							a smallvector instead of a DenseMap.  This speeds up GVN by 5%
on 403.gcc.
llvm-svn: 60255 
							
						 
						
							2008-11-29 21:33:22 +00:00  
				
					
						
							
							
								 
						
							
								f280b0c729 
								
							 
						 
						
							
							
								
								reimplement getNonLocalDependency with a simpler worklist  
							
							... 
							
							
							
							formulation that is faster and doesn't require nonLazyHelper.
Much less code.
llvm-svn: 60253 
							
						 
						
							2008-11-29 21:22:42 +00:00  
				
					
						
							
							
								 
						
							
								51ba8d0630 
								
							 
						 
						
							
							
								
								Split getDependency into getDependency and getDependencyFrom, the  
							
							... 
							
							
							
							former does caching, the later doesn't.  This dramatically simplifies
the logic in getDependency and getDependencyFrom.
llvm-svn: 60234 
							
						 
						
							2008-11-29 03:47:00 +00:00  
				
					
						
							
							
								 
						
							
								7f9c8a0f05 
								
							 
						 
						
							
							
								
								Introduce and use a new MemDepResult class to hold the results of a memdep  
							
							... 
							
							
							
							query.  This makes it crystal clear what cases can escape from MemDep that
the clients have to handle.  This also gives the clients a nice simplified
interface to it that is easy to poke at.
This patch also makes DepResultTy and MemoryDependenceAnalysis::DepType
private, yay.
llvm-svn: 60231 
							
						 
						
							2008-11-29 02:29:27 +00:00  
				
					
						
							
							
								 
						
							
								de04e1173a 
								
							 
						 
						
							
							
								
								Reimplement the internal abstraction used by MemDep in terms  
							
							... 
							
							
							
							of a pointer/int pair instead of a manually bitmangled pointer.
This forces clients to think a little more about checking the 
appropriate pieces and will be useful for internal 
implementation improvements later.
I'm not particularly happy with this.  After going through this
I don't think that the clients of memdep should be exposed to
the internal type at all.  I'll fix this in a subsequent commit.
This has no functionality change.
llvm-svn: 60230 
							
						 
						
							2008-11-29 01:43:36 +00:00  
				
					
						
							
							
								 
						
							
								e3127f3f80 
								
							 
						 
						
							
							
								
								fix memleak by cleaning the global sets on pass exit  
							
							... 
							
							
							
							llvm-svn: 57353 
							
						 
						
							2008-10-10 16:25:50 +00:00  
				
					
						
							
							
								 
						
							
								26ff6f9c54 
								
							 
						 
						
							
							
								
								Add <cstdio> include where needed by gcc-4.4.  
							
							... 
							
							
							
							Patch by Samuel Tardieu.
llvm-svn: 57291 
							
						 
						
							2008-10-08 07:23:46 +00:00  
				
					
						
							
							
								 
						
							
								d65a4daeea 
								
							 
						 
						
							
							
								
								Factorize code: remove variants of "strip off  
							
							... 
							
							
							
							pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.
llvm-svn: 56922 
							
						 
						
							2008-10-01 15:25:41 +00:00  
				
					
						
							
							
								 
						
							
								a79db30d28 
								
							 
						 
						
							
							
								
								Tidy up several unbeseeming casts from pointer to intptr_t.  
							
							... 
							
							
							
							llvm-svn: 55779 
							
						 
						
							2008-09-04 17:05:41 +00:00  
				
					
						
							
							
								 
						
							
								2fbfb70530 
								
							 
						 
						
							
							
								
								Fix a bug that prevented PRE from applying in some cases.  
							
							... 
							
							
							
							llvm-svn: 55744 
							
						 
						
							2008-09-03 23:06:07 +00:00  
				
					
						
							
							
								 
						
							
								b39e0decf8 
								
							 
						 
						
							
							
								
								Put a heuristic in place to prevent GVN from falling into bad cases with massively complicated CFGs.  
							
							... 
							
							
							
							This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality.
llvm-svn: 55391 
							
						 
						
							2008-08-26 22:07:42 +00:00  
				
					
						
							
							
								 
						
							
								5fc8ab6d18 
								
							 
						 
						
							
							
								
								consolidate DenseMapInfo implementations, and add one for std::pair.  
							
							... 
							
							
							
							Patch contributed by m-s.
llvm-svn: 55167 
							
						 
						
							2008-08-22 05:08:25 +00:00  
				
					
						
							
							
								 
						
							
								2c741145a7 
								
							 
						 
						
							
							
								
								Supress a gcc-4.3 warning.  
							
							... 
							
							
							
							llvm-svn: 53771 
							
						 
						
							2008-07-18 21:06:02 +00:00  
				
					
						
							
							
								 
						
							
								04a6e0ba8c 
								
							 
						 
						
							
							
								
								Make PRE actually handle critical edges (by splitting them).  Confirmed that bootstrap passes with this change.  
							
							... 
							
							
							
							llvm-svn: 53762 
							
						 
						
							2008-07-18 18:03:38 +00:00  
				
					
						
							
							
								 
						
							
								addbe3eed1 
								
							 
						 
						
							
							
								
								Enable PRE.  My last batch of changes fixed the miscompile.  
							
							... 
							
							
							
							llvm-svn: 53730 
							
						 
						
							2008-07-17 19:41:00 +00:00  
				
					
						
							
							
								 
						
							
								c062381c7b 
								
							 
						 
						
							
							
								
								Factor MergeBlockIntoPredecessor out into BasicBlockUtils.  
							
							... 
							
							
							
							llvm-svn: 53705 
							
						 
						
							2008-07-17 00:01:40 +00:00  
				
					
						
							
							
								 
						
							
								ac31096311 
								
							 
						 
						
							
							
								
								There's no need to iterate block merging and PRE.  In fact, iterating the latter  
							
							... 
							
							
							
							could cause problems for memdep when it breaks critical edges.
llvm-svn: 53691 
							
						 
						
							2008-07-16 17:52:31 +00:00  
				
					
						
							
							
								 
						
							
								24768e3dc4 
								
							 
						 
						
							
							
								
								Revert this, as it seems to still be broken.  
							
							... 
							
							
							
							llvm-svn: 53627 
							
						 
						
							2008-07-15 17:59:02 +00:00  
				
					
						
							
							
								 
						
							
								9d1f497a28 
								
							 
						 
						
							
							
								
								Enable local PRE by default.  
							
							... 
							
							
							
							llvm-svn: 53616 
							
						 
						
							2008-07-15 16:28:23 +00:00  
				
					
						
							
							
								 
						
							
								53d546e40b 
								
							 
						 
						
							
							
								
								Have GVN do a pre-pass over the CFG that folds away unconditional branches where possible.  This allows local PRE to be more aggressive.  
							
							... 
							
							
							
							llvm-svn: 53615 
							
						 
						
							2008-07-15 16:28:06 +00:00  
				
					
						
							
							
								 
						
							
								8e462e9a82 
								
							 
						 
						
							
							
								
								Don't call lookupNumber more than we have to.  
							
							... 
							
							
							
							llvm-svn: 53470 
							
						 
						
							2008-07-11 20:05:13 +00:00  
				
					
						
							
							
								 
						
							
								3ea90a7d55 
								
							 
						 
						
							
							
								
								Use information already present in the ValueTable to fast-fail when we know there won't be a value number match.  This speeds up GVN on a case where there are very few redundancies by ~25%.  
							
							... 
							
							
							
							llvm-svn: 53108 
							
						 
						
							2008-07-03 17:44:33 +00:00  
				
					
						
							
							
								 
						
							
								6acc782dad 
								
							 
						 
						
							
							
								
								Avoid a redundant call.  
							
							... 
							
							
							
							llvm-svn: 53040 
							
						 
						
							2008-07-02 18:15:31 +00:00  
				
					
						
							
							
								 
						
							
								b22a640fe4 
								
							 
						 
						
							
							
								
								A better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable blocks.  
							
							... 
							
							
							
							llvm-svn: 53032 
							
						 
						
							2008-07-02 17:20:16 +00:00  
				
					
						
							
							
								 
						
							
								403e567043 
								
							 
						 
						
							
							
								
								Disable PRE. It's breaking bootstrapping.  
							
							... 
							
							
							
							llvm-svn: 52643 
							
						 
						
							2008-06-23 21:22:35 +00:00  
				
					
						
							
							
								 
						
							
								54e02194a1 
								
							 
						 
						
							
							
								
								Tighten the conditions under which we do PRE, remove some unneeded code, and correct our preserved analyses list, since we  
							
							... 
							
							
							
							do now change the CFG by splitting critical edges during PRE.
llvm-svn: 52631 
							
						 
						
							2008-06-23 17:49:45 +00:00  
				
					
						
							
							
								 
						
							
								42bbca11cc 
								
							 
						 
						
							
							
								
								Enable PRE.  
							
							... 
							
							
							
							llvm-svn: 52574 
							
						 
						
							2008-06-21 07:26:53 +00:00  
				
					
						
							
							
								 
						
							
								78fbcafb53 
								
							 
						 
						
							
							
								
								Really disable PRE.  
							
							... 
							
							
							
							llvm-svn: 52531 
							
						 
						
							2008-06-20 08:59:13 +00:00  
				
					
						
							
							
								 
						
							
								1b3ea963f7 
								
							 
						 
						
							
							
								
								Change around the data structures used to store availability sets, resulting in a GVN+PRE that is faster that GVN alone was before.  
							
							... 
							
							
							
							llvm-svn: 52521 
							
						 
						
							2008-06-20 01:15:47 +00:00  
				
					
						
							
							
								 
						
							
								9598f930f3 
								
							 
						 
						
							
							
								
								Disable PRE for now. It seems to be breaking llvm-gcc bootstrapping.  
							
							... 
							
							
							
							llvm-svn: 52518 
							
						 
						
							2008-06-20 01:01:07 +00:00  
				
					
						
							
							
								 
						
							
								e780d66657 
								
							 
						 
						
							
							
								
								Add a hidden -disable-pre flag for testing purposes.  This should be removed  
							
							... 
							
							
							
							once benchmarking is completed.
llvm-svn: 52506 
							
						 
						
							2008-06-19 19:57:25 +00:00  
				
					
						
							
							
								 
						
							
								fdf9f168b5 
								
							 
						 
						
							
							
								
								PRE requires that critical edges be split.  
							
							... 
							
							
							
							llvm-svn: 52505 
							
						 
						
							2008-06-19 19:54:19 +00:00  
				
					
						
							
							
								 
						
							
								ff21db851d 
								
							 
						 
						
							
							
								
								Be sure to remove values from the value numbering table after we delete them.  
							
							... 
							
							
							
							This fixes a failure on povray.
llvm-svn: 52499 
							
						 
						
							2008-06-19 17:53:26 +00:00  
				
					
						
							
							
								 
						
							
								45d3701fce 
								
							 
						 
						
							
							
								
								Revert support for insertvalue and extractvalue instructions for the moment.  
							
							... 
							
							
							
							GVN expects that all inputs which to an instruction fall somewhere in the value
hierarchy, which isn't true for these.
llvm-svn: 52496 
							
						 
						
							2008-06-19 17:25:39 +00:00  
				
					
						
							
							
								 
						
							
								3ea800fbad 
								
							 
						 
						
							
							
								
								Add support for extractvalue and insertvalue instructions in GVN.  
							
							... 
							
							
							
							llvm-svn: 52472 
							
						 
						
							2008-06-18 21:59:00 +00:00  
				
					
						
							
							
								 
						
							
								6a903bc601 
								
							 
						 
						
							
							
								
								Add local PRE to GVN.  This only operates in cases where it would not increase code size, namely when the instantiated expression  
							
							... 
							
							
							
							would only need to be created in one predecessor.
llvm-svn: 52471 
							
						 
						
							2008-06-18 21:41:49 +00:00  
				
					
						
							
							
								 
						
							
								75f3732b23 
								
							 
						 
						
							
							
								
								We don't want to find dependencies within the same block in this case.  It leads to incorrect results because  
							
							... 
							
							
							
							we're detecting something at or after the call we're querying on.
llvm-svn: 52433 
							
						 
						
							2008-06-17 22:27:06 +00:00  
				
					
						
							
							
								 
						
							
								accdca1b03 
								
							 
						 
						
							
							
								
								Switch GVN to use ScopedHashTable.  
							
							... 
							
							
							
							llvm-svn: 52242 
							
						 
						
							2008-06-12 19:25:32 +00:00  
				
					
						
							
							
								 
						
							
								5afc2740b7 
								
							 
						 
						
							
							
								
								Update comments and documentation to reflect that GCSE and ValueNumbering are  
							
							... 
							
							
							
							deprecated by the GVN and GVNPRE passes.
llvm-svn: 51983 
							
						 
						
							2008-06-05 07:55:49 +00:00  
				
					
						
							
							
								 
						
							
								61c7f2a633 
								
							 
						 
						
							
							
								
								Remove unneeded #include.  
							
							... 
							
							
							
							llvm-svn: 51955 
							
						 
						
							2008-06-04 18:28:10 +00:00  
				
					
						
							
							
								 
						
							
								65720c968c 
								
							 
						 
						
							
							
								
								Teach GVN to not assert on vector comparisons  
							
							... 
							
							
							
							llvm-svn: 51230 
							
						 
						
							2008-05-18 19:49:05 +00:00  
				
					
						
							
							
								 
						
							
								17816b321f 
								
							 
						 
						
							
							
								
								Fix Analysis/BasicAA/pure-const-dce.ll.  This turned out to be a correctness  
							
							... 
							
							
							
							bug as well as a missed optimization.  We weren't properly checking for local
dependencies before moving on to non-local ones when doing non-local read-only 
call CSE.
llvm-svn: 51082 
							
						 
						
							2008-05-13 23:18:30 +00:00  
				
					
						
							
							
								 
						
							
								8c2391d00d 
								
							 
						 
						
							
							
								
								Make the non-local CSE safety checks slightly more thorough.  
							
							... 
							
							
							
							llvm-svn: 51035 
							
						 
						
							2008-05-13 13:41:23 +00:00  
				
					
						
							
							
								 
						
							
								69057b80c7 
								
							 
						 
						
							
							
								
								Add support for non-local CSE of read-only calls.  
							
							... 
							
							
							
							llvm-svn: 51024 
							
						 
						
							2008-05-13 08:17:22 +00:00  
				
					
						
							
							
								 
						
							
								f792860255 
								
							 
						 
						
							
							
								
								Go back to passing the analyses around as parameters.  
							
							... 
							
							
							
							llvm-svn: 50995 
							
						 
						
							2008-05-12 20:15:55 +00:00  
				
					
						
							
							
								 
						
							
								4afb1c864a 
								
							 
						 
						
							
							
								
								Move the various analyses used by GVN into static variables so we don't have to keep passing them around or refetching them.  
							
							... 
							
							
							
							llvm-svn: 50963 
							
						 
						
							2008-05-12 08:15:27 +00:00  
				
					
						
							
							
								 
						
							
								a5b96ecef9 
								
							 
						 
						
							
							
								
								Remove unneeded #include's.  
							
							... 
							
							
							
							llvm-svn: 50035 
							
						 
						
							2008-04-21 07:47:38 +00:00  
				
					
						
							
							
								 
						
							
								f9ae76d89c 
								
							 
						 
						
							
							
								
								Make GVN able to remove unnecessary calls to read-only functions again.  
							
							... 
							
							
							
							llvm-svn: 49842 
							
						 
						
							2008-04-17 05:36:50 +00:00  
				
					
						
							
							
								 
						
							
								1e73f29a7f 
								
							 
						 
						
							
							
								
								Fix PR2213 by simultaneously making GVN more aggressive with the return values  
							
							... 
							
							
							
							of calls and less aggressive with non-readnone calls.
llvm-svn: 49516 
							
						 
						
							2008-04-11 05:11:49 +00:00  
				
					
						
							
							
								 
						
							
								ef9a6fd5c2 
								
							 
						 
						
							
							
								
								Factor a bunch of functionality related to memcpy and memset transforms out of  
							
							... 
							
							
							
							GVN and into its own pass.
llvm-svn: 49419 
							
						 
						
							2008-04-09 08:23:16 +00:00  
				
					
						
							
							
								 
						
							
								8ee792d1b6 
								
							 
						 
						
							
							
								
								Remove accidentally duplicated code.  
							
							... 
							
							
							
							llvm-svn: 49418 
							
						 
						
							2008-04-09 07:55:01 +00:00  
				
					
						
							
							
								 
						
							
								ed92b41a39 
								
							 
						 
						
							
							
								
								Add operator= implementations to SparseBitVector, allowing it to be used in GVN.  This results  
							
							... 
							
							
							
							in both time and memory savings for GVN.  For example, one testcase went from 10.5s to 6s with
this patch.
llvm-svn: 49345 
							
						 
						
							2008-04-07 17:38:23 +00:00  
				
					
						
							
							
								 
						
							
								0c1e634cbb 
								
							 
						 
						
							
							
								
								Make GVN more memory efficient, particularly on code that contains a large number of  
							
							... 
							
							
							
							allocations, which GVN can't optimize anyways.
llvm-svn: 49329 
							
						 
						
							2008-04-07 09:59:07 +00:00  
				
					
						
							
							
								 
						
							
								e9ecc68d8f 
								
							 
						 
						
							
							
								
								API changes for class Use size reduction, wave 1.  
							
							... 
							
							
							
							Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277 
							
						 
						
							2008-04-06 20:25:17 +00:00  
				
					
						
							
							
								 
						
							
								4311ad2dae 
								
							 
						 
						
							
							
								
								change iterator invalidation avoidance to just move the iterator backward  
							
							... 
							
							
							
							when something changes, instead of moving forward.  This allows us to 
simplify memset lowering, inserting the memset at the end of the range of 
stuff we're touching instead of at the start.
This, in turn, allows us to make use of the addressing instructions already
used in the function instead of inserting our own.  For example, we now
codegen:
	%tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0		; <i8*> [#uses=2]
	call void @llvm.memset.i64( i8* %tmp41, i8 -1, i64 8, i32 1 )
instead of:
	%tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7		; <i8*> [#uses=1]
	%ptroffset = getelementptr i8* %tmp20, i64 -7		; <i8*> [#uses=1]
	call void @llvm.memset.i64( i8* %ptroffset, i8 -1, i64 8, i32 1 )
llvm-svn: 48940 
							
						 
						
							2008-03-29 05:15:47 +00:00  
				
					
						
							
							
								 
						
							
								ac95515741 
								
							 
						 
						
							
							
								
								make the common case of a single store (which clearly shouldn't be turned  
							
							... 
							
							
							
							into a memset!) faster by avoiding an allocation of an std::list node.
llvm-svn: 48939 
							
						 
						
							2008-03-29 04:52:12 +00:00  
				
					
						
							
							
								 
						
							
								d528b21a65 
								
							 
						 
						
							
							
								
								give form-memset a significantly more sane heuristic, enable it by default.  
							
							... 
							
							
							
							llvm-svn: 48937 
							
						 
						
							2008-03-29 04:36:18 +00:00  
				
					
						
							
							
								 
						
							
								d62964a7d8 
								
							 
						 
						
							
							
								
								make memset inference significantly more powerful: it can now handle  
							
							... 
							
							
							
							memsets that initialize "structs of arrays" and other store sequences
that are not sequential.  This is still only enabled if you pass 
-form-memset-from-stores.  The flag is not heavily tested and I haven't
analyzed the perf regressions when -form-memset-from-stores is passed
either, but this causes no make check regressions.
llvm-svn: 48909 
							
						 
						
							2008-03-28 06:45:13 +00:00  
				
					
						
							
							
								 
						
							
								21a8e3d260 
								
							 
						 
						
							
							
								
								Temporarily disabling memset forming optimization. Add an option.  
							
							... 
							
							
							
							llvm-svn: 48720 
							
						 
						
							2008-03-24 05:28:38 +00:00  
				
					
						
							
							
								 
						
							
								53ccb62712 
								
							 
						 
						
							
							
								
								implement an initial hack at a straight-line store -> memset optimization.  
							
							... 
							
							
							
							This fires dozens of times across spec and multisource, but I don't know
if it actually speeds stuff up.  Hopefully the testers will show something
nice :)
llvm-svn: 48680 
							
						 
						
							2008-03-22 05:37:16 +00:00  
				
					
						
							
							
								 
						
							
								168be766a8 
								
							 
						 
						
							
							
								
								implement the logic for memset insertion and store deletion.  
							
							... 
							
							
							
							llvm-svn: 48679 
							
						 
						
							2008-03-22 04:13:49 +00:00  
				
					
						
							
							
								 
						
							
								f5d41c67af 
								
							 
						 
						
							
							
								
								This is a partially implemented and currently disabled start of a store  
							
							... 
							
							
							
							merging optimization.  Nothing to see here, hopefully more later :)
llvm-svn: 48670 
							
						 
						
							2008-03-22 00:31:52 +00:00  
				
					
						
							
							
								 
						
							
								804209d17c 
								
							 
						 
						
							
							
								
								the size of a smallvector shouldn't be part of the interface to these methods.  
							
							... 
							
							
							
							llvm-svn: 48662 
							
						 
						
							2008-03-21 22:01:16 +00:00  
				
					
						
							
							
								 
						
							
								beb216da0a 
								
							 
						 
						
							
							
								
								make gvn marginally faster by reallocating the lastSeenLoad map for  
							
							... 
							
							
							
							each basic block.
llvm-svn: 48660 
							
						 
						
							2008-03-21 21:33:23 +00:00  
				
					
						
							
							
								 
						
							
								2876a645c3 
								
							 
						 
						
							
							
								
								Minor cleanups and shrinkification.  
							
							... 
							
							
							
							llvm-svn: 48658 
							
						 
						
							2008-03-21 21:14:38 +00:00  
				
					
						
							
							
								 
						
							
								7a69e3aef3 
								
							 
						 
						
							
							
								
								Fix a bug in GVN that Duncan noticed, where we potentially need to insert a  
							
							... 
							
							
							
							pointer bitcast when performing return slot optimization.
llvm-svn: 48343 
							
						 
						
							2008-03-13 22:07:10 +00:00  
				
					
						
							
							
								 
						
							
								6ff0b822b4 
								
							 
						 
						
							
							
								
								Improve the return slot optimization to be both more aggressive (not limited to sret parameters), and  
							
							... 
							
							
							
							safer (when the passed pointer might be invalid).  Thanks to Duncan and Chris for the idea behind this, 
and extra thanks to Duncan for helping me work out the trap-safety.
llvm-svn: 48280 
							
						 
						
							2008-03-12 07:37:44 +00:00  
				
					
						
							
							
								 
						
							
								d29ed0b122 
								
							 
						 
						
							
							
								
								Fix an issue where GVN had the sizes of the two memcpy's reverse, resulting  
							
							... 
							
							
							
							in an invalid transformation.
llvm-svn: 47639 
							
						 
						
							2008-02-26 23:06:17 +00:00  
				
					
						
							
							
								 
						
							
								df1d2b02f9 
								
							 
						 
						
							
							
								
								Fix an issue where GVN was performing the return slot optimization when it was  
							
							... 
							
							
							
							not safe.  This is fixed by more aggressively checking that the return slot is
not used elsewhere in the function.
llvm-svn: 47544 
							
						 
						
							2008-02-25 04:08:09 +00:00  
				
					
						
							
							
								 
						
							
								40dca46ddb 
								
							 
						 
						
							
							
								
								Fix an issue where GVN would try to use an instruction before its definition when performing return slot optimization.  
							
							... 
							
							
							
							llvm-svn: 47541 
							
						 
						
							2008-02-25 00:40:41 +00:00  
				
					
						
							
							
								 
						
							
								1bfd121321 
								
							 
						 
						
							
							
								
								Make Transforms to be 4.3 warnings-clean  
							
							... 
							
							
							
							llvm-svn: 47371 
							
						 
						
							2008-02-20 11:26:25 +00:00  
				
					
						
							
							
								 
						
							
								b4724dbda2 
								
							 
						 
						
							
							
								
								When performing return slot optimization, remember to inform memdep when we're removing the memcpy.  
							
							... 
							
							
							
							llvm-svn: 47364 
							
						 
						
							2008-02-20 08:23:02 +00:00  
				
					
						
							
							
								 
						
							
								e92e303582 
								
							 
						 
						
							
							
								
								Refactor this method a bit, and correct a test that was completely wrong but happened to work out anyways. :-)  
							
							... 
							
							
							
							llvm-svn: 47321 
							
						 
						
							2008-02-19 07:07:51 +00:00  
				
					
						
							
							
								 
						
							
								f7b7ba9c5a 
								
							 
						 
						
							
							
								
								isa+cast -> dyncast.  
							
							... 
							
							
							
							llvm-svn: 47320 
							
						 
						
							2008-02-19 06:53:20 +00:00  
				
					
						
							
							
								 
						
							
								c130e3afc4 
								
							 
						 
						
							
							
								
								simplify  this code again, try 2 :)  
							
							... 
							
							
							
							llvm-svn: 47319 
							
						 
						
							2008-02-19 06:52:38 +00:00  
				
					
						
							
							
								 
						
							
								e71d6e37b2 
								
							 
						 
						
							
							
								
								Fix a comment.  
							
							... 
							
							
							
							llvm-svn: 47318 
							
						 
						
							2008-02-19 06:51:23 +00:00  
				
					
						
							
							
								 
						
							
								806cbde53b 
								
							 
						 
						
							
							
								
								Major improvements to yesterday's return slot optimization.  Remove some unneccessary constraints,  
							
							... 
							
							
							
							and add some others that should have been in from the first place.  Document the whole thing better.
llvm-svn: 47315 
							
						 
						
							2008-02-19 06:35:43 +00:00  
				
					
						
							
							
								 
						
							
								c0c3cd8e27 
								
							 
						 
						
							
							
								
								Factor the profitability check for return slot optimization out into a static function.  
							
							... 
							
							
							
							At some point in the future, this check will become smarter.
llvm-svn: 47310 
							
						 
						
							2008-02-19 03:27:34 +00:00  
				
					
						
							
							
								 
						
							
								551b8eeb5c 
								
							 
						 
						
							
							
								
								An sret parameter is required to be the first parameter, so there's no need to loop  
							
							... 
							
							
							
							over all the parameters of the callee looking for it.
llvm-svn: 47309 
							
						 
						
							2008-02-19 03:15:29 +00:00  
				
					
						
							
							
								 
						
							
								336824f102 
								
							 
						 
						
							
							
								
								Cleanup some of my patches from yesterday.  Refactor the check for which xform  
							
							... 
							
							
							
							to apply to a memcpy into processInstruction.  Also, fix a bug in the check due to
missing braces.
llvm-svn: 47307 
							
						 
						
							2008-02-19 03:09:45 +00:00  
				
					
						
							
							
								 
						
							
								ffca8e99b2 
								
							 
						 
						
							
							
								
								Fix Transforms/GVN/memcpy.ll, which Chris broke in r47275 by reordering the branches.  memcpy's are a kind of CallInst.  
							
							... 
							
							
							
							llvm-svn: 47305 
							
						 
						
							2008-02-19 02:53:23 +00:00  
				
					
						
							
							
								 
						
							
								0af5601028 
								
							 
						 
						
							
							
								
								minor code simplification, no functionality change.  
							
							... 
							
							
							
							llvm-svn: 47275 
							
						 
						
							2008-02-18 17:47:29 +00:00  
				
					
						
							
							
								 
						
							
								3549553262 
								
							 
						 
						
							
							
								
								Add support to GVN for performing sret return slot optimization.  This means that, if an sret function tail calls  
							
							... 
							
							
							
							another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct
return value.  llvm-gcc does not emit this by default.  Instead, it allocates space in the caller for the sret of
the tail call and then uses memcpy to copy the result into the caller's sret parameter.  This optimization detects
and optimizes that case.
llvm-svn: 47265 
							
						 
						
							2008-02-18 09:24:53 +00:00  
				
					
						
							
							
								 
						
							
								7c77e2bc65 
								
							 
						 
						
							
							
								
								Fix PR2032. Inform the alias analysis of changes to the underlying program.  
							
							... 
							
							
							
							llvm-svn: 47111 
							
						 
						
							2008-02-14 07:11:24 +00:00  
				
					
						
							
							
								 
						
							
								00dba4f734 
								
							 
						 
						
							
							
								
								Re-apply the patch to improve the optimizations of memcpy's, with several  
							
							... 
							
							
							
							bugs fixed.  This now passes PPC bootstrap.
llvm-svn: 47026 
							
						 
						
							2008-02-12 21:15:18 +00:00  
				
					
						
							
							
								 
						
							
								716c10c01e 
								
							 
						 
						
							
							
								
								Fix for bug 1996: optimize out loads of undef.  This code basically just  
							
							... 
							
							
							
							checks for a malloc/alloca immediately followed by a load.
llvm-svn: 47006 
							
						 
						
							2008-02-12 12:08:14 +00:00  
				
					
						
							
							
								 
						
							
								c676a0329c 
								
							 
						 
						
							
							
								
								Temporarily reverting:  
							
							... 
							
							
							
							http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057882.html 
This is causing a miscompilation on PPC G5 and just now seeing it on iMac x86-64.
llvm-svn: 46822 
						
							2008-02-06 20:03:07 +00:00  
				
					
						
							
							
								 
						
							
								c4a7c41869 
								
							 
						 
						
							
							
								
								Allow GVN to hack on memcpy's, making them open to further optimization.  
							
							... 
							
							
							
							llvm-svn: 46693 
							
						 
						
							2008-02-04 02:59:58 +00:00  
				
					
						
							
							
								 
						
							
								f3ebc3f3d2 
								
							 
						 
						
							
							
								
								Remove attribution from file headers, per discussion on llvmdev.  
							
							... 
							
							
							
							llvm-svn: 45418 
							
						 
						
							2007-12-29 20:36:04 +00:00  
				
					
						
							
							
								 
						
							
								086b2c4537 
								
							 
						 
						
							
							
								
								Fix several cache coherence bugs in MemDep/GVN that were found.  Also add some (disabled) debugging code  
							
							... 
							
							
							
							to make such problems easier to diagnose in the future, written by Duncan Sands.
llvm-svn: 44695 
							
						 
						
							2007-12-08 01:37:09 +00:00  
				
					
						
							
							
								 
						
							
								68b6f50938 
								
							 
						 
						
							
							
								
								Integrate the readonly/readnone logic more deeply  
							
							... 
							
							
							
							into alias analysis.  This meant updating the API
which now has versions of the getModRefBehavior,
doesNotAccessMemory and onlyReadsMemory methods
which take a callsite parameter.  These should be
used unless the callsite is not known, since in
general they can do a better job than the versions
that take a function.  Also, users should no longer
call the version of getModRefBehavior that takes
both a function and a callsite.  To reduce the
chance of misuse it is now protected.
llvm-svn: 44487 
							
						 
						
							2007-12-01 07:51:45 +00:00  
				
					
						
							
							
								 
						
							
								ffa55112e0 
								
							 
						 
						
							
							
								
								Fix a miscompilation in spiff on PPC.  
							
							... 
							
							
							
							llvm-svn: 44437 
							
						 
						
							2007-11-29 18:02:22 +00:00  
				
					
						
							
							
								 
						
							
								9f0b6e9d46 
								
							 
						 
						
							
							
								
								Fix another bug that was causing siod to fail.  
							
							... 
							
							
							
							llvm-svn: 44325 
							
						 
						
							2007-11-26 07:17:19 +00:00  
				
					
						
							
							
								 
						
							
								4f833c7610 
								
							 
						 
						
							
							
								
								Allow GVN to eliminate read-only function calls when it can detect that they are redundant.  
							
							... 
							
							
							
							llvm-svn: 44323 
							
						 
						
							2007-11-26 02:26:36 +00:00  
				
					
						
							
							
								 
						
							
								09b83ba6f1 
								
							 
						 
						
							
							
								
								Allow GVN to eliminate redundant calls to functions without side effects.  
							
							... 
							
							
							
							llvm-svn: 43147 
							
						 
						
							2007-10-18 19:39:33 +00:00  
				
					
						
							
							
								 
						
							
								46da2a6262 
								
							 
						 
						
							
							
								
								Add partial caching of non-local memory dependence queries.  This provides a modest  
							
							... 
							
							
							
							speedup for GVN.
llvm-svn: 42185 
							
						 
						
							2007-09-21 03:53:52 +00:00  
				
					
						
							
							
								 
						
							
								0625bd6472 
								
							 
						 
						
							
							
								
								Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo  
							
							... 
							
							
							
							Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.
llvm-svn: 42042 
							
						 
						
							2007-09-17 18:34:04 +00:00  
				
					
						
							
							
								 
						
							
								4cd516b50b 
								
							 
						 
						
							
							
								
								Be more careful when constant-folding PHI nodes.  
							
							... 
							
							
							
							llvm-svn: 41998 
							
						 
						
							2007-09-16 08:04:16 +00:00  
				
					
						
							
							
								 
						
							
								f5023a7a84 
								
							 
						 
						
							
							
								
								Factor out some code into a helper function.  
							
							... 
							
							
							
							llvm-svn: 41131 
							
						 
						
							2007-08-16 22:51:56 +00:00  
				
					
						
							
							
								 
						
							
								221a43604e 
								
							 
						 
						
							
							
								
								Add some more comments to GVN.  
							
							... 
							
							
							
							llvm-svn: 41129 
							
						 
						
							2007-08-16 22:02:55 +00:00  
				
					
						
							
							
								 
						
							
								bc271a02fd 
								
							 
						 
						
							
							
								
								Eliminate PHI nodes with constant values during normal GVN processing, even when  
							
							... 
							
							
							
							they're not related to eliminating a load.
llvm-svn: 41081 
							
						 
						
							2007-08-14 18:33:27 +00:00  
				
					
						
							
							
								 
						
							
								398602a6eb 
								
							 
						 
						
							
							
								
								Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.  
							
							... 
							
							
							
							llvm-svn: 41080 
							
						 
						
							2007-08-14 18:16:29 +00:00  
				
					
						
							
							
								 
						
							
								676070d503 
								
							 
						 
						
							
							
								
								Make GVN iterative.  
							
							... 
							
							
							
							llvm-svn: 41078 
							
						 
						
							2007-08-14 18:04:11 +00:00  
				
					
						
							
							
								 
						
							
								a7b220f23a 
								
							 
						 
						
							
							
								
								Fix a case where GVN was failing to return true when it had, in fact, modified  
							
							... 
							
							
							
							the function.
llvm-svn: 41077 
							
						 
						
							2007-08-14 17:59:48 +00:00  
				
					
						
							
							
								 
						
							
								9b1cc8cac0 
								
							 
						 
						
							
							
								
								Make NonLocal and None const in the right way. :-)  
							
							... 
							
							
							
							llvm-svn: 40961 
							
						 
						
							2007-08-09 04:42:44 +00:00  
				
					
						
							
							
								 
						
							
								b84d3b1c92 
								
							 
						 
						
							
							
								
								Change the None and NonLocal markers in memdep to be const.  
							
							... 
							
							
							
							llvm-svn: 40946 
							
						 
						
							2007-08-08 21:39:39 +00:00  
				
					
						
							
							
								 
						
							
								0cc1a76283 
								
							 
						 
						
							
							
								
								Don't insert nearly as many redundant phi nodes.  
							
							... 
							
							
							
							llvm-svn: 40909 
							
						 
						
							2007-08-07 23:12:31 +00:00  
				
					
						
							
							
								 
						
							
								2d19aae4ca 
								
							 
						 
						
							
							
								
								Fix a subtle miscompilation.  This allows 197.parser to be compiled correctly.  
							
							... 
							
							
							
							llvm-svn: 40791 
							
						 
						
							2007-08-03 19:59:35 +00:00  
				
					
						
							
							
								 
						
							
								774761c503 
								
							 
						 
						
							
							
								
								Fix a subtle iterator invalidation bug in a recursive algorithm.  
							
							... 
							
							
							
							llvm-svn: 40776 
							
						 
						
							2007-08-03 11:03:26 +00:00  
				
					
						
							
							
								 
						
							
								9699a6ea03 
								
							 
						 
						
							
							
								
								Fix 80 col. violations.  
							
							... 
							
							
							
							llvm-svn: 40750 
							
						 
						
							2007-08-02 18:16:06 +00:00  
				
					
						
							
							
								 
						
							
								0ac1fc8ac1 
								
							 
						 
						
							
							
								
								Fix a bug that was causing several miscompilations on SPEC.  
							
							... 
							
							
							
							llvm-svn: 40746 
							
						 
						
							2007-08-02 17:56:05 +00:00  
				
					
						
							
							
								 
						
							
								c321e5e272 
								
							 
						 
						
							
							
								
								Make non-local memdep not be recursive, and fix a bug on 403.gcc that this exposed.  
							
							... 
							
							
							
							llvm-svn: 40692 
							
						 
						
							2007-08-01 22:01:54 +00:00  
				
					
						
							
							
								 
						
							
								10ffa860d8 
								
							 
						 
						
							
							
								
								Don't let the memory allocator outsmart GVN. ;-)  
							
							... 
							
							
							
							llvm-svn: 40655 
							
						 
						
							2007-07-31 23:27:13 +00:00  
				
					
						
							
							
								 
						
							
								2464f4f048 
								
							 
						 
						
							
							
								
								Fix a failure I accidentally caused in my last commit by mishandling the  
							
							... 
							
							
							
							removal of redundant phis.
llvm-svn: 40650 
							
						 
						
							2007-07-31 20:18:28 +00:00  
				
					
						
							
							
								 
						
							
								d58fa6b09f 
								
							 
						 
						
							
							
								
								Fix a misoptimization in aha.  
							
							... 
							
							
							
							llvm-svn: 40642 
							
						 
						
							2007-07-31 17:43:14 +00:00  
				
					
						
							
							
								 
						
							
								850138157e 
								
							 
						 
						
							
							
								
								Avoid potential iterator invalidation problems.  
							
							... 
							
							
							
							llvm-svn: 40607 
							
						 
						
							2007-07-30 21:26:39 +00:00  
				
					
						
							
							
								 
						
							
								212d5c27f6 
								
							 
						 
						
							
							
								
								Use more caching when computing non-local dependence.  This makes bzip2 not  
							
							... 
							
							
							
							use up the entire 32-bit address space.
llvm-svn: 40596 
							
						 
						
							2007-07-30 17:29:24 +00:00  
				
					
						
							
							
								 
						
							
								d66e285b2e 
								
							 
						 
						
							
							
								
								Fix a bug caused by indiscriminantly asking for the dominators of a predecessor.  
							
							... 
							
							
							
							llvm-svn: 40595 
							
						 
						
							2007-07-30 16:57:08 +00:00  
				
					
						
							
							
								 
						
							
								dbf23ccaa0 
								
							 
						 
						
							
							
								
								Fix a couple more bugs in the phi construction by pulling in code that does  
							
							... 
							
							
							
							almost the same things from LCSSA.
llvm-svn: 40540 
							
						 
						
							2007-07-26 18:26:51 +00:00  
				
					
						
							
							
								 
						
							
								3b8cc30a61 
								
							 
						 
						
							
							
								
								Fix what is _hopefully_ the last corner case for loops.  
							
							... 
							
							
							
							llvm-svn: 40503 
							
						 
						
							2007-07-25 23:54:42 +00:00  
				
					
						
							
							
								 
						
							
								8707412593 
								
							 
						 
						
							
							
								
								My last commit was not correct for nested loops.  Fix it, and add a testcase for it.  
							
							... 
							
							
							
							llvm-svn: 40498 
							
						 
						
							2007-07-25 22:19:40 +00:00  
				
					
						
							
							
								 
						
							
								3c67004d47 
								
							 
						 
						
							
							
								
								Fix an infinite loop on 300.twolf.  
							
							... 
							
							
							
							llvm-svn: 40497 
							
						 
						
							2007-07-25 22:03:06 +00:00  
				
					
						
							
							
								 
						
							
								7bf26ee444 
								
							 
						 
						
							
							
								
								Fix a bug that was causing GVN to crash on 252.eon.  
							
							... 
							
							
							
							llvm-svn: 40494 
							
						 
						
							2007-07-25 21:13:41 +00:00  
				
					
						
							
							
								 
						
							
								5e5599b7ce 
								
							 
						 
						
							
							
								
								Add basic support for performing whole-function RLE.  
							
							... 
							
							
							
							Note: This has not yet been thoroughly tested.  Use at your own risk.
llvm-svn: 40489 
							
						 
						
							2007-07-25 19:57:03 +00:00  
				
					
						
							
							
								 
						
							
								ab6ec2eac2 
								
							 
						 
						
							
							
								
								Add a GVN pass, using the value numbering code I developed for GVNPRE and the  
							
							... 
							
							
							
							load elimination code from RedundantLoadElimination.
llvm-svn: 40469 
							
						 
						
							2007-07-24 17:55:58 +00:00