This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Fix miscompile for NT matmul if the transpose has other use
ClosedPublic

Authored by anemet on Jul 21 2021, 9:57 AM.

Details

Summary

We should only add the fake lowering entry for the matrix remark if the
transpose is not lowered on its own. MapVector::insert is used to insert
the entry during proper lowering which does not overwrite the fake entry in
the map.

We actually had test coverage for this but the reference output code was
wrong; it was storing undef rather than the transposed column.

Diff Detail

Event Timeline

anemet created this revision.Jul 21 2021, 9:57 AM
anemet requested review of this revision.Jul 21 2021, 9:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2021, 9:57 AM
fhahn accepted this revision.Jul 22 2021, 1:02 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jul 22 2021, 1:02 AM
This revision was landed with ongoing or failed builds.Jul 22 2021, 10:47 AM
This revision was automatically updated to reflect the committed changes.

In the committed version, I added a new assert that should have caught this.

MaskRay added inline comments.
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
1144

Hi, there was a -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build

Fixed by 3b181568db8efc30b79466bba4aa334f86a49877