This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Refine cost estimate for dot-product.
ClosedPublic

Authored by fhahn on Mar 31 2023, 7:38 AM.

Details

Summary

Adjust lowerDotProduct cost estimate to include the cost benefits of:

  • emitting a wide load
  • emitting a wide multiply.

Diff Detail

Event Timeline

fhahn created this revision.Mar 31 2023, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2023, 7:38 AM
fhahn requested review of this revision.Mar 31 2023, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2023, 7:38 AM
thegameg accepted this revision.Mar 31 2023, 9:51 AM

LGTM.

llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
1346
llvm/test/Transforms/LowerMatrixIntrinsics/dot-product-int.ll
260–318

Wonder which part made this go back, the cost of the mul maybe?

This revision is now accepted and ready to land.Mar 31 2023, 9:51 AM
fhahn updated this revision to Diff 513509.Apr 14 2023, 2:49 AM

Rebase and fix a crash. I am planning to land this soon.

fhahn marked 2 inline comments as done.Apr 14 2023, 3:02 AM
fhahn added inline comments.
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
1346

I adjusted the code slightly to include an estimate of the cost of embedding the columns into a vector, so we can compute valid costs for all cases. I removed that part.

llvm/test/Transforms/LowerMatrixIntrinsics/dot-product-int.ll
260–318

Yep, I think vector integer multiply doesn't support i64 elements on ARM64.

This revision was landed with ongoing or failed builds.Apr 14 2023, 3:35 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked 2 inline comments as done.