Rationale:
Make sure preconditions are tested already during verfication.
Currently, the only way a sparse rewriting rule can fail is if
(1) the linalg op does not have sparse annotations, or
(2) a yet to be handled operation is encounted inside the op
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp | ||
---|---|---|
837 | The return failure() denotes to the calling method that the rewriting rule has failed (did not apply), but it is not an error condition. I have replaced that with an assert since we now verify that much earlier, and we should never encounter that condition anymore | |
862 | Yes, just like above. We verify that earlier now, so the rewriting rule always applies to something with sparse annotations that passed the verifier. |
Question please. How do you choose between return failure(); and assert()?
The old code return failure(); for op.getNumOutputs() != 1 before.