Hi! On Wed, Apr 15, 2020 at 08:21:03AM +0200, Richard Biener wrote: > On Wed, Apr 15, 2020 at 3:56 AM Jiufu Guo via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > As you may know, we have loop unroll pass in RTL which was introduced a few > > years ago, and works for a long time. Currently, this unroller is using the > > pseudos in the original body, and then the pseudos are written multiple > > times. > > > > It would be a good idea to create new pseudos for those duplicated > > instructions > > during loop unrolling. This would relax reg dependence, and then provide > > more > > freedom/opportunity for other optimizations, like scheduling, RA... > > I think there's a separate pass to do something like this, conveniently > placed after unrolling. -fweb, IIRC enabled by default for -funroll-loops > unless explicitly disabled. Related is regrename which is also enabled then. > > So where does your patch make a difference? Is the webizers dataflow analysis > maybe confused by backedges?
Does -fweb handle things set by the last unrolled iteration, used by the first unrolled iteration? On a general note, we shouldn't depend on some pass that may or may not clean up the mess we make, when we could just avoid making a mess in the first place. The web pass belongs immediately after expand; but ideally, even expand would not reuse pseudos anyway. Maybe it would be better as some utility routines, not a pass? Segher