[clang] [CIR] Add rotate operation (PR #148426)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 15 04:33:23 PDT 2025


================
@@ -2847,6 +2847,45 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap", CIR_UIntOfWidths<[16, 32, 64]>> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// RotateOp
+//===----------------------------------------------------------------------===//
+
+def RotateOp : CIR_Op<"rotate", [Pure, SameOperandsAndResultType]> {
----------------
xlauko wrote:

I believe the goal was to unify the assembly format and traits for all pure unary operations of the form `T -> T` in a single place. However, the name `BitOpBase` might misleadingly suggest that it specifically involves some bit-level semantics.

Formally, such operations are endomorphisms. That said, it's unclear to me whether names like `EndomorphismOpBase` or `EndoOpBase` are desirable or intuitive enough for this purpose.



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


More information about the cfe-commits mailing list