[Mlir-commits] [mlir] [mlir][xegpu] Add xegpu.lane_shuffle op (PR #210777)
Jianhui Li
llvmlistbot at llvm.org
Sat Aug 1 11:40:09 PDT 2026
================
@@ -1500,6 +1500,78 @@ def XeGPU_TruncfOp
let hasVerifier = 1;
}
+def XeGPU_LaneShuffleOp
+ : XeGPU_Op<"lane_shuffle", [Pure, AllTypesMatch<["source", "result"]>]> {
+ let summary = "Re-distributes a subgroup's fragments across its lanes.";
+
+ let description = [{
+ `xegpu.lane_shuffle` is a lane-level operation. The `source` operand is the
+ fragment (a 1D vector) held by one lane, and the `result` is the fragment
+ that lane holds afterwards. It re-distributes the elements across the lanes
+ of the subgroup without changing their type, so `source` and `result` have
+ the same type.
+
+ Let `S` be the subgroup size and `N` the number of elements per lane, so the
+ subgroup collectively holds `S * N` elements. Number these elements by their
+ logical position `0 .. S*N-1`. The `mode` selects which of the two
+ orientations of the `S x N` (lane, element) index grid the operation maps
+ between:
+
+ * `pack`: element `j` of lane `i` holds logical position `j * S + i` before
----------------
Jianhui-Li wrote:
It actually reads correct to me. The packed data for lane i is `i*N + j`, and `j*N + i` is for the data before packing.
https://github.com/llvm/llvm-project/pull/210777
More information about the Mlir-commits
mailing list