This patch adds a match.pd transformation to strip unnecessary
view_converts of BIT_FIELD_REFs. This is only valid when the type of the
view_convert is a register type, and no loss of precision is involved when
casting to an integer type; both of these conditions are checked for in
the if clause of the new pattern.
The change survives bootstrap + regtest on aarch64 and x86_64, and one
additional test case has been added to gcc.dg/tree-ssa.
Changes since v1:
- Require is_gimple_reg_type (type) and remove conditions on @0
- Reword the commit message to reflect code changes
gcc/ChangeLog:
* match.pd: Add pattern to simplify view_convert (BIT_FIELD_REF).