Re: [PATCH] tree-object-size: Fold PHI node offsets with constants [PR116556]

2024-09-14 Thread Siddhesh Poyarekar
On 2024-09-14 12:10, Andrew Pinski wrote: + /* Note that this is the *opposite* of what we usually do with sizes, +because the maximum offset estimate here will give us a minimum size +estimate and vice versa. */ + enum tree_code code = (object_size_type & OST_MINIMUM +

Re: [PATCH] tree-object-size: Fold PHI node offsets with constants [PR116556]

2024-09-14 Thread Andrew Pinski
On Sat, Sep 14, 2024 at 5:31 AM Siddhesh Poyarekar wrote: > > In PTR + OFFSET cases, try harder to see if the target offset could > result in a constant. Specifically, if the offset is a PHI node with > all constant branches, return the minimum (or maximum for OST_MINIMUM) > of the possible value

[PATCH] tree-object-size: Fold PHI node offsets with constants [PR116556]

2024-09-14 Thread Siddhesh Poyarekar
In PTR + OFFSET cases, try harder to see if the target offset could result in a constant. Specifically, if the offset is a PHI node with all constant branches, return the minimum (or maximum for OST_MINIMUM) of the possible values. gcc/ChangeLog: PR tree-optimization/116556 * tre