[PATCH] D113769: [fir] !fir.tdesc type conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 01:20:14 PST 2021


clementval added a comment.

In D113769#3127443 <https://reviews.llvm.org/D113769#3127443>, @kiranchandramohan wrote:

> Nit: Although these are all converted to i8 pointers, it might be good to have a few more tests? I have given a few below.
>
> $ ./bin/fir-opt --fir-to-llvm-ir tdesc.mlir
>
>> module  {
>>
>>   llvm.func @foo1(!llvm.ptr<i8>) attributes {sym_visibility = "private"}
>>   llvm.func @foo2(!llvm.ptr<i8>) attributes {sym_visibility = "private"}
>>   llvm.func @foo3(!llvm.ptr<i8>) attributes {sym_visibility = "private"}
>>
>> }
>
> $ cat tdesc.mlir
>
>> func private @foo1(%arg : !fir.tdesc<!fir.array<100xf32>>)
>> func private @foo2(%arg : !fir.tdesc<f32>)
>> func private @foo3(%arg : !fir.tdesc<!fir.type<derived7{f1:f32,f2:f32}>>)

I'll add your tests.



================
Comment at: flang/lib/Optimizer/CodeGen/TypeConverter.h:282-283
+  // fir.tdesc<any>  -->  llvm<"i8*">
+  // TODO: For now use a void*, however pointer identity is not sufficient for
+  // the f18 object v. class distinction (F2003).
+  mlir::Type convertTypeDescType(mlir::MLIRContext *ctx) {
----------------
awarzynski wrote:
> What's the f18 object?
Not the original author of this comment but I guess it refers to type vs. class. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113769



More information about the llvm-commits mailing list