This is an archive of the discontinued LLVM Phabricator instance.

Fix a corner case in vector.shape_cast when the trailing dimensions are of size 1.
ClosedPublic

Authored by whchung on Jun 22 2020, 7:57 AM.

Details

Summary

Fix a corner case in vector.shape_cast when the trailing dimensions are of size 1.

Diff Detail

Event Timeline

whchung created this revision.Jun 22 2020, 7:57 AM
aartbik added inline comments.Jun 22 2020, 12:23 PM
mlir/lib/Dialect/Vector/VectorOps.cpp
1633

I find the * followed by / hard to read. Can we
(1) add comments on what we are doing here
(2) find better logic that tests before doing the * and canceling /?

whchung updated this revision to Diff 272521.Jun 22 2020, 12:50 PM

Address code review comments.

whchung marked 2 inline comments as done.Jun 22 2020, 12:51 PM
whchung added inline comments.
mlir/lib/Dialect/Vector/VectorOps.cpp
1633

@aartbik Thanks. I revised the logic and added comments.

nicolasvasilache requested changes to this revision.Jun 22 2020, 1:32 PM
nicolasvasilache added inline comments.
mlir/lib/Dialect/Vector/VectorOps.cpp
1636

Hmm looks like this could fail if both a and b have trailing ones since only j makes progress and the late i == rankA check will later fail?

How about explicitly checking for llvm::all_of(a... ) and llvm::all_of(b... ) are 1 ?

This revision now requires changes to proceed.Jun 22 2020, 1:32 PM
whchung updated this revision to Diff 272542.Jun 22 2020, 2:33 PM
whchung marked an inline comment as done.

Address review comments by improve logic.

whchung marked 2 inline comments as done.Jun 22 2020, 2:34 PM
whchung added a subscriber: nicholas.
whchung added inline comments.
mlir/lib/Dialect/Vector/VectorOps.cpp
1636

@nicholas Thanks for catching this. Revised the logic.

whchung retitled this revision from Fix a corner case in vector.shape_cast when the last dimension is of size 1. to Fix a corner case in vector.shape_cast when the trailing dimensions are of size 1..Jun 22 2020, 2:35 PM
whchung edited the summary of this revision. (Show Details)
whchung updated this revision to Diff 272545.Jun 22 2020, 2:36 PM
whchung marked an inline comment as done.

Update commit message.

whchung updated this revision to Diff 272547.Jun 22 2020, 2:49 PM

Remove an empty line.

nicolasvasilache accepted this revision.Jun 22 2020, 3:30 PM
This revision is now accepted and ready to land.Jun 22 2020, 3:30 PM
Harbormaster failed remote builds in B61300: Diff 272545!
Harbormaster failed remote builds in B61302: Diff 272547!
aartbik accepted this revision.Jun 22 2020, 4:30 PM
This revision was automatically updated to reflect the committed changes.