This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Arith] Remove unused assertions
ClosedPublic

Authored by Miss_Grape on Dec 22 2022, 11:06 PM.

Details

Summary

We shouldn't be checking things that are guaranteed by the op's verifier.

Diff Detail

Event Timeline

Miss_Grape created this revision.Dec 22 2022, 11:06 PM
Miss_Grape requested review of this revision.Dec 22 2022, 11:06 PM
This revision is now accepted and ready to land.Dec 22 2022, 11:49 PM
This revision was automatically updated to reflect the committed changes.
ftynse added a subscriber: ftynse.Dec 28 2022, 5:32 AM

This change feels contrary to the LLVM developer guide - https://llvm.org/docs/CodingStandards.html#assert-liberally. There are plenty of places in MLIR where we assert things already checked by the verifier, for the very simple reason: verifiers are not set in stone. A change in op structure can easily lead to verifiers changing and these asserts suddenly become useful. Simple examples for these ops specifically; we may want min/max of an arbitrary number of operands rather than just two.

Please revert.

If you think this change is desired, please make a better case for that and request review from people with the history of contributions to this part of the code.