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

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 06:30:20 PST 2020


ftynse accepted this revision.
ftynse added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:898
+static LogicalResult verify(MLIRCastOp op) {
+  auto verifyMLIRCastType = [&op](Type type) -> LogicalResult {
+    if (auto llvmType = type.dyn_cast<LLVM::LLVMType>()) {
----------------
timshen wrote:
> ftynse wrote:
> > Don't you also want to support memrefs?
> memref is complicated because of the descriptor. Do we allow the conversion between a memref and the aligned base pointer, or a memref and the descriptor? Neither seems trivial to implement to me, nor I really need it at the moment. Added a TODO.
I'd say between memref and descriptor. But you are right that it adds a lot of complexity since the descriptor type depends on the parameters of the lowering.


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