[PATCH] D48181: [JumpThreading] Ignore nil destionation when determining whether a block only goes to a single destination

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 10:17:48 PDT 2018


In particular,  if you have a PHI node like phi(X, undef, X), you cannot
say the value is X unless X dominates the phi block.


On Fri, Jun 22, 2018 at 10:15 AM, Daniel Berlin <dberlin at dberlin.org> wrote:

>
>
>
> On Fri, Jun 22, 2018 at 9:41 AM, Xin Tong via Phabricator via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>
>> trentxintong added a comment.
>>
>> Hi @brzycki. This is a deficiency in a feature we already have. In jump
>> threading, when we can tell all the predecessors of a block go to the same
>> destination. we do not need to thread, we can just fold the terminator of
>> the block. This has less impact on the CFG and also we do not have the
>> problem of not being able to jump threading because the block can not be
>> duplicated.
>>
>> In case we have a Val being UNDEF, we can ignore it as it can be treated
>> as going to any successor, i.e. we should not go to MultipleDestSentinel
>> state because we see  a DestBB==nullptr.
>>
> This is not generally true.
> It's only true if the block is unreachable.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180622/102ee34a/attachment.html>


More information about the llvm-commits mailing list