[PATCH] D75141: [MLIR] Add llvm.mlir.cast op for semantic preserving cast between dialect types.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 08:44:51 PST 2020


rriddle added inline comments.


================
Comment at: mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td:704
+  }];
+  let assemblyFormat = [{ $in attr-dict `:` type($in) `to` type($res) }];
+  let verifier = "return ::verify(*this);";
----------------
nit: use "" for single line strings.


================
Comment at: mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:900
+    if (auto llvmType = type.dyn_cast<LLVM::LLVMType>()) {
+      if (llvmType.isVectorTy()) {
+        llvmType = llvmType.getVectorElementType();
----------------
nit: Please drop all trivial braces.


================
Comment at: mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:914
+      } else {
+        return op.emitOpError("only 1-d vector is allowed");
+      }
----------------
nit: Please use early return instead. That allows for dropping the else.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75141





More information about the llvm-commits mailing list