[Mlir-commits] [mlir] 2d0b059 - [mlir][Vector] Relax condition for `splitFullAndPartialTransferPrecondition`

Nicolas Vasilache llvmlistbot at llvm.org
Tue Aug 4 07:07:18 PDT 2020


Author: Nicolas Vasilache
Date: 2020-08-04T10:06:21-04:00
New Revision: 2d0b05969bc01a2fda14b8dc3e8c26c81efe9c6f

URL: https://github.com/llvm/llvm-project/commit/2d0b05969bc01a2fda14b8dc3e8c26c81efe9c6f
DIFF: https://github.com/llvm/llvm-project/commit/2d0b05969bc01a2fda14b8dc3e8c26c81efe9c6f.diff

LOG: [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

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/VectorTransforms.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
index 3c23c5a6d869..33fbed65ace6 100644
--- a/mlir/lib/Dialect/Vector/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
@@ -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();
 }


        


More information about the Mlir-commits mailing list