This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ArmSVE] Add basic arithmetic operations
ClosedPublic

Authored by jsetoain on Apr 20 2021, 3:33 AM.

Details

Summary

While we figure out how to best add Standard support for scalable
vectors, these instructions provide a workaround for basic arithmetic
between scalable vectors.

Diff Detail

Event Timeline

jsetoain created this revision.Apr 20 2021, 3:33 AM
jsetoain requested review of this revision.Apr 20 2021, 3:33 AM

Is there an integration test running on some simulator that could be added in the future (similar to what we have for AVX512 and AMX) ?

This revision is now accepted and ready to land.Apr 23 2021, 12:53 AM
ftynse added inline comments.Apr 23 2021, 4:07 AM
mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td
286–290

We shouldn't be needing this if assemblyFormat is used.

487–493

Nit: I wonder if it isn't simpler to define a ScalableFPOp class and factor out all common parts (arguments, results, assembly format, traits) into it so that concrete classes only need name + doc.

mlir/lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp
49–55

Please add tests for user-visible error messages.

mlir/test/Dialect/ArmSVE/legalize-for-llvm.mlir
48

Could we also check the converted type at least once?

aartbik added inline comments.Apr 23 2021, 9:41 AM
mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td
329

sub commutative?

353

same

425

div commutative?

449

same

473

same

jsetoain updated this revision to Diff 340137.Apr 23 2021, 12:19 PM
jsetoain marked 9 inline comments as done.

Address comments

mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td
329

Yes, I noticed while refactoring. Too much auto-pilot :-/

487–493

Is this alright or did I over do it? I'm happy to move the summary and description back to each definition if this is too much.

mlir/lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp
49–55

I've dropped this part of the change, it's going to require more than this to avoid the assert, I'd rather move it to its own patch.

Is there an integration test running on some simulator that could be added in the future (similar to what we have for AVX512 and AMX) ?

I believe we can use qemu, but I wouldn't know how to write the CI test. I'll ask around just in case it already exists, otherwise I'll need some time to look into it.

I can't land revisions myself, if nobody else has any issues with the patch, please do that when ready. Thanks!

Matt added a subscriber: Matt.May 3 2021, 5:38 AM
This revision was automatically updated to reflect the committed changes.
ftynse added a comment.May 5 2021, 1:00 AM

@jsetoain I can land this for you.

I've done this already.