[llvm] [SelectionDAG] Fix missed optimization for CLMUL where one operand is all ones (PR #200592)
Jan Schultke via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 01:19:22 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 {
----------------
eisenwave wrote:
What does "so much" mean? I guess keep one case for e.g. `i32` or `i64` just in case, and drop the rest?
https://github.com/llvm/llvm-project/pull/200592
More information about the llvm-commits
mailing list