Skip to content

Commit

Permalink
Remove revert for llvm/llvm-project#120115 (#19567)
Browse files Browse the repository at this point in the history
  • Loading branch information
Groverkss authored Dec 27, 2024
1 parent f1e1866 commit d746a57
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void tileNonPackedDimsFor3DPackOps(RewriterBase &rewriter,
FailureOr<scf::SCFTilingResult> tilingResult =
scf::tileUsingSCF(rewriter, tilingInterfaceOp, options);
assert(succeeded(tilingResult));
rewriter.replaceOp(packOp, tilingResult->replacements);
rewriter.replaceOp(packOp, tilingResult->mergeResult.replacements);
});
}

Expand Down Expand Up @@ -110,7 +110,7 @@ static void tileNonPackedDimsFor5DPUnpackOps(RewriterBase &rewriter,
FailureOr<scf::SCFTilingResult> tilingResult =
scf::tileUsingSCF(rewriter, tilingInterfaceOp, options);
assert(succeeded(tilingResult));
rewriter.replaceOp(unpackOp, tilingResult->replacements);
rewriter.replaceOp(unpackOp, tilingResult->mergeResult.replacements);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static LogicalResult commonRunOnOperation(
unpackTilingOptions);
if (failed(tilingResult))
return WalkResult::interrupt();
rewriter.replaceOp(op, tilingResult->replacements);
rewriter.replaceOp(op, tilingResult->mergeResult.replacements);
return WalkResult::advance();
});
if (status.wasInterrupted()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TileConsumerAndFuseInputProducer final
}

// Replace the tiled op with replacements.
rewriter.replaceOp(op, tilingResult->replacements);
rewriter.replaceOp(op, tilingResult->mergeResult.replacements);
filter.replaceLinalgTransformationFilter(rewriter,
tilingResult->tiledOps.front());

Expand Down Expand Up @@ -292,7 +292,7 @@ static LogicalResult tileParallelDims(mlir::FunctionOpInterface funcOp,
if (failed(tilingResult)) {
return tilingOp->emitOpError("failed to tile to scf.forall");
}
rewriter.replaceOp(tilingOp, tilingResult->replacements);
rewriter.replaceOp(tilingOp, tilingResult->mergeResult.replacements);
}
return success();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ static LogicalResult tileReduction(linalg::LinalgOp op) {
sizes.push_back(rewriter.getIndexAttr(size));
}
rewriter.setInsertionPoint(op);
FailureOr<scf::SCFReductionTilingResult> results = scf::tileReductionUsingScf(
FailureOr<scf::SCFTilingResult> results = scf::tileReductionUsingScf(
rewriter, cast<PartialReductionOpInterface>(op.getOperation()), sizes);
if (failed(results))
return failure();
rewriter.replaceOp(op, results->mergeResult.replacements);
return success();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ dropScalabilityFromUnsupportedOperations(mlir::FunctionOpInterface funcOp,
setLoweringConfig(newOp, newLoweringConfig);
}

rewriter.replaceOp(tilingOp, tilingResult->replacements);
rewriter.replaceOp(tilingOp, tilingResult->mergeResult.replacements);
}
return success();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ LogicalResult splitReductionImpl(Operation *op, int64_t size,
LLVM_DEBUG(llvm::dbgs() << "failed on step 1 (SCFTiling)\n");
return failure();
}
rewriter.replaceOp(linalgOp, tileResFirst->replacements);
rewriter.replaceOp(linalgOp, tileResFirst->mergeResult.replacements);

// 2) Apply splitReduction on the single vector-length array.
// splitReduction already replaces the op.
Expand All @@ -159,7 +159,8 @@ LogicalResult splitReductionImpl(Operation *op, int64_t size,
LLVM_DEBUG(llvm::dbgs() << "failed on step 3 (SCFTiling)\n");
return failure();
}
rewriter.replaceOp(splitRes->splitLinalgOp, tileRes->replacements);
rewriter.replaceOp(splitRes->splitLinalgOp,
tileRes->mergeResult.replacements);
return success();
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/Codegen/LLVMCPU/LLVMCPUTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void LLVMCPUTilePass::runOnOperation() {
scf::tileUsingSCF(rewriter, op, options);
if (failed(tiledResults))
continue;
rewriter.replaceOp(op, tiledResults->replacements);
rewriter.replaceOp(op, tiledResults->mergeResult.replacements);
}

RewritePatternSet patterns =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ LogicalResult tileLinalgOpsWithFilter(mlir::FunctionOpInterface funcOp,
for (auto tiledOp : tiledResults->tiledOps) {
filter.replaceLinalgTransformationFilter(rewriter, tiledOp);
}
rewriter.replaceOp(op, tiledResults->replacements);
rewriter.replaceOp(op, tiledResults->mergeResult.replacements);
}

return success();
Expand Down

0 comments on commit d746a57

Please sign in to comment.