Unify alignment information with range bitmask
GCC unifies pointer alignment information and range bitmasks, asserting compatibility and preparing for removal of alignment fields.
GCC’s SSA (Static Single Assignment) name information now unifies alignment data with a range bitmask. This change ensures that the bitmask, which can hold more refined information, is consistent with the explicit align and misalign fields. Assertions are added to verify this compatibility, serving as a temporary measure before the alignment fields are fully removed.
In Details
Within GCC's tree-ssa infrastructure, pointer information is tracked. This commit targets the ptr_info_def structure and its usage in tree-ssanames.cc and related files. It refactors how alignment information is stored and queried, prioritizing a bitmask representation over separate align and misalign fields. New functions alignment_to_bitmask and bitmask_to_alignment are introduced. Assertions are added to get_ptr_info_alignment and set_ptr_info_alignment to ensure consistency between the bitmask and explicit alignment fields, paving the way for eventual removal of the latter.
- SSA
- Static Single Assignment. An intermediate representation in compilers where every variable is assigned a value exactly once.
- alignment
- The requirement that data be stored in memory at an address that is a multiple of some value (e.g., a 4-byte integer might require 4-byte alignment).
- bitmask
- A sequence of bits used to perform bitwise operations, often to represent a set of boolean flags or encoded information compactly.
- tree-ssa
- GCC's internal representation that combines the 'tree' abstract syntax representation with Static Single Assignment form.