[PATCH] D113879: [Flang] Notify conversion failure for Proc ops, types

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 08:39:35 PST 2021


kiranchandramohan added inline comments.


================
Comment at: flang/test/Fir/types-to-llvm.fir:78
+// CHECK-LABEL: foo0
+// CHECK-SAME: !llvm.struct<(ptr<ptr<func<void ()>>>, ptr<i8>)>
+
----------------
kiranchandramohan wrote:
> rovka wrote:
> > Why does this have to be ptr<ptr>? Isn't one level of indirection enough? (Sorry about the ignoramus question)
> That is a good question. I don't know the exact reason. I guess it is the following.
> 
> 1. Boxes are always references. I think this is modelled by the outer ptr.
> 2. The Fortran construct it models is a procedure pointer and this is the inner ptr.
> 
> 
> If we consider a function that takes in a procedure pointer as argument,  I think in LLVM IR this would require one load to get the value corresponding to the procedure (captured by a procedure pointer) and then an indirect call to call the loaded procedure.
> 
> 
> WDYT?
> 
@rovka After further investigation and discussions we decided to notify failures for the boxproc type and the proc based ops. Is the patch OK now?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113879/new/

https://reviews.llvm.org/D113879



More information about the llvm-commits mailing list