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

Alexander Belyaev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 02:44:23 PDT 2020


pifon2a added a comment.

awesome! thanks!



================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:1541
+
+  let verifier = [{ return ::verify(*this); }];
+}
----------------
verifier is already included in Std_Op, you don't have to add it here.


================
Comment at: mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp:197
+  const FloatType elementType = type.getElementType().dyn_cast<FloatType>();
+  const LLVM::LLVMType llvmElementType =
+      convertFloatType(elementType).dyn_cast<LLVM::LLVMType>();
----------------
`const` can be omitted in LLVM codebase.


================
Comment at: mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp:1314
+    auto packedType = typeConverter.convertType(complexOp.getType());
+    Value packed = rewriter.create<LLVM::UndefOp>(op->getLoc(), packedType);
+    packed = rewriter.create<LLVM::InsertValueOp>(
----------------
`auto loc = op->getLoc();` and reuse it 3 times?


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