temp commit: i will soft-reset and recommit after next changes

This commit is contained in:
NiccoloN
2026-08-02 11:37:22 +02:00
parent f4a3b012cc
commit 893e90feac
43 changed files with 2159 additions and 2048 deletions
@@ -399,6 +399,42 @@ struct LowerSpatialPlansPass final : PassWrapper<LowerSpatialPlansPass, Operatio
rewriter.replaceOp(planOp, computeOp.getResults());
continue;
}
if (auto planOp = dyn_cast<spatial::SpatResizeNearestPlanOp>(&op)) {
FailureOr<RowStripPhysicalValue> input =
getRowStripValue(rowStripValues, planOp.getInput());
rewriter.setInsertionPoint(planOp);
auto lowered = lowerSelectedResizeNearestPlan(
planOp, succeeded(input) ? std::optional<Value>(input->storage) : std::nullopt,
rewriter);
if (failed(lowered)) {
planOp.emitOpError("failed to lower selected nearest Resize plan");
signalPassFailure();
return;
}
if (failed(input)) {
rewriter.replaceOp(planOp, *lowered);
continue;
}
auto outputBlueprint = llvm::find_if(planOp.getResult().getUsers(), [](Operation* user) {
auto blueprint = dyn_cast<spatial::SpatBlueprintOp>(user);
return blueprint && blueprint.getPhysicalLayout() == kRowStripLayout;
});
if (outputBlueprint == planOp.getResult().getUsers().end()) {
planOp.emitOpError("row-strip Resize plan requires a row-strip blueprint result");
signalPassFailure();
return;
}
auto blueprint = cast<spatial::SpatBlueprintOp>(*outputBlueprint);
auto output = buildRowStripValue(blueprint, *lowered);
if (failed(output)) {
signalPassFailure();
return;
}
rowStripValues[blueprint.getResult()] = *output;
eraseAfterLowering.insert(planOp);
eraseAfterLowering.insert(blueprint);
continue;
}
if (auto planOp = dyn_cast<spatial::SpatMaxPool2DPlanOp>(&op)) {
auto outputBlueprint = llvm::find_if(planOp.getResult().getUsers(), [](Operation* user) {
auto blueprint = dyn_cast<spatial::SpatBlueprintOp>(user);
@@ -701,6 +737,7 @@ struct LowerSpatialPlansPass final : PassWrapper<LowerSpatialPlansPass, Operatio
spatial::SpatAddPlanOp,
spatial::SpatReluPlanOp,
spatial::SpatSiluPlanOp,
spatial::SpatResizeNearestPlanOp,
spatial::SpatMaxPool2DPlanOp,
spatial::SpatGlobalAveragePoolPlanOp,
spatial::SpatMaterializeLayoutOp>(op)