File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
mlir/lib/Dialect/XeGPU/Transforms Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,10 @@ XeGPUInstructionlizePass::getTileShape(Operation *op) const {
164164
165165 return SmallVector<int64_t >({(*aTile)[0 ], (*aTile)[1 ], (*bTile)[1 ]});
166166 }
167+
168+ if (OpTrait::hasElementwiseMappableTraits (op) && op->getNumResults () == 1 )
169+ return getTileShape (op->getOpResult (0 ));
170+
167171 return std::nullopt ;
168172}
169173
@@ -230,7 +234,14 @@ void XeGPUInstructionlizePass::runOnOperation() {
230234 });
231235
232236 RewritePatternSet patterns (ctx);
237+
238+ vector::UnrollVectorOptions vectorOptions;
239+ // vectorOptions.setNativeShapeFn([&](Operation *op) { return getTileShape(op); });
240+ vectorOptions.setNativeShapeFn (options.nativeShape );
241+
233242 populateXeGPUUnrollPatterns (patterns, options);
243+ vector::populateVectorUnrollPatterns (patterns, vectorOptions);
244+
234245 (void )applyPatternsGreedily (mod, std::move (patterns));
235246
236247 mod->walk ([&](Operation *op) {
You can’t perform that action at this time.
0 commit comments