[PATCH] D39356: [ThinLTO] Fix missing call graph edges for calls with bitcasts.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 17:34:47 PST 2017


On Fri, Nov 10, 2017 at 5:19 PM, Volodymyr Sapsai via Phabricator <
reviews at reviews.llvm.org> wrote:

> vsapsai added inline comments.
>
>
> ================
> Comment at: llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cpp:284
> +        assert(CalledValue && !isa<Constant>(CalledValue) &&
> +               "Expected indirect call");
>
> ----------------
> efriedma wrote:
> > The following testcase triggers this assertion:
> >
> > ```
> > define void @caller() {
> >     tail call void select (i1 icmp eq (i32* @a, i32* null), void ()* @f,
> void ()* @g)()
> >     ret void
> > }
> > declare void @f()
> > declare void @g()
> > @a = extern_weak global i32
> > ```
> Good catch, Eli. In this case CalledValue is not NULL but it is
> SelectConstantExpr as far as I can tell.
>
> @tejohnson, do you think it's better to return previous skipping code or
> to handle this case in some special way?
>

I suspect we should just put the old continue back in, since we have now
confirmed we're getting reference edges for these cases. I was more
concerned about having the assert in when I thought we weren't getting any
edge.

Thanks,
Teresa


>
> @efriedma, is it based on existing test case or just on your LLVM
> knowledge? Asking to decide where to put this test. If it is a variation of
> another test, I would prefer to keep them together.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D39356
>
>
>
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171110/fbc454eb/attachment.html>


More information about the llvm-commits mailing list