diff --git a/include/Dialect/VectorExt/VectorExtOps.td b/include/Dialect/VectorExt/VectorExtOps.td index e4c3e9629814..f807a4ad612c 100644 --- a/include/Dialect/VectorExt/VectorExtOps.td +++ b/include/Dialect/VectorExt/VectorExtOps.td @@ -20,7 +20,8 @@ class VectorExt_Op traits = []> : def VectorExt_PredicateOp : VectorExt_Op<"predicate", [DeclareOpInterfaceMethods, - SingleBlockImplicitTerminator<"vector_ext::YieldOp">, RecursiveSideEffects]> { + SingleBlockImplicitTerminator<"vector_ext::YieldOp">, + RecursiveMemoryEffects]> { let summary = "vector.predicate operation"; let description = [{ TODO }]; @@ -43,7 +44,7 @@ def VectorExt_PredicateOp : VectorExt_Op<"predicate", } def VectorExt_YieldOp : VectorExt_Op<"yield", [ - NoSideEffect, ReturnLike, Terminator]> { + NoMemoryEffect, ReturnLike, Terminator]> { let summary = "VectorExt yield op"; let description = [{ `vector_ext.yield` is a special terminator operation for blocks inside diff --git a/lib/Dialect/VectorExt/IR/VectorExtOps.cpp b/lib/Dialect/VectorExt/IR/VectorExtOps.cpp index 5fba2f6a92ea..6245cc17899d 100644 --- a/lib/Dialect/VectorExt/IR/VectorExtOps.cpp +++ b/lib/Dialect/VectorExt/IR/VectorExtOps.cpp @@ -28,7 +28,7 @@ void mlir::vector_ext::buildTerminatedBody(OpBuilder &builder, Location loc) { void PredicateOp::build(OpBuilder &builder, OperationState &result, Value predicateMask, ValueRange indices, Value incomingMask) { - build(builder, result, /*resultTypes=*/llvm::None, predicateMask, indices, + build(builder, result, /*resultTypes=*/std::nullopt, predicateMask, indices, incomingMask); } @@ -100,22 +100,22 @@ ParseResult mlir::vector_ext::PredicateOp::parse(OpAsmParser &parser, void mlir::vector_ext::PredicateOp::print(OpAsmPrinter &p) { bool printBlockTerminators = false; - p << "(" << predicateMask() << ", [" << indices() << "], " << incomingMask() - << ") : " << predicateMask().getType(); - if (!results().empty()) { + p << "(" << getPredicateMask() << ", [" << getIndices() << "], " + << getIncomingMask() << ") : " << getPredicateMask().getType(); + if (!getResults().empty()) { p << " -> (" << getResultTypes() << ")"; // Print yield explicitly if the op defines values. printBlockTerminators = true; } p << " "; - p.printRegion(truePredicateRegion(), + p.printRegion(getTruePredicateRegion(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printBlockTerminators); p.printOptionalAttrDict(getOperation()->getAttrs()); } -/// Given the region at `index`, or the parent operation if `index` is None, +/// Given the region at `index`, or the parent operation if `index` is nullopt, /// return the successor regions. These are the regions that may be selected /// during the flow of control. `operands` is a set of optional attributes that /// correspond to a constant value for each operand, or null if that operand is @@ -124,7 +124,7 @@ void PredicateOp::getSuccessorRegions( Optional index, ArrayRef operands, SmallVectorImpl ®ions) { // The `truePredicate` region branch back to the parent operation. - if (index.hasValue()) { + if (index.has_value()) { regions.push_back(RegionSuccessor(getResults())); return; } @@ -132,7 +132,7 @@ void PredicateOp::getSuccessorRegions( // The `truePredicate` (and the future `falsePredicate` region) will always // be executed regardless of the condition since they are not modeling control // but data flow. - regions.push_back(RegionSuccessor(&truePredicateRegion())); + regions.push_back(RegionSuccessor(&getTruePredicateRegion())); } #define GET_OP_CLASSES diff --git a/lib/Dialect/VectorExt/Transform/VectorMaskingUtils.cpp b/lib/Dialect/VectorExt/Transform/VectorMaskingUtils.cpp index 0e6959d290ec..46dd7c44b8cb 100644 --- a/lib/Dialect/VectorExt/Transform/VectorMaskingUtils.cpp +++ b/lib/Dialect/VectorExt/Transform/VectorMaskingUtils.cpp @@ -8,7 +8,7 @@ #include "Dialect/VectorExt/VectorMaskingUtils.h" #include "Dialect/VectorExt/VectorExtOps.h" -#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" +#include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/IR/AffineMap.h" @@ -77,7 +77,7 @@ Optional mlir::vector_ext::predicateOp( Optional maybeIncomingMask) { // TODO: Support multi-block regions. if (!regionToPredicate->hasOneBlock()) - return llvm::None; + return std::nullopt; // Compute the range of operations that will be moved within vector.predicate // and the definitions within the range with users outside the range. @@ -95,7 +95,7 @@ Optional mlir::vector_ext::predicateOp( builder.setInsertionPointToStart(&blockToPredicate); Value predicateMask = createPredicateMask(builder); if (!predicateMask) - return llvm::None; + return std::nullopt; // Generate the vector.predicate operation and move 'opsToMove' within its // truePredicateRegion. We have to rewire the def-use chain for those @@ -113,7 +113,7 @@ Optional mlir::vector_ext::predicateOp( en.value().replaceAllUsesWith(vecPredOp.getResult(en.index())); Operation *truePredTerminator = - &vecPredOp.truePredicateRegion().front().back(); + &vecPredOp.getTruePredicateRegion().front().back(); moveOperationsBefore(opsToMove, truePredTerminator); // The existing terminator of TruePredicateRegion doesn't yield any value. @@ -140,9 +140,9 @@ static void maskPredicateOp(OpBuilder &builder, PredicateOp predOp, // Actions before visiting the TruePredicateRegion: Generate the new active // mask (= predicate_mask & incoming_mask) influencing the region. if (stage.isBeforeAllRegions()) { - builder.setInsertionPointToStart(&predOp.truePredicateRegion().front()); + builder.setInsertionPointToStart(&predOp.getTruePredicateRegion().front()); Value trueMask = builder.create( - predOp.getLoc(), predOp.incomingMask(), predOp.predicateMask()); + predOp.getLoc(), predOp.getIncomingMask(), predOp.getPredicateMask()); activeMasks.push_back(trueMask); return; } @@ -167,7 +167,7 @@ static void maskPredicateOp(OpBuilder &builder, PredicateOp predOp, // Inline truePredicateRegion into parent op (except its terminator). // TODO: Move this to builder.inlineRegionBefore? - auto &blocksToMove = predOp.truePredicateRegion().getBlocks(); + auto &blocksToMove = predOp.getTruePredicateRegion().getBlocks(); assert(blocksToMove.size() == 1 && "Expected only one block"); assert(predOp.getResults().empty() && "TODO: Support vector.predicate with results"); diff --git a/third_party/iree b/third_party/iree index 853dd6ead922..badd598fafe5 160000 --- a/third_party/iree +++ b/third_party/iree @@ -1 +1 @@ -Subproject commit 853dd6ead922cc0115beddc3d74b88af8b437172 +Subproject commit badd598fafe56577d6c96cc132da75ea27af7d36