[llvm-dev] [poison] is select-of-select to logic+select allowed?
Matthias Braun via llvm-dev
llvm-dev at lists.llvm.org
Mon May 22 13:50:21 PDT 2017
Are we even at a point in the poison semantics discussion where we can reason about it? Is there a canonical description of poison at the moment which is in sync with LLVM (and alive)? The LLVM language reference doesn't even seem to mention the "poison filtering" effect of select; i.e. when the non-poison input of a select is taken no poison comes out of it. While such a semantic surely makes sense IMO, it only states that about Phi instructions at the moment...
Sorry for not being too helpful here and just answering with more questions.
- I assume matching for `select (i1, i8 freeze, i8 freeze)` like patterns would make this correct and as usefull again. But freeze is not part of official LLVM AFAIK.
- If this rule is considered a problem today, then we could probably move it to the SelectionDAG level.
- Matthias
> On May 22, 2017, at 1:32 PM, Sanjay Patel <spatel at rotateright.com> wrote:
>
> Some InstCombine transforms for select-of-select were added here:
> https://reviews.llvm.org/rL228409 <https://reviews.llvm.org/rL228409>
>
> But Alive says this is more poisonous:
>
> Name: selsel
> %s1 = select i1 %cond1, i8 C1, i8 C2
> %s2 = select i1 %cond2, i8 %s1, i8 C2
> =>
> %andcond = and i1 %cond1, %cond2
> %s2 = select i1 %andcond, i8 C1, i8 C2
>
> http://rise4fun.com/Alive/JT6 <http://rise4fun.com/Alive/JT6>
>
> Are those transforms legal?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170522/5950267f/attachment.html>
More information about the llvm-dev
mailing list