[llvm-dev] RFC: Strong GC References in LLVM

Andrew Trick via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 14 16:03:13 PDT 2016


> On Jul 14, 2016, at 3:40 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
> 
>  interface I {
>    void func();
>  }
> 
>  class F {
>    Object o;
>    void func() {
>      Object val = this.o;
>    }
>  }
> 
>  class G {
>    public static void f(I instance) {
>      instance.func();
>    }
>  }
> 
> then when compiling func() separately there is nothing the load of val
> is control dependent on, but in G::f if we do some form of predicated
> devirtualization and then inline the body of F::func then the safety
> of the load is predicated on the devirtualization predicate passing
> too.  If the predicated devirt. was itself conditional on some control
> flow based type refinement, then the safety of the load is control
> dependent on that control flow as well, and so on.

Yeah, the devirtualizer needs to insert a type cast, then inlining the load just inherits it. Isn’t that all done before LLVM IR?
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160714/de80a323/attachment-0001.html>


More information about the llvm-dev mailing list