See discussion here: https://llvm.discourse.group/t/rfc-dialect-type-cast-op/538/11
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Makes sense to me, mostly nits.
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | ||
---|---|---|
689 | Nit: drop "MLIR" from the def name, we are not using it in other operations (constant, undef) | |
704 | Nit: the implicit convention for cast operations is to use type($in) 'to' type($res), let's follow it here as well. | |
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp | ||
1820 | Nit: I'd say that the llvm.mlir.cast itself isn't legal, not the conversion. Actually, I'm not convinced we want to report an error from the pattern at all. There may be cases where a partial conversion is sufficient and the caller will deal with the remaining casts properly, yet we would have reported the error to the user by that time.... | |
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | ||
898 | Don't you also want to support memrefs? |
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | ||
---|---|---|
689 | Well it has to be named as "SomethingCast", as LLVM_CastOp already exists. Renamed to "DialectCast". | |
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp | ||
1820 | Good point. Removed the error reporting. | |
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | ||
898 | 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. |
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | ||
---|---|---|
898 | 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. |
Nit: drop "MLIR" from the def name, we are not using it in other operations (constant, undef)