Skip to content

Commit

Permalink
[CPU] Add shape cast lowering to LLVMCPUMmt4dVectorLowering (iree-org…
Browse files Browse the repository at this point in the history
…#13874)

We missed the 'vector.shape_cast' lowering patterns in LLVMCPUMmt4dVectorLowering.
  • Loading branch information
dcaballe authored and nhasabni committed Aug 24, 2023
1 parent 223ce65 commit 99fe7c6
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ void LLVMCPUMmt4dVectorLoweringPass::runOnOperation() {
return signalPassFailure();
}
}

// 'vector.shape_cast' are very expensive operations that are even generated
// by some of the lowerings above (e.g., flatten transfer ops). There are
// chances to cancel them out if they are not lowered too early so we lower
// them at the very end of the pass.
{
RewritePatternSet patterns(&getContext());
vector::populateVectorShapeCastLoweringPatterns(patterns);
(void)applyPatternsAndFoldGreedily(funcOp, std::move(patterns));
}
}

std::unique_ptr<OperationPass<func::FuncOp>>
Expand Down

0 comments on commit 99fe7c6

Please sign in to comment.