[PATCH] D76602: [MLIR] Introduce std.alloca op

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 17:42:31 PDT 2020


rriddle added inline comments.


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:144
+    "Builder *builder, OperationState &result, MemRefType memrefType, " #
+    "ArrayRef<Value> operands, IntegerAttr alignment = IntegerAttr()", [{
+       result.addOperands(operands);
----------------
Use ValueRange instead of ArrayRef<Value> in builder mehtods.


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:252
+  let description = [{
+    The "alloca" operation allocates memory on the stack, to be automatically
+    released when the stack frame is discarded. The amount of memory allocated
----------------
nit: "alloca" -> `alloca`


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:256
 
-  let extraClassDeclaration = [{
-    static StringRef getAlignmentAttrName() { return "alignment"; }
+      %0 = alloca() : memref<8x64xf32>
 
----------------
Please use mlir code blocks for any inline code.


================
Comment at: mlir/lib/Dialect/StandardOps/IR/Ops.cpp:250
+static void printAllocLikeOp(OpAsmPrinter &p, AllocLikeOp op, StringRef name) {
+  static_assert(std::is_same<AllocLikeOp, AllocOp>::value ||
+                    std::is_same<AllocLikeOp, AllocaOp>::value,
----------------
llvm::is_one_of


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76602





More information about the llvm-commits mailing list