Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MaheshRavishankar authored Aug 29, 2024
1 parent e6ff0b9 commit 0d196cd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ class TileConsumerAndFuseInputProducer final
auto tilingOp = sliceOp.getSource().getDefiningOp<TilingInterface>();
if (!tilingOp)
continue;
if (isa<tensor::PadOp>(sliceOp.getSource().getDefiningOp())) {
continue;
}
// Restrict to fully parallel ops for now for simplicity.
auto isParallel = [](utils::IteratorType it) {
return linalg::isParallelIterator(it);
Expand Down
15 changes: 11 additions & 4 deletions compiler/src/iree/compiler/Codegen/Common/GPU/GPUTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,18 @@ static LogicalResult tileAndDistributeToThreads(TilingInterface consumerOp,
IRRewriter rewriter(context);
SmallVector<OpFoldResult> tileSizesOfr =
getAsIndexOpFoldResult(context, tileSizes);
scf::SCFTilingOptions tilingOptions;
tilingOptions.setTileSizes(tileSizesOfr);
scf::SCFTileAndFuseOptions tileAndFuseOptions;
tileAndFuseOptions.setTilingOptions(tilingOptions);
tileAndFuseOptions.setFusionControlFn(
[](tensor::ExtractSliceOp sliceOp, OpResult origProducer,
bool isDestinationOperand) -> std::tuple<bool, bool> {
return {!isa<tensor::PadOp>(origProducer.getOwner()), false};
});
FailureOr<scf::SCFTileAndFuseResult> tileAndFuseResult =
scf::tileConsumerAndFuseProducersUsingSCF(
rewriter, consumerOp,
scf::SCFTileAndFuseOptions().setTilingOptions(
scf::SCFTilingOptions().setTileSizes(tileSizesOfr)));
scf::tileConsumerAndFuseProducersUsingSCF(rewriter, consumerOp,
tileAndFuseOptions);

if (failed(tileAndFuseResult)) {
return consumerOp.emitOpError("failed tiling and fusing producers");
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/Codegen/LLVMCPU/DispatchABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ HALDispatchABI::buildScopeAttr(mlir::ModuleOp moduleOp,
/*scopeline=*/1,
LLVM::DISubprogramFlags::Definition |
LLVM::DISubprogramFlags::Optimized,
subroutineTypeAttr);
subroutineTypeAttr, /*retainedNodes =*/{});
}

// Returns the most local DISubprogramAttr starting from |forOp|.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ LogicalResult applyTileAndFuse(RewriterBase &rewriter, Operation *rootOp,
// Traverse the slices in BFS fashion.
tensor::ExtractSliceOp candidateSliceOp = candidates.front();
candidates.pop_front();
if (candidateSliceOp.getSource().getDefiningOp<tensor::PadOp>()) {
continue;
}

// Materialize the slice of the producer in place.
std::optional<scf::SCFFuseProducerOfSliceResult> fusedProducer =
Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
Submodule llvm-project updated 1236 files

0 comments on commit 0d196cd

Please sign in to comment.