[Mlir-commits] [mlir] [MLIR][XeGPU] XeVM lowering support for load_matrix/store_matrix (PR #162780)

Sang Ik Lee llvmlistbot at llvm.org
Fri Oct 10 14:02:10 PDT 2025


================
@@ -941,7 +941,7 @@ struct UnrollLoadMatrixOp : public UnrollPattern<xegpu::LoadMatrixOp> {
   LogicalResult matchAndRewrite(xegpu::LoadMatrixOp op,
                                 PatternRewriter &rewriter) const override {
     Location loc = op.getLoc();
-    VectorType valueTy = op.getType();
+    VectorType valueTy = llvm::dyn_cast<VectorType>(op.getType());
----------------
silee2 wrote:

What happens when `dyn_cast` fails? cast will fail if op.getType() is returns a scalar type.
Seems like the `if` check below, especially `!targetShape` is checking that. 
But would be better to return failure() here by checking `if (!valueTy)`.
And maybe put some comment like `scalars are not unrolled`.

https://github.com/llvm/llvm-project/pull/162780


More information about the Mlir-commits mailing list