[PATCH] D79159: [MLIR] Add complex numbers to standard dialect

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 02:44:27 PDT 2020


bondhugula added inline comments.


================
Comment at: mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h:161
 
+  // Convert complex number type: `complex<f16>` to `!llvm<"{ half, half }">`,
+  // `complex<f32>` to `!llvm<"{ float, float }">`, and `complex<f64>` to
----------------
These comments should all be triple /// I believe.


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:1525
+    The `im` operation extracts the imaginary part of a complex number as a
+    floating-point value.
+
----------------
Please document the operands. 


================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:1937
+
+    The `re` operation extracts the real part of a complex number as a
+    floating-point value.
----------------
Please document the operands.


================
Comment at: mlir/lib/Dialect/StandardOps/IR/Ops.cpp:1905
+  const auto &complexElementType =
+      op.cplx().getType().dyn_cast<ComplexType>().getElementType();
+  if (complexElementType != op.real().getType())
----------------
dyn_cast -> cast


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79159





More information about the llvm-commits mailing list