Skip to content

Commit 2234d6c

Browse files
committed
dyn_cast DestinationStyleOpInterface and early return
1 parent 9ed6be8 commit 2234d6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,11 @@ tileAndFuseFirstExtractUse(RewriterBase &rewriter, Diagnostic &diag,
997997
// Iterate over the outputs of the producer and over the loop bbArgs and
998998
// check if any bbArg points to the same value as the producer output. In
999999
// such case, make the producer output point to the bbArg directly.
1000-
for (OpOperand &initOperandPtr :
1001-
cast<DestinationStyleOpInterface>(clone).getDpsInitsMutable()) {
1000+
auto dpsInterface = dyn_cast<DestinationStyleOpInterface>(clone);
1001+
if (!dpsInterface)
1002+
return;
1003+
1004+
for (OpOperand &initOperandPtr : dpsInterface.getDpsInitsMutable()) {
10021005
Value producerOperand =
10031006
clone->getOperand(initOperandPtr.getOperandNumber());
10041007
for (BlockArgument containerIterArg :

0 commit comments

Comments
 (0)