[PATCH] D113968: [fir] Add fircg.ext_array_coor conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 09:07:25 PST 2021


clementval added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:126-127
+    auto idxTy = lowerTy().indexType();
+    auto c0 = genConstantOffset(loc, rewriter, 0);
+    auto c7 = genConstantOffset(loc, rewriter, 7);
+    auto dimValue = genConstantIndex(loc, idxTy, rewriter, dim);
----------------
kiranchandramohan wrote:
> Does 0 and 7 have a name defined elsewhere?
7 has one. 0 is the base for GEP. 


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:172-192
+  // Get the element type given an LLVM type that is of the form
+  // [llvm.ptr](llvm.array|llvm.struct)+ and the provided indexes.
+  static mlir::Type getBoxEleTy(mlir::Type type,
+                                llvm::ArrayRef<unsigned> indexes) {
+    if (auto t = type.dyn_cast<mlir::LLVM::LLVMPointerType>())
+      type = t.getElementType();
+    for (auto i : indexes) {
----------------
kiranchandramohan wrote:
> If this is common code with embox then it might be better to add this patch as a child patch of embox.
I'll rebase once fir.embox is in. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113968



More information about the llvm-commits mailing list