Skip to content

Commit e053be1

Browse files
committed
Fix dynamic stride compute issue and add test case.
1 parent a79bd40 commit e053be1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ translateStoreXeGPUCacheHint(std::optional<xegpu::CachePolicy> L1hint,
143143
}
144144

145145
// Compute the product of sizes in the range [lo, hi) from the sizes array.
146-
// Note: all sizes are i64.
147146
static Value getProductOfSizes(ConversionPatternRewriter &rewriter,
148147
Location loc, ArrayRef<OpFoldResult> sizes,
149148
size_t lo, size_t hi) {
@@ -152,6 +151,8 @@ static Value getProductOfSizes(ConversionPatternRewriter &rewriter,
152151
for (size_t idx = lo; idx < hi; idx++) {
153152
OpFoldResult ofr = sizes[idx];
154153
Value sizeVal = getValueOrCreateConstantIntOp(rewriter, loc, ofr);
154+
sizeVal = getValueOrCreateCastToIndexLike(rewriter, loc,
155+
rewriter.getI64Type(), sizeVal);
155156
product = rewriter.createOrFold<arith::MulIOp>(loc, product, sizeVal);
156157
}
157158
return product;

0 commit comments

Comments
 (0)