https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129172
Bug ID: 129172
Summary: Missed TBAA disambiguation method for loops
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: alias, missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
gcc.dg/vect/pr60012.c shows an example that allows both RAW and WAR dependences
to be resolved using TBAA by assessing that a store does not alter the
dynamic type of its storage by presence of a read-update pair:
Disambiguation by Pre-Loop Effective Type (Read-Before-Write Bases)
If two data references have non-conflicting alias sets, and both references
belong to arrays/bases where every accessed element is read before it is
written (e.g., pure reads, or read-modify-writes like acc[i] += ... where the
read dominates the write within the iteration and no earlier iteration writes
ahead):
- Both memory regions must arrive with their respective effective types
prior
to loop entry.
- Because a single address cannot have two incompatible effective types on
entry, the two references cannot alias at all across the entire loop.
- They are independent (DDR_ARE_DEPENDENT = chrec_known or treated as
non-aliasing in vect_analyze_data_ref_dependence).