This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Adjust matrix pointer type for inline asm arguments.
ClosedPublic

Authored by fhahn on Nov 17 2020, 7:23 AM.

Details

Summary

Matrix types in memory are represented as arrays, but accessed through
vector pointers, with the alignment specified on the access operation.

For inline assembly, update pointer arguments to use vector pointers.
Otherwise there will be a mis-match if the matrix is also an
input-argument which is represented as vector.

Diff Detail

Event Timeline

fhahn created this revision.Nov 17 2020, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2020, 7:23 AM
fhahn requested review of this revision.Nov 17 2020, 7:23 AM
fhahn removed rG LLVM Github Monorepo as the repository for this revision.
nickdesaulniers accepted this revision.Nov 17 2020, 9:21 AM
This revision is now accepted and ready to land.Nov 17 2020, 9:21 AM
fhahn added a comment.Nov 17 2020, 9:59 AM

There's still one remaining issue. The backend will still crash when the resulting vector does not fit into the target's vector register directly. But that's the same as with ext_vector_type I think. The snippet below should produce the same asm call as a float x 3 x 3 matrix.

using vec = float __attribute__((ext_vector_type(9)));
void f1 () {
    vec m;
    asm volatile("" : "+r,m"(m) : : "memory");
}
This revision was landed with ongoing or failed builds.Nov 18 2020, 3:44 AM
This revision was automatically updated to reflect the committed changes.