[PATCH] D24805: [GVNSink] Initial GVNSink prototype
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 13:30:26 PDT 2016
On Wed, Sep 21, 2016 at 3:27 PM, Sebastian Pop <sebpop at gmail.com> wrote:
> sebpop added a comment.
>
> Hi James,
>
> after I discussed with @hiraditya, we realized that the example you give
> is not supposed to be sinked by a GVN-sink pass:
>
> [ %a1 = add i32 %b, 1 ] [ %c1 = add i32 %d, 1 ]
> [ %a2 = xor i32 %a1, 1 ] [ %c2 = xor i32 %c1, 1 ]
> \ /
> [ %e = phi i32 %a2, %c2 ]
> [ add i32 %e, 4 ]
>
> Sinking this example would need the bisimulation algorithm implemented in
> simplifyCFG:
>
So, you can make this work with a GVN-sink pass.
It's just not the traditional definition of "GVN" :)
As you mention, this is complementary to the algorithm one would "expect",
which handles the case you list below.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160921/c893cfe6/attachment.html>
More information about the llvm-commits
mailing list