[llvm] [SelectionDAG] Fix missed optimization for CLMUL where one operand is all ones (PR #200592)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 01:57:39 PDT 2026


================
@@ -3611,3 +3611,524 @@ define void @mul_use_commutative_clmul_i8(i8 %x, i8 %y, ptr %p0, ptr %p1) nounwi
   store i8 %yx, ptr %p1
   ret void
 }
+
+; Special case: clmul(X, ~0) / clmul(~0, X) expands to a parallel-prefix
+; XOR in O(log BW) shift-xor pairs rather than the O(BW) general fallback.
+
+define i8 @clmul_i8_allones_rhs(i8 %x) nounwind {
----------------
RKSimon wrote:

I'd drop them all tbh

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


More information about the llvm-commits mailing list