[llvm] [ISel] Introduce llvm.clmul intrinsic (PR #168731)

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 25 02:12:28 PST 2025


================
@@ -11420,6 +11420,30 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
   if (SDValue AVG = foldShiftToAvg(N, DL))
     return AVG;
 
+  SDValue Y;
+  if (VT.getScalarSizeInBits() % 2 == 0) {
+    // Fold clmul(zext(x), zext(y)) >> (BW - 1 | BW) -> clmul(r|h)(x, y).
+    uint64_t HalfBW = VT.getScalarSizeInBits() / 2;
----------------
pfusik wrote:

```suggestion
    unsigned HalfBW = VT.getScalarSizeInBits() / 2;
```

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


More information about the llvm-commits mailing list