[Mlir-commits] [mlir] [MLIR][XeVM] Update HandleVectorExtractPattern (PR #186247)
Jianhui Li
llvmlistbot at llvm.org
Wed Mar 18 11:50:46 PDT 2026
================
@@ -1122,15 +891,27 @@ class AllocaToGlobalPattern : public OpConversionPattern<LLVM::AllocaOp> {
}
};
+// Checks if shufflevector is used as a way to extract a contiguous slice
+// from a vector.
+// - source vector V1 and V2 are the same vector.
+// - mask size is not greater than the source vector size
+// - mask values represent a sequence of consecutive increasing numbers
+// that stay in bounds of the source vector when used for indexing.
static bool isExtractingContiguousSlice(LLVM::ShuffleVectorOp op) {
if (op.getV1() != op.getV2())
return false;
auto maskAttr = op.getMask();
+ int64_t maskSize = static_cast<int64_t>(maskAttr.size());
----------------
Jianhui-Li wrote:
nit: consider using destSize instead of maskSize.
https://github.com/llvm/llvm-project/pull/186247
More information about the Mlir-commits
mailing list