[PATCH] D113563: [fir] Add !fir.alloca conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 10 09:16:46 PST 2021


clementval added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:122
+    return memSizeFunc;
+  TODO(op.getLoc(), "did not find allocation function");
+}
----------------
Should it really be a TODO? Maybe an error?


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:133
+                  mlir::ConversionPatternRewriter &rewriter) const override {
+    auto operands = adaptor.getOperands();
+    auto loc = alloc.getLoc();
----------------
We should update `auto` where is not super clear


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:135
+    auto loc = alloc.getLoc();
+    auto ity = lowerTy().indexType();
+    unsigned i = 0;
----------------



================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:137-139
+    auto size = genConstantIndex(loc, ity, rewriter, 1).getResult();
+    auto ty = convertType(alloc.getType());
+    auto resultTy = ty;
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113563



More information about the llvm-commits mailing list