CRC detection and optimization
- Track: GCC (GNU Toolchain)
- Room: K.3.201
- Day: Saturday
- Start: 18:00
- End: 18:20
- Video only: k3201
- Chat: Join the conversation!
Cyclic redundancy check (CRC) is a widely used error-detection mechanism that helps in the validation of data communication and storage in the digital world. While traditional bitwise implementations are slow and less efficient, alternative methods such as lookup tables, carry-less multiplication, and hardware CRC instructions offer significant performance improvements. In this talk, I will present a novel method for automatically identifying and replacing inefficient bitwise CRC implementations with optimized alternatives. The approach uses fast detection of candidate code fragments, symbolic execution for validation, and automatic replacement with more efficient implementations. The method is implemented in the GCC compiler as a separate pass and is open-source available. Experimental evaluation was performed for i386, AArch64, and RISC-V architectures, and the results demonstrated up to 91%, 98%, and 93% performance improvements respectively, highlighting the effectiveness of the proposed optimization.
Speakers
Mariam Arutunian | |
Hayk Aslanyan |
Links
- Add a new pass for naive CRC loops detection
- Implement internal functions for efficient CRC computation.
- Add built-ins and tests for bit-forward and bit-reversed CRCs.
- RISC-V: Add CRC expander to generate faster CRC.
- Add symbolic execution support.
- Verify detected CRC loop with symbolic execution and LFSR matching
- Replace the original CRC loops with a faster CRC calculation
- Add tests for CRC detection and generation