[llvm] 9f7877f - [HashRecognize] Clarify hdr comment on GF(2^n) (NFC) (#157482)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 8 08:57:21 PDT 2025
Author: Ramkumar Ramachandra
Date: 2025-09-08T15:57:16Z
New Revision: 9f7877ffa3b8d1cd65c283eb8824babdeaa90504
URL: https://github.com/llvm/llvm-project/commit/9f7877ffa3b8d1cd65c283eb8824babdeaa90504
DIFF: https://github.com/llvm/llvm-project/commit/9f7877ffa3b8d1cd65c283eb8824babdeaa90504.diff
LOG: [HashRecognize] Clarify hdr comment on GF(2^n) (NFC) (#157482)
Unify explanation for GF(2^n) and GF(2), which was previously
convoluted.
Added:
Modified:
llvm/lib/Analysis/HashRecognize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/HashRecognize.cpp b/llvm/lib/Analysis/HashRecognize.cpp
index 1b608870d28a8..5d7ee1fe8eb12 100644
--- a/llvm/lib/Analysis/HashRecognize.cpp
+++ b/llvm/lib/Analysis/HashRecognize.cpp
@@ -8,8 +8,10 @@
//
// The HashRecognize analysis recognizes unoptimized polynomial hash functions
// with operations over a Galois field of characteristic 2, also called binary
-// fields, or GF(2^n): this class of hash functions can be optimized using a
-// lookup-table-driven implementation, or with target-specific instructions.
+// fields, or GF(2^n). 2^n is termed the order of the Galois field. This class
+// of hash functions can be optimized using a lookup-table-driven
+// implementation, or with target-specific instructions.
+//
// Examples:
//
// 1. Cyclic redundancy check (CRC), which is a polynomial division in GF(2).
@@ -24,12 +26,10 @@
//
// c_m * x^m + c_(m-1) * x^(m-1) + ... + c_0 * x^0
//
-// where each coefficient c is can take values in GF(2^n), where 2^n is termed
-// the order of the Galois field. For GF(2), each coefficient can take values
-// either 0 or 1, and the polynomial is simply represented by m+1 bits,
-// corresponding to the coefficients. The
diff erent variants of CRC are named by
-// degree of generating polynomial used: so CRC-32 would use a polynomial of
-// degree 32.
+// where each coefficient c is can take values 0 or 1. The polynomial is simply
+// represented by m+1 bits, corresponding to the coefficients. The
diff erent
+// variants of CRC are named by degree of generating polynomial used: so CRC-32
+// would use a polynomial of degree 32.
//
// The reason algorithms on GF(2^n) can be optimized with a lookup-table is the
// following: in such fields, polynomial addition and subtraction are identical
More information about the llvm-commits
mailing list