[llvm] [ISel] Introduce llvm.clmul intrinsic (PR #168731)
Oscar Smith via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 20 10:20:25 PST 2025
================
@@ -8302,6 +8302,57 @@ SDValue TargetLowering::expandFunnelShift(SDNode *Node,
return DAG.getNode(ISD::OR, DL, VT, ShX, ShY);
}
+SDValue TargetLowering::expandCLMUL(SDNode *Node, SelectionDAG &DAG) const {
+ SDLoc DL(Node);
+ EVT VT = Node->getValueType(0);
+ SDValue X = Node->getOperand(0);
+ SDValue Y = Node->getOperand(1);
+ unsigned BW = VT.getScalarSizeInBits();
+ unsigned Opcode = Node->getOpcode();
+
+ if (VT.isVector() &&
+ isOperationLegalOrCustomOrPromote(Opcode, VT.getVectorElementType()))
+ return DAG.UnrollVectorOp(Node);
----------------
oscardssmith wrote:
Unfortunately, this is a bit of damned if you do, damned if you don't. Given a clmul(8 x i64, 8x i64), scalarizing will be ~8 ops, while lowering to vector bitmath will be ~120, so the scalar version will be a lot faster, (unless the scalar clmul is also missing).
https://github.com/llvm/llvm-project/pull/168731
More information about the llvm-commits
mailing list