[PATCH] D29200: [JumpThread] Enhance finding partial redundant loads by continuing scanning single predecessor

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 08:41:45 PST 2017


Great, if we need to do it, let's do it. Let's just try to test the stuff
that only this catches. Greatly appreciate you being willing to find better
test cases

On Thu, Feb 2, 2017, 8:24 AM <junbuml at codeaurora.org> wrote:

>
> Thanks Daniel for the detail.
>
> I believe this is a necessary process to open up more jump threading
> during jump threading tasks even though it could be done in other place.
> This is the initial comment in SimplifyPartiallyRedundantLoad() :
>   /// This is an important optimization that encourages jump threading,
> and needs to be run
>   /// interlaced with other jump threading tasks.
>
> This patch simply continue scanning to find a loaded value through
> single predecessors, instead of being limited within one single block,
> while respecting the backward scan limit (6 instructions by default).
>
> I observed this patch was applied in spec2000/2006 pretty widely, so I
> will find the case which was not handled before in the whole pipeline.
>
> Thanks,
> Jun
>
>
>
> On 2017-02-02 10:47, Daniel Berlin via Phabricator wrote:
> > dberlin added a comment.
> >
> > Also, for the record, all of these testcases are fully redundant loads.
> >
> > they are all of the form
> >
> >   load
> >   if (...)
> >   {
> >   load
> >   }
> >
> > This is a full redundancy. The initial load dominates the others, with
> > nothing in between, and so they are fully redundant This is also why
> > every pass we have that does any load elimination will already
> > eliminate them.
> >
> > A partially redundant load would be
> >
> >   if (a)
> >    load a
> >   else
> >     <nothing>
> >   load a
> >
> > This load is partially redundant because it unnecessarily happens
> > twice when we take the if(a)'s true branch
> >
> > PRE will turn it into:
> >
> >   if (a)
> >    load a
> >   else
> >    load a
> >   result = phi(...)
> >
> > As mentioned, GVN already does this transformation, so i'd really like
> > to see a testcase where you doing this in jump threading enables an
> > optimization we don't get already.
> >
> >
> > Repository:
> >   rL LLVM
> >
> > https://reviews.llvm.org/D29200
>
> --
> Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
> Technologies, Inc.
> Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a
> Linux Foundation Collaborative Project.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170202/7841318d/attachment.html>


More information about the llvm-commits mailing list