[PATCH] D79246: [mlir][vector] set alignment when lowering transfer_read and transfer_write.

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 02:05:40 PDT 2020


ftynse added a comment.

> It now becomes evident it's better to specify target triple and data layout in llvm dialect.

It should be in the *->llvm conversion. However, the conversion is not very well structured for extension atm, and we would have to patch all *->llvm to take the data layout and forward it to the relevant palce.



================
Comment at: mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp:755
 
+static std::pair<LLVM::LLVMType, unsigned>
+getLLVMTypeAndAlignment(LLVMTypeConverter &typeConverter, Type type) {
----------------
We tend to use arguments passed by-reference to return extra results, or named structs.


================
Comment at: mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp:757
+getLLVMTypeAndAlignment(LLVMTypeConverter &typeConverter, Type type) {
+  auto toLLVMTy = [&](Type t) { return typeConverter.convertType(t); };
+  auto llvmType = toLLVMTy(type).template cast<LLVM::LLVMType>();
----------------
Type converter mail fail and return nullptr, what's the contract with this function on it? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79246





More information about the llvm-commits mailing list