Conv1DNwcWcfOp>>(target);
if (succeeded(windowedNhwc)) {
results.push_back(*windowedNhwc);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
FailureOr<LinalgOp> windowedNchw =
tryApply<DownscaleSizeOneWindowed2DConvolution<linalg::Conv2DNchwFchwOp,
Conv1DNcwFcwOp>>(target);
if (succeeded(windowedNchw)) {
results.push_back(*windowedNchw);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
FailureOr<LinalgOp> depthwise =
tryApply<DownscaleDepthwiseConv2DNhwcHwcOp>(target);
if (succeeded(depthwise)) {
results.push_back(*depthwise);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
results.assign(1, nullptr);
return emitDefaultSilenceableFailure(target);
return tileConsumerAndFuseProducerGreedilyUsingSCFForOp(
rewriter, tilingInterfaceOp, tileAndFuseOptions);
});
- return DiagnosedSilenceableFailure(result);
+ return failed(result) ? DiagnosedSilenceableFailure::definiteFailure()
+ : DiagnosedSilenceableFailure::success();
}
ParseResult transform::FuseOp::parse(OpAsmParser &parser,
// Exit early if no transformation is needed.
if (isa<GenericOp>(target)) {
results.push_back(target);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
FailureOr<LinalgOp> generic = tryApply<LinalgGeneralizationPattern>(target);
if (succeeded(generic)) {
results.push_back(generic->getOperation());
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
results.assign(1, nullptr);
return emitDefaultSilenceableFailure(target);
// Exit early if no transformation is needed.
if (interchangeVector.empty()) {
results.push_back(target);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
TrivialPatternRewriter rewriter(target->getContext());
FailureOr<GenericOp> res =
if (failed(res))
return DiagnosedSilenceableFailure::definiteFailure();
results.push_back(res->getOperation());
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
LogicalResult transform::InterchangeOp::verify() {
ArrayRef<Operation *> payloadOps = state.getPayloadOps(getTarget());
if (payloadOps.size() != 1) {
results.set(getResult().cast<OpResult>(), {});
- return DiagnosedSilenceableFailure(
- this->emitOpError("requires exactly one target handle"));
+ return emitDefiniteFailure("requires exactly one target handle");
}
SmallVector<Operation *> res;
payloadOps.front()->walk(matchFun);
results.set(getResult().cast<OpResult>(), res);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===---------------------------------------------------------------------===//
tryApply<LinalgPaddingPattern>(target, paddingOptions);
if (succeeded(result)) {
results.push_back(result->getOperation());
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
results.assign(1, nullptr);
promotionOptions = promotionOptions.setAlignment(*getAlignment());
if (failed(promoteSubviewsPrecondition(target, promotionOptions)))
- return DiagnosedSilenceableFailure(reportUnknownTransformError(target));
+ return emitDefaultDefiniteFailure(target);
TrivialPatternRewriter rewriter(target->getContext());
rewriter.setInsertionPoint(target);
FailureOr<LinalgOp> res = promoteSubViews(rewriter, target, promotionOptions);
if (failed(res))
- return DiagnosedSilenceableFailure(reportUnknownTransformError(target));
+ return emitDefaultDefiniteFailure(target);
results.push_back(target);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===----------------------------------------------------------------------===//
replacements.push_back(replacement);
}
transformResults.set(getReplacement().cast<OpResult>(), replacements);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
void transform::ReplaceOp::getEffects(
FailureOr<scf::SCFTilingResult> maybeTilingResult = tileUsingSCFForOp(
rewriter, cast<TilingInterface>(target.getOperation()), tilingOptions);
if (failed(maybeTilingResult))
- return DiagnosedSilenceableFailure(reportUnknownTransformError(target));
+ return emitDefaultDefiniteFailure(target);
results.append(maybeTilingResult->tiledOps);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===----------------------------------------------------------------------===//
? splitReductionByScaling(rewriter, target, splitFn, getUseAlloc())
: splitReduction(rewriter, target, splitFn, getUseAlloc());
if (failed(splitResult))
- return DiagnosedSilenceableFailure(reportUnknownTransformError(target));
+ return emitDefaultDefiniteFailure(target);
results.push_back(splitResult->initOrAlloc);
results.push_back(splitResult->fillOp);
results.push_back(splitResult->splitLinalgOp);
results.push_back(splitResult->resultCombiningLinalgOp);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===----------------------------------------------------------------------===//
sizes);
if (failed(result))
- return DiagnosedSilenceableFailure(reportUnknownTransformError(target));
+ return emitDefaultSilenceableFailure(target);
results.push_back(result->loops.front());
results.push_back(result->initialOp);
results.push_back(result->parallelTiledOp);
results.push_back(result->mergeOp);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===----------------------------------------------------------------------===//
results.push_back(result->initialOp);
results.push_back(result->parallelTiledOp);
results.push_back(result->mergeOp);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===----------------------------------------------------------------------===//
}
}
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
DiagnosedSilenceableFailure transform::tileToForeachThreadOpImpl(
ArrayRef<OpFoldResult> mixedTileSizes, Optional<ArrayAttr> mapping,
SmallVector<Operation *> &tileOps, SmallVector<Operation *> &tiledOps) {
if (targets.empty())
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
// getMixedNumThreads are OpFoldResults[index attributes or PDL operation].
// Convert to OpFoldResults[index attributes or payload op].
tileOps.push_back(tilingResult->tileOp);
tiledOps.push_back(tilingResult->tiledOp);
}
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
DiagnosedSilenceableFailure transform::TileToForeachThreadOp::apply(
transformResults.set(getForeachThreadOp().cast<OpResult>(), tileOps);
transformResults.set(getTiledOp().cast<OpResult>(), tiledOps);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
void transform::TileToForeachThreadOp::getEffects(
linalg::populatePadOpVectorizationPatterns(patterns);
if (failed(applyPatternsAndFoldGreedily(target, std::move(patterns))))
- return DiagnosedSilenceableFailure(reportUnknownTransformError(target));
+ return emitDefaultDefiniteFailure(target);
results.push_back(target);
- return DiagnosedSilenceableFailure(success());
+ return DiagnosedSilenceableFailure::success();
}
//===----------------------------------------------------------------------===//