Re: [PATCH] backwards threader: handle SSA names occurring in abnormal PHIs
Jeffrey Law <[email protected]>
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
On 8/13/2026 12:15 AM, Aldy Hernandez wrote: > [Andrew: are you OK with the changes to gimple_range_ssa_names and > gimple_range_ssa_p, or would you prefer it to be solved a different > way?] > > [Richi/Jeff, are you OK with this, since you've done work in this area?] > > The backward threader refuses to look at any SSA name occurring in an > abnormal PHI, but DOM's threader does, at least for PHIs where the > path taken does not include an abnormal edge. For example: > > x_5(ab) = PHI <45(5), y_8(ab)> > ... > if (x_5 == 45) > > If we're threading a path coming in from BB5, it's perfectly valid to > thread this path, even if x_5 itself is AB. Right. So as long as the argument in the original PHI isn't associated with an abnormal edge, then it should be safe. Important to note is how we manipulate the PHI nodes. That existing PHI is going to have arguments removed, but as long as we're not touching an argument associated with an abnormal edge we're OK. Jeff