-
Notifications
You must be signed in to change notification settings - Fork 9
pre-commit: PR143208 #2472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pre-commit: PR143208 #2472
Conversation
Diff moderunner: ariselab-64c-docker 7 files changed, 2521 insertions(+), 2752 deletions(-) 34 56 bench/clamav/optimized/crc.ll |
|
The provided LLVM IR diff introduces several changes across multiple benchmark files related to CRC (Cyclic Redundancy Check) table initialization and computation. Below is a high-level summary of the up to 5 major changes, ignoring formatting, comments, and reordering: 1. Introduction of Precomputed CRC Tables as Private ConstantsAcross all modified files (
Example: @.crctable = private unnamed_addr constant [256 x i32] [...]2. Simplification of CRC Initialization LoopsFunctions like
Before: After: tail call void @llvm.memcpy.p0.p0.i64(...)3. Inlining of CRC Table Access into Computation FunctionsIn several cases (e.g.,
This transforms an O(8) per-byte loop into a single lookup plus shift/xor, which is more efficient and better suited for modern CPUs. Key benefit: Eliminates small inner loops in CRC logic, reducing branch mispredictions and improving throughput. 4. Elimination of Polynomial-Based Bitwise LoopsSeveral functions previously used a loop structure that iterated 8 times per byte to compute CRC manually using the generator polynomial.
Result: More compact and faster code due to reduced control flow complexity. 5. Refactoring of Loop Structures and PHI NodesLoop structures in many functions are rewritten with simplified induction variables and fewer PHIs.
This indicates that the optimizer has recognized and merged or vectorized some of the previous complex control flows, especially where CRC calculations were involved. Impact: Cleaner control flow graphs, potentially enabling further optimizations like unrolling or vectorization. SummaryThese changes collectively represent a shift from runtime CRC computation to lookup-based CRC using precomputed tables. Key benefits include:
The patch appears to be optimizing performance-critical paths involving CRC calculations in various subsystems (filesystems, I2C bus, network protocols, etc.). model: qwen-plus-latest |
|
/close |
Link: llvm/llvm-project#143208
Requested by: @artagnon