[Mlir-commits] [mlir] d80178f - [mlir] Change verification order to prevent null dereference
Tres Popp
llvmlistbot at llvm.org
Wed Apr 14 00:34:07 PDT 2021
Author: Tres Popp
Date: 2021-04-14T09:33:17+02:00
New Revision: d80178f7c1122469b539f0be3c57c3ee60eaedde
URL: https://github.com/llvm/llvm-project/commit/d80178f7c1122469b539f0be3c57c3ee60eaedde
DIFF: https://github.com/llvm/llvm-project/commit/d80178f7c1122469b539f0be3c57c3ee60eaedde.diff
LOG: [mlir] Change verification order to prevent null dereference
Differential Revision: https://reviews.llvm.org/D100390
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 3bb333cf786d4..2af0b361db4d2 100644
--- a/mlir/lib/Dialect/Vector/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
@@ -2556,13 +2556,13 @@ LogicalResult mlir::vector::splitFullAndPartialTransfer(
"Expected splitFullAndPartialTransferPrecondition to hold");
auto xferReadOp = dyn_cast<vector::TransferReadOp>(xferOp.getOperation());
- if (xferReadOp.mask())
- return failure();
-
// TODO: add support for write case.
if (!xferReadOp)
return failure();
+ if (xferReadOp.mask())
+ return failure();
+
OpBuilder::InsertionGuard guard(b);
if (Operation *sourceOp = xferOp.source().getDefiningOp())
b.setInsertionPointAfter(sourceOp);
More information about the Mlir-commits
mailing list