Skip to content

Commit

Permalink
[mlir] Migrate vector-to-loops.mlir to ProgressiveVectorToSCF
Browse files Browse the repository at this point in the history
Create a copy of vector-to-loops.mlir and adapt the test for
ProgressiveVectorToSCF. Fix a small bug in getExtractOp() triggered by
this test.

Differential Revision: https://reviews.llvm.org/D102388
  • Loading branch information
matthias-springer committed May 13, 2021
1 parent 2b20dee commit d020dd2
Show file tree
Hide file tree
Showing 2 changed files with 470 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mlir/lib/Conversion/VectorToSCF/ProgressiveVectorToSCF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,9 @@ struct UnrollTransferWriteConversion

/// If the input of the given TransferWriteOp is an ExtractOp, return it.
vector::ExtractOp getExtractOp(TransferWriteOp xferOp) const {
return dyn_cast<vector::ExtractOp>(xferOp.vector().getDefiningOp());
if (auto *op = xferOp.vector().getDefiningOp())
return dyn_cast<vector::ExtractOp>(op);
return vector::ExtractOp();
}

/// If the input of the given TransferWriteOp is an ExtractOp, return its
Expand Down
Loading

0 comments on commit d020dd2

Please sign in to comment.