[flang-commits] [PATCH] D113559: [fir] Add !fir.ptr type conversion
Diana Picus via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Nov 10 04:13:32 PST 2021
rovka created this revision.
rovka added reviewers: clementval, jeanPerier, schweitz, awarzynski, mehdi_amini, kiranchandramohan, AlexisPerry.
rovka added a project: Flang.
Herald added a subscriber: jdoerfert.
rovka requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch is part of the upstreaming effort for fir-dev.
Co-authored-by: Jean Perier <jperier at nvidia.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113559
Files:
flang/lib/Optimizer/CodeGen/TypeConverter.h
flang/test/Fir/types-to-llvm.fir
Index: flang/test/Fir/types-to-llvm.fir
===================================================================
--- flang/test/Fir/types-to-llvm.fir
+++ flang/test/Fir/types-to-llvm.fir
@@ -31,6 +31,17 @@
// -----
+// Test pointer types `!fir.ptr`
+
+func private @foo0(%arg0: !fir.ptr<i32>)
+// CHECK-LABEL: foo0
+// CHECK-SAME: !llvm.ptr<i32>
+func private @foo1(%arg0: !fir.ptr<!fir.array<10xf32>>)
+// CHECK-LABEL: foo1
+// CHECK-SAME: !llvm.ptr<array<10 x f32>>
+
+// -----
+
// Test box types `!fir.box`
func private @foo0(%arg0: !fir.box<!fir.array<?xf32>>)
Index: flang/lib/Optimizer/CodeGen/TypeConverter.h
===================================================================
--- flang/lib/Optimizer/CodeGen/TypeConverter.h
+++ flang/lib/Optimizer/CodeGen/TypeConverter.h
@@ -41,6 +41,8 @@
return mlir::IntegerType::get(
&getContext(), kindMapping.getLogicalBitsize(boolTy.getFKind()));
});
+ addConversion(
+ [&](fir::PointerType pointer) { return convertPointerLike(pointer); });
addConversion(
[&](fir::RecordType derived) { return convertRecordType(derived); });
addConversion(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113559.386117.patch
Type: text/x-patch
Size: 1147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211110/a927e384/attachment.bin>
More information about the flang-commits
mailing list