https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126332
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 16 Sep 2026, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126332 > > --- Comment #8 from Drea Pinski <pinskia at gcc dot gnu.org> --- > (In reply to Drea Pinski from comment #7) > > (In reply to Drea Pinski from comment #6) > > > (In reply to Richard Biener from comment #5) > > > > That said, why's the load commoning not done earlier in phiopt3? (not > > > > that it would help) > > > > > > Currently it is limited to non-loops for phiopt2/3 as doing it in > > > phiopt2/3 > > > for some loops will make some loops unvectorizable. (an example is > > > eembc's > > > viterb00; see https://github.com/llvm/llvm-project/issues/219918 where GCC > > > currently can vectorize the loop at -O3 but LLVM fails due to load > > > commoning). Maybe a better heurstics is needed for loops and > > > vectorization. > > > > > > Maybe we can see if the pointer has a well defined scev and reject it > > > then. > > > Let me try this coming week. > > > > Note that is PR 125945. > > Even with that, tracer still duplicates the branch. > > As for the 50/50 the current param is 50. Maybe it should be 51%. > ``` > -param=tracer-min-branch-probability= > Common Joined UInteger Var(param_tracer_min_branch_probability) Init(50) > IntegerRange(0, 100) Param Optimization > Stop forward growth if the probability of best edge is less than this > threshold > (as a percentage). Used when profile feedback is not available. > ``` > > With FDO/PGO it is 80% though: > ``` > -param=tracer-min-branch-probability-feedback= > Common Joined UInteger Var(param_tracer_min_branch_probability_feedback) > Init(80) IntegerRange(0, 100) Param Optimization > Stop forward growth if the probability of best edge is less than this > threshold > (as a percentage). Used when profile feedback is available. > ``` > > Now I am curious if this is taken more than 80% of the time, won't it be > better > to do the duplicating? Unfortunately probability != predictability (though higher probability makes higher predictability more likely statistically). In the end it seems to be about if-conversion or not if-conversion which is always a hard decision and the path duplication "early" decides.
