[PATCH] D77703: [mlir][Vector] Add lowering of 1-D vector transfer_read/write to masked load/store

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 20:41:33 PDT 2020


nicolasvasilache created this revision.
Herald added subscribers: llvm-commits, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: rriddle.
Herald added a reviewer: aartbik.
Herald added a project: LLVM.

This revision adds support to lower 1-D vector transfers to LLVM.
A mask of the vector length is created that compares the base offset + linear index to the dim of the vector.
In each position where this does not overflow (i.e. offset + vector index < dim), the mask is set to 1.

A notable fact is that the lowering uses llvm.dialect_cast to allow writing code in the simplest form by targeting the simplest mix of vector and LLVM dialects and
letting other conversions kick in.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77703

Files:
  mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
  mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
  mlir/include/mlir/IR/Builders.h
  mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
  mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
  mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
  mlir/lib/IR/Builders.cpp
  mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77703.255884.patch
Type: text/x-patch
Size: 23308 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200408/6d2cd3b2/attachment.bin>


More information about the llvm-commits mailing list