Skip to content

Commit

Permalink
[CodeGen] Remove IREE folding patterns from ConcretizePadResultShape. (
Browse files Browse the repository at this point in the history
…#14408)

The patterns are expected to be used right after distribution. User should call them explicitly, not including them in the pass.

Fixes #14406
  • Loading branch information
hanhanW authored Jul 14, 2023
1 parent dfb2e29 commit 49335b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ void populateConcretizePadResultShapePatterns(RewritePatternSet &patterns,
// Pulling in upstream scf.for and affine.min canonicalization patterns.
// They work on tiled (but not distributed) loops.
scf::populateSCFForLoopCanonicalizationPatterns(patterns);
// Pulling in IREE scf.for and affine.min canonicalization patterns.
// They work on tiled and distributed loops.
populateFoldAffineMinInDistributedLoopsPatterns(patterns, numWorkgroups);
// Pulling in flow.dispatch.tensor.load op canonicalization patterns.
// Tiling can generate dim ops taking them as operands.
IREE::Flow::DispatchTensorLoadOp::getCanonicalizationPatterns(patterns,
Expand Down
1 change: 1 addition & 0 deletions compiler/src/iree/compiler/Codegen/SPIRV/SPIRVTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ static void concretizePadShape(func::FuncOp funcOp) {
RewritePatternSet patterns(context);
SmallVector<int64_t> numWorkgroups = getStaticNumWorkgroups(funcOp);
populateConcretizePadResultShapePatterns(patterns, numWorkgroups);
populateFoldAffineMinInDistributedLoopsPatterns(patterns, numWorkgroups);
(void)applyPatternsAndFoldGreedily(funcOp, std::move(patterns));

LLVM_DEBUG({
Expand Down

0 comments on commit 49335b7

Please sign in to comment.