[mlir][Vector] Relax condition for `splitFullAndPartialTransferPrecondition`

The `splitFullAndPartialTransferPrecondition` has a restrictive condition to
prevent the pattern to be applied recursively if it is nested under an scf.IfOp.
Relaxing the condition to the immediate parent op must not be an scf.IfOp lets
the pattern be applied more generally while still preventing recursion.

Differential Revision: https://reviews.llvm.org/D85209
This commit is contained in:
Nicolas Vasilache 2020-08-04 09:49:32 -04:00
parent 860cbbdd6b
commit 2d0b05969b
1 changed files with 4 additions and 4 deletions

View File

@ -2049,10 +2049,10 @@ LogicalResult mlir::vector::splitFullAndPartialTransferPrecondition(
// Must have some masked dimension to be a candidate for splitting.
if (!xferOp.hasMaskedDim())
return failure();
// Don't split transfer operations under IfOp, this avoids applying the
// pattern recursively.
// TODO: improve the condition to make it more applicable.
if (xferOp.getParentOfType<scf::IfOp>())
// Don't split transfer operations directly under IfOp, this avoids applying
// the pattern recursively.
// TODO: improve the filtering condition to make it more applicable.
if (isa<scf::IfOp>(xferOp.getOperation()->getParentOp()))
return failure();
return success();
}