Skip to content

Commit bc69a8d

Browse files
committed
check in elemwise support
1 parent 6ec3604 commit bc69a8d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mlir/lib/Dialect/XeGPU/Transforms/XeGPUInstructionlize.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)