This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Vector] Revisit VectorToSCF.
ClosedPublic

Authored by nicolasvasilache on Sep 4 2020, 8:49 AM.

Details

Summary

Vector to SCF conversion still had issues due to the interaction with the natural alignment derived by the LLVM data layout. One traditional workaround is to allocate aligned. However, this does not always work for vector sizes that are non-powers of 2.

This revision implements a more portable mechanism where the intermediate allocation is always a memref of elemental vector type. AllocOp is extended to use the natural LLVM DataLayout alignment for non-scalar types, when the alignment is not specified in the first place.

An integration test is added that exercises the transfer to scf.for + scalar lowering with a 5x5 transposition.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2020, 8:49 AM
nicolasvasilache requested review of this revision.Sep 4 2020, 8:49 AM
bkramer accepted this revision.Sep 7 2020, 1:44 AM

looks good

This revision is now accepted and ready to land.Sep 7 2020, 1:44 AM
This revision was landed with ongoing or failed builds.Sep 7 2020, 2:20 AM
This revision was automatically updated to reflect the committed changes.
rriddle added inline comments.Sep 7 2020, 3:35 AM
mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
600

Order of evaluation of function parameters is undefined until c++17, the parameters should be evaluated separately to ensure the output is deterministic.