This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by nicolasvasilache on Apr 7 2020, 8:35 PM.

Details

Summary

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.

Diff Detail

Event Timeline

Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript

Make test more legible.

aartbik accepted this revision.Apr 9 2020, 11:26 AM
aartbik added inline comments.
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
788

this was of course already there before you moved, but it just caught my eye

I am guessing we are doing this to avoid compiler errors in non-debug mode (successStrides not used) . Are there any plans to make the compiler smarter about uses in asserts? It seems a bit strange to add code like this just to suppress those?

This revision was not accepted when it landed; it landed in state Needs Review.Apr 9 2020, 1:20 PM
This revision was automatically updated to reflect the committed changes.
nicolasvasilache marked an inline comment as done.