[PATCH] Teach BaseIndexOffset::match to identify base pointers in loops

Nadav Rotem nrotem at apple.com
Wed Aug 21 14:53:56 PDT 2013


LGTM. 

On Aug 21, 2013, at 2:44 PM, Juergen Ributzka <juergen at apple.com> wrote:

> Hi @ll,
> 
> the small utility function that pattern matches Base + Index + Offset patterns for loads and stores fails to recognize the base pointer for loads/stores from/into an array at offset 0 inside a loop. As a result DAGCombiner::MergeConsecutiveStores was not able to merge all stores.
> 
> Example:
> for(int i=0; i <N; i+=4) {
> 	a[i+0] = 1;
> 	a[i+1] = 1;
> 	a[i+2] = 1;
> 	a[i+3] = 1;
> }
> 
> In this example BaseIndexOffset::match would identify a different base pointer for a[i+0] then for all the others.
> 
> This small patch adds an additional pattern match to recognize this special case and a test case.
> 
> Cheers,
> Juergen
> 
> <mergestore.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list