This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Adapt subview legalization to the updated op semantics.
ClosedPublic

Authored by mravishankar on May 19 2020, 10:40 PM.

Details

Summary

The subview semantics changes recently to allow for more natural
representation of constant offsets and strides. The legalization of
subview op for lowering to SPIR-V needs to account for this.
Also change the linearization to use the strides from the affine map
of a memref.

Diff Detail

Event Timeline

mravishankar created this revision.May 19 2020, 10:40 PM
nicolasvasilache accepted this revision.May 20 2020, 3:30 AM
nicolasvasilache added inline comments.
mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
73

since this pattern is likely to repeat itself more and more, how about adding getOrCreateOffset/Size/StrideValue to the core op?

This revision is now accepted and ready to land.May 20 2020, 3:30 AM

Addressing comments.

@nicolasvasilache PTAL again after changes to the SubViewOp to add the methods to get offsets/size/strides.

antiagainst accepted this revision.May 20 2020, 12:00 PM
This revision was automatically updated to reflect the committed changes.
rriddle added inline comments.May 27 2020, 1:51 PM
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
2559

nit: Don't use else after a return.

2571

Same here and below.