[PATCH] D12170: Const propagatin after hitting assume bugfix

Nick Lewycky via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 17:06:09 PDT 2015


On 20 August 2015 at 19:31, Daniel Berlin via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> dberlin added a comment.
>
> I assume you are hitting this in switch statements or something similar.
> I triggered the same in NewGVN.
>
> Note that the comment in dominates is simply wrong.
> I discussed with this Rafael (who added this). The callers can, in fact,
> do *nothing* different than what the function would have to do, and in
> fact, would have to duplicate a ton of complicated critical edge logic that
> Dominates handles.  That seems really bad to me.
>
> Nowhere else in LLVM do we *assert* because a very dumb caller may cause a
> performance problem.
> The right fix here is to  simply remove the assert, and make sure your
> caller is smart about not calling this unnecessarily.
>

I'm not sure I follow.

The point of the function that's already there is to query "does this
*edge* dominate that block"? When the edge is non-singular, it certainly
doesn't (you can take the other edge between the same two blocks) and we
would need to return false. The comment is correct on that point. If you
removed the assert, you would need to replace it with "if (!isSingular())
return false;".

Which is not what we want as a caller. We want to query "does this block
dominate that block" therefore we don't care about singular edges at all,
we don't care if there's two edges from this block to that one. We want a
different interface because we want to ask a different question.

Removing the assert may be the right thing to do, but it doesn't save us
from needing this patch.

(IE cache the value of edge domination in cases like this).
>
>
> http://reviews.llvm.org/D12170
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150824/0be3d985/attachment.html>


More information about the llvm-commits mailing list