This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] minor cleanup of merger unit test
ClosedPublic

Authored by aartbik on Aug 7 2023, 2:03 PM.

Details

Summary

Removed some of the warning supression needed for
the multi-arg macro logic by making number of arguments
the same everywhere. Also removes some verbose comments
and obvious TODOs.

Diff Detail

Event Timeline

aartbik created this revision.Aug 7 2023, 2:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 2:03 PM
aartbik requested review of this revision.Aug 7 2023, 2:03 PM
wrengr added inline comments.Aug 7 2023, 2:08 PM
mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
496

Why not call this UNUSED instead? (ditto for the other macros below)

aartbik marked an inline comment as done.Aug 7 2023, 2:10 PM
aartbik added inline comments.
mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
496

sgtm

aartbik updated this revision to Diff 547941.Aug 7 2023, 2:11 PM
aartbik marked an inline comment as done.

UNUSED instead of DROP_EXTRA

wrengr added inline comments.Aug 7 2023, 2:15 PM
mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
520

Since the only place that uses the extra argument to FOREVERY_COMMON_{DISJ,CONJ}_BINOP is the definition of the macros FOREVERY_PAIR_OF_COMMON_{DISJ,CONJ}_DISJ_BINOP, I think it'd be a bit cleaner to do something like the following:

define FOREVERY_COMMON_X_BINOP_EXTRA(TEST, EXTRA) ...
define FOREVERY_COMMON_X_BINOP(TEST) \
    FOREVERY_COMMON_X_BINOP_EXTRA(TEST, "")

and then use the former for defining the other macros, and use the latter throughout the file. That way you don't need to explicitly pass the empty string every time

wrengr accepted this revision.Aug 7 2023, 2:16 PM

lgtm, once you do the FOREVERY_COMMON_X_BINOP{_EXTRA,} split to help DRY the uses

This revision is now accepted and ready to land.Aug 7 2023, 2:16 PM
aartbik updated this revision to Diff 547948.Aug 7 2023, 2:29 PM

less strings, more macros

This revision was landed with ongoing or failed builds.Aug 7 2023, 2:54 PM
This revision was automatically updated to reflect the committed changes.