CRC detection and optimization
Day 1 | 18:00 | 00:20 | K.3.201 | Mariam Arutunian, Hayk Aslanyan
Note: I'm reworking this at the moment, some things won't work.
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.
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