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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 09:24:36 PST 2025


================
@@ -11771,6 +11791,11 @@ SDValue DAGCombiner::visitBITREVERSE(SDNode *N) {
       sd_match(N, m_BitReverse(m_Shl(m_BitReverse(m_Value(X)), m_Value(Y)))))
     return DAG.getNode(ISD::SRL, DL, VT, X, Y);
 
+  // fold bitreverse(clmul(bitreverse(x), bitreverse(y))) -> clmulr(x, y)
+  if (sd_match(N, m_BitReverse(m_Clmul(m_BitReverse(m_Value(X)),
----------------
topperc wrote:

Can we do `sd_match(N0, m_Clmul(m_BitReverse(m_Value(X)), m_BitReverse(m_Value(Y)))`? I'm baffled why the existing patterns in this function match the outer reverse.

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


More information about the llvm-commits mailing list