[PATCH] DAGCombiner: Merge load/store sequences with adresses: base + index + offset

Nadav Rotem nrotem at apple.com
Mon Apr 1 10:12:06 PDT 2013


LGTM! 

On Apr 1, 2013, at 9:51 AM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:

> We would also like to merge sequences that involve a variable index like in the
> example below.
> 
>    int index = *idx++
>    int i0 = c[index+0];
>    int i1 = c[index+1];
>    b[0] = i0;
>    b[1] = i1;
> 
> By extending the parsing of the base pointer to handle dags that contain a
> base, index, and offset we can handle examples like the one above.
> 
> The dag for the code above will look something like:
> 
> (load (i64 add (i64 copyfromreg %c)
>                (i64 signextend (i8 load %index))))
> 
> (load (i64 add (i64 copyfromreg %c)
>                (i64 signextend (i32 add (i32 signextend (i8 load %index))
>                                         (i32 1)))))
> 
> The code that parses the tree ignores the intermediate sign extensions. However,
> if there is a sign extension it needs to be on all indexes.
> 
> (load (i64 add (i64 copyfromreg %c)
>                (i64 signextend (add (i8 load %index)
>                                     (i8 1))))
> vs
> 
> (load (i64 add (i64 copyfromreg %c)
>                (i64 signextend (i32 add (i32 signextend (i8 load %index))
>                                         (i32 1)))))
> radar://13536387
> 
> <0001-Merge-load-store-sequences-with-adresses-base-index-.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130401/e7ba0d0a/attachment.html>


More information about the llvm-commits mailing list