[clang] [CIR] Upstream ShuffleOp for VectorType (PR #142288)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 1 11:26:26 PDT 2025


================
@@ -2156,6 +2157,52 @@ def VecCmpOp : CIR_Op<"vec.cmp", [Pure, SameTypeOperands]> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// VecShuffleOp
+//===----------------------------------------------------------------------===//
+
+// TODO: Create an interface that both VecShuffleOp and VecShuffleDynamicOp
+// implement.  This could be useful for passes that don't care how the vector
+// shuffle was specified.
+
+def VecShuffleOp : CIR_Op<"vec.shuffle",
+                   [Pure, AllTypesMatch<["vec1", "vec2"]>]> {
+  let summary = "Combine two vectors using indices passed as constant integers";
+  let description = [{
+    The `cir.vec.shuffle` operation implements the documented form of Clang's
+    __builtin_shufflevector, where the indices of the shuffled result are
----------------
xlauko wrote:

```suggestion
    `__builtin_shufflevector`, where the indices of the shuffled result are
```

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


More information about the cfe-commits mailing list