https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126053
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #5) [...] > But, we have > > namd557_pair_fail.cpp:113:20: note: Cost model analysis for part in loop 1: > Vector cost: 296 > Scalar cost: 272 > namd557_pair_fail.cpp:113:20: missed: not vectorized: vectorization is not > profitable. > > as we cost stmts in different loops separately. loop 1 is the outer loop > here. Overall we have > > namd557_pair_fail.cpp:113:20: note: Cost model analysis for part in loop 0: > Vector cost: 196 > Scalar cost: 264 > namd557_pair_fail.cpp:113:20: note: Cost model analysis for part in loop 1: > Vector cost: 296 > Scalar cost: 272 > namd557_pair_fail.cpp:113:20: note: Cost model analysis for part in loop 2: > Vector cost: 324 > Scalar cost: 332 > namd557_pair_fail.cpp:113:20: note: Cost model analysis for part in loop 3: > Vector cost: 304 > Scalar cost: 332 > > the two inner loops and the function level parts are profitable. But all > only moderately. An enhancement would be to allow inner loop profitability > to override outer loop unprofitabilities, assuming we roll once. In this > case this would be offsetting the 24 extra cost in loop 1 by the win > of 8 and 28 in the inner loops. Is what now remains in this PR given the other issues have been split out. In general the approach should be that each loop iteration should be profitable including the inner loop bodies, so in this case we want to check profitability of the loop 2, loop 3, loop 1 + 2 + 3, loop 0 + 1 + 2 + 3 costs.
