[PATCH] D115333: [flang][codegen] Add a conversion for `fir.coordinate_of` - part 2

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 08:49:27 PST 2021


awarzynski added a comment.

In D115333#3197304 <https://reviews.llvm.org/D115333#3197304>, @rovka wrote:

> Is there a test for fir.ptr?

Added in the latest update :) As `fir.ptr` and `fir.ref` are practically identical, I've only added one sanity-test for `fir.ptr` (to avoid duplication). If there are no further comments, I'll merge later this week.



================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:2949
+    if (baseObjectTy.dyn_cast<fir::ReferenceType>() ||
+        baseObjectTy.dyn_cast<fir::PointerType>())
+      return doRewriteRef(coor, ty, operands, loc, rewriter);
----------------
rovka wrote:
> Nit: I'm not 100% sure, but can you use baseObjectTy.isa<fir::ReferenceType, fir::PointerType>()?
That's a neat trick, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115333



More information about the llvm-commits mailing list