[Mlir-commits] [mlir] [mlir][gpu] Add gpu.rotate operation (PR #142796)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jun 18 08:41:31 PDT 2025


================
@@ -1364,6 +1364,53 @@ def GPU_ShuffleOp : GPU_Op<
   ];
 }
 
+def GPU_RotateOp : GPU_Op<
+    "rotate", [Pure, AllTypesMatch<["value", "rotateResult"]>]>,
+    Arguments<(ins AnyIntegerOrFloatOr1DVector:$value, I32:$offset, I32:$width)>,
+    Results<(outs AnyIntegerOrFloatOr1DVector:$rotateResult, I1:$valid)> {
+  let summary = "Rotate values within a subgroup.";
+  let description = [{
+    The "rotate" op moves values across lanes (a.k.a., invocations, work items)
+    within the same subgroup. The `width` argument specifies the number of lanes
+    that participate in the rotation, and must be uniform across all lanes.
----------------
Muzammiluddin-Syed-ECE wrote:

I'm not sure I understand what this means. This implies that if for example we had a width of 16, then lanes 16+ won't be participating in the rotation. But if so, what does it mean for this to be uniform across all lanes? 

Is this supposed to be `uniform across all participating lanes`?

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


More information about the Mlir-commits mailing list