[PATCH] D35474: SSAUpdater: Add mode when Phi creation is not allowed

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 10:38:53 PDT 2017


On Mon, Jul 31, 2017 at 12:21 AM, Serguei Katkov via Phabricator <
reviews at reviews.llvm.org> wrote:

> skatkov abandoned this revision.
> skatkov added a comment.
>
> Hi Daniel,
>
> I've come up with the following implementation basing on your idea:
> https://reviews.llvm.org/D36073
>
> Please take into account that finally I realized that I could not use
> SSAUpdater API because it is possible that I can observe the base
> instruction in the same BB but the difference might be in the path I can
> get it.
> Simple example:
> p1 = b1 + 40
> p2 = b2 + 40
> p = p1
> if (cond) p = p2
> v = *(p)
>
> So I have p1 and p2 in the same basic block, so I cannot say to SSA update
> that I saw b1 and b2 in the same basic block to get the right phi node
> merging b1 and b2.
>

(I assume this if is turning into a select)
Right, you have to write/read the definitions in the right order, even with
the new API.

It's possible toavoid this issue by adding local dominance info using
ordered instructions, and then you could just add them in any order.

I'm pretty sure we could design something that worked a little better for
you.

Do you have an example of what you want the above output fo actually
produce in terms of phi nodes?

I hope the right implementation may b found in https://reviews.llvm.org/
> D36073
>
>
> https://reviews.llvm.org/D35474
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170731/11a24146/attachment.html>


More information about the llvm-commits mailing list