]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH v7 10/12] Verify detected CRC loop with symbolic execution and LFSR matching
authorMariam Arutunian <mariamarutunian@gmail.com>
Mon, 11 Nov 2024 20:00:37 +0000 (13:00 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 1 Dec 2024 15:54:21 +0000 (08:54 -0700)
commitdcc6101cb166b4c59afecc2a3cf1d7aa655fe76a
tree4d82408fa4af1bcb134ee9f75535c8eff5eab3f1
parent148e20466c2c246df9472efed0f2ae94cb65a0f8
[PATCH v7 10/12] Verify detected CRC loop with symbolic execution and LFSR matching

Symbolically execute potential CRC loops and check whether the loop actually
calculates CRC (uses LFSR matching).  Calculated CRC and created LFSR are
compared on each iteration of the potential CRC loop.

gcc/

* Makefile.in (OBJS): Add crc-verification.o.
* crc-verification.cc: New file.
* crc-verification.h: New file.
* gimple-crc-optimization.cc (loop_calculates_crc): New function.
(is_output_crc): Likewise.
(swap_crc_and_data_if_needed): Likewise.
(validate_crc_and_data): Likewise.
(optimize_crc_loop): Likewise.
(get_output_phi): Likewise.
(execute): Add check whether potential CRC loop calculates CRC.
* sym-exec/sym-exec-state.cc (create_reversed_lfsr): New function.
(create_forward_lfsr): Likewise.
(last_set_bit): Likewise.
(create_lfsr): Likewise.
* sym-exec/sym-exec-state.h (is_bit_vector): Reorder, make the function public and static.
(create_reversed_lfsr) New static function declaration.
(create_forward_lfsr) New static function declaration.
gcc/Makefile.in
gcc/crc-verification.cc [new file with mode: 0644]
gcc/crc-verification.h [new file with mode: 0644]
gcc/gimple-crc-optimization.cc
gcc/sym-exec/sym-exec-state.cc
gcc/sym-exec/sym-exec-state.h