Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ bool mlir::linalg::detail::isContractionBody(
Value contributed = getSourceSkipUnary(
isa<BlockArgument>(reductionLHS) ? reductionRHS : reductionLHS);
Operation *elementwiseOp = contributed.getDefiningOp();
if (elementwiseOp->getNumResults() != 1 ||
if (!elementwiseOp || elementwiseOp->getNumResults() != 1 ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide a minimal test for this?

Copy link
Author

@BRUCE11111 BRUCE11111 Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi~ Added to existing test for testing this method. This test can reproduce the problem of the current method.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello~ Could you please help me to approve this PR? Thanks~

elementwiseOp->getNumOperands() != 2) {
errs << "expected elementwise op to be binary";
return false;
Expand Down