This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector][avx512] move avx512 lowering pass into general vector lowering
ClosedPublic

Authored by aartbik on Dec 3 2020, 3:36 PM.

Details

Summary

A separate AVX512 lowering pass does not compose well with the regular
vector lowering pass. As such, it is at risk of code duplication and
lowering inconsistencies. This change removes the separate AVX512 lowering
pass and makes it an "option" in the regular vector lowering pass
(viz. vector dialect "augmented" with AVX512 dialect).

Diff Detail

Event Timeline

aartbik created this revision.Dec 3 2020, 3:36 PM
aartbik requested review of this revision.Dec 3 2020, 3:36 PM
rriddle accepted this revision.Dec 3 2020, 3:41 PM
rriddle added inline comments.
mlir/include/mlir/Conversion/Passes.td
403

nit: Add a space after the comma

410–414

nit: Wrap these at 80 characters.

mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
1590

Can we move this out to a new file ConvertVectorToLLVMPass.cpp so that this file doesn't need to start depending on other dialects?

This revision is now accepted and ready to land.Dec 3 2020, 3:41 PM
rriddle added inline comments.Dec 3 2020, 3:45 PM
mlir/include/mlir/Conversion/Passes.td
390

Could you(in a followup is fine) add a proper description for this pass?

aartbik marked 4 inline comments as done.Dec 3 2020, 4:17 PM
aartbik added inline comments.
mlir/include/mlir/Conversion/Passes.td
390

Good idea. Might as well make a start with that here :-)

mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
1590

Yes, excellent idea. That allows for a cleaner separation of that tasks. Thanks.

aartbik edited the summary of this revision. (Show Details)Dec 3 2020, 4:26 PM
aartbik updated this revision to Diff 309402.Dec 3 2020, 4:30 PM
aartbik marked 2 inline comments as done.

addressed reviewer's feedback

Great, thanks for refactoring this!

bondhugula added inline comments.
mlir/include/mlir/Conversion/Passes.td
414

Nit: Augments the vector dialect ... isn't really accurate here. Instead:

Enables the use of AVX512 dialect while lowering the vector dialect.

mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h
31

setEnable -> enable ?

35

setEnable -> enable?

aartbik marked 3 inline comments as done.Dec 4 2020, 8:47 AM

Thanks!

mlir/include/mlir/Conversion/Passes.td
414

I thought this phrasing was okay, but I will send a follow up CL with your suggestion

mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h
31

Agreed, this is perhaps becoming a bit too verbose
(I used the "set" since it sets it to either true/false, but using enable verb wise is indeed better)