Ping 2: [PATCH] DAGCombiner: Recognise rotates by X+C

Eric Christopher echristo at gmail.com
Thu Jan 2 11:23:24 PST 2014


Evan is probably a good choice for reviewer here.

-eric

On Thu Jan 02 2014 at 4:02:14 AM, Richard Sandiford <
rsandifo at linux.vnet.ibm.com> wrote:

> Ping
> Richard Sandiford <rsandifo at linux.vnet.ibm.com> writes:
> > Kay Tiong Khoo <kkhoo at perfwizard.com> writes:
> >> Hi Richard,
> >>
> >> Could this patch be enhanced to recognize this case too:
> >> http://llvm.org/bugs/show_bug.cgi?id=17332#c12
> >>
> >> Maybe it already does? Sorry, I can't test it myself at the moment.
> >
> > Hi, thanks for the pointer.  The patch didn't handle that case but I
> agree
> > it'd be a good thing to add.
> >
> > Here's a version that does both.  I've split it into three patches:
> >
> > (1) is just a refactoring exercise.  It's easier to make changes to this
> >     code if there's only one copy of it.  No behavioural change intended.
> >
> > (2) is my original patch adjusted for (1).  E.g. we now recognise:
> >        (or (shl X, (add Y, 10)), (shr X, (sub 22, Y)))
> >     as a rotate by Y + 10.
> >
> > (3) also handles cases where the shift amount is ANDed.  E.g. we now
> >     recognise:
> >        (or (shl X, Y), (shr X, (and (sub 0, Y), 31)))
> >        (or (shl X, Y), (shr X, (and (sub 32, Y), 31)))
> >     as rotates by Y.  We can also handle redundant ANDs for (2) too:
> >        (or (shl X, (add Y, 10)), (shr X, (and (sub 22, Y), 31)))
> >
> > OK to commit?
> >
> > Thanks,
> > Richard
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140102/6ccd071b/attachment.html>


More information about the llvm-commits mailing list