https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97181
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Component|tree-optimization |ipa
CC| |hubicka at gcc dot gnu.org,
| |jamborm at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The exact transform doesn't look feasible - the analysis required would be
that 'level' decreases and recursion stops at level == 0 which means we
can clone btsum for level == 0 and change
if (level /= 0) then
call btsum (3*n, s , level-1)
call btsum (3*n+1,s+1, level-1)
call btsum (3*n+2,s+2, level-1)
return
end if
to
if (level == 1) then
call btsum.0 (3*n, s)
call btsum.0 (3*n+1, s+1)
call btsum.0 (3*n_2, s+2)
return
else if (level /= 0) then
call btsum (3*n, s , level-1)
call btsum (3*n+1,s+1, level-1)
call btsum (3*n+2,s+2, level-1)
return
end if
and then inline btsum.0. Notice how the possibility of level < 0 is left
untouched ... [I think there are no unsigned types in fortran]
That said, I don't think IPA-CP/VRP do this kind of "evolution analysis"
on parameters [in the recursion case]?