Add no-wrap bound to data references.
Introduces a nowrap_bound field to data references for optimizing non-wrapping behavior.
This change adds a nowrap_bound field to the data_reference structure within GCC’s data reference analysis. This new field tracks the upper bound below which a data reference is guaranteed not to wrap around. Functions involved in data reference analysis are updated to accept and record this bound, enabling more precise optimization opportunities by identifying non-wrapping code paths.
In Details
This commit introduces a nowrap_bound field to GCC's struct data_reference within the dr (data reference) analysis pass. This aims to explicitly capture upper bounds for scalar evolution (scev) analysis, allowing optimization passes to reason about non-wrapping behavior more effectively. Previously, such bounds were implicit or lost, hindering loop optimizations and scalar replacement.
- data reference
- A data structure used in compiler optimization to represent access to memory locations, tracking base addresses, strides, and bounds.
- nowrap bound
- An upper limit for a data reference or loop iteration, below which the access or iteration is guaranteed not to wrap around (e.g., an integer counter that doesn't exceed its maximum value).
- DR analysis
- Compiler analysis focused on understanding data references, typically for loop optimizations and memory access pattern recognition.