This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Implement += and -= for MatrixType
ClosedPublic

Authored by SaurabhJha on Mar 5 2021, 1:12 PM.

Details

Summary

[Matrix] Implement += and -= for Matrix Type.

Bugzilla ticket is here https://bugs.llvm.org/show_bug.cgi?id=46164

Diff Detail

Event Timeline

SaurabhJha created this revision.Mar 5 2021, 1:12 PM
SaurabhJha requested review of this revision.Mar 5 2021, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2021, 1:12 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
SaurabhJha edited the summary of this revision. (Show Details)Mar 5 2021, 1:15 PM
SaurabhJha added a reviewer: fhahn.

Thanks for the patch! Could you also extend the Sema matrix-type-operators tests with checks for += & -=?

It looks like the handling for multiply is slightly different and already works but is missing test coverage. It would be great if you could also extend the tests to check for *=.

SaurabhJha updated this revision to Diff 328849.Mar 7 2021, 1:03 AM
SaurabhJha edited the summary of this revision. (Show Details)

Implement tests for *= for matrices code gen and add tests in Sema for compound assignments

Thanks for the patch! Could you also extend the Sema matrix-type-operators tests with checks for += & -=?

It looks like the handling for multiply is slightly different and already works but is missing test coverage. It would be great if you could also extend the tests to check for *=.

Thanks for the review. I have addressed your comments.

We don't need to add anything to CodeGenCXX/matrix-type-operators.cpp and SemaCXX/matrix-type-operators.cpp, right?

xbolva00 added inline comments.
clang/test/Sema/matrix-type-operators.c
22

+=?

SaurabhJha updated this revision to Diff 328850.Mar 7 2021, 1:38 AM

Fix mistake in Sema/matrix-type-operators.c's add test -= -> +=

SaurabhJha added inline comments.Mar 7 2021, 1:41 AM
clang/test/Sema/matrix-type-operators.c
22

Right, thanks for pointing it out, fixed.

fhahn accepted this revision.Mar 7 2021, 4:49 AM

LGTM, thanks!

This revision is now accepted and ready to land.Mar 7 2021, 4:49 AM
This revision was automatically updated to reflect the committed changes.