[PATCH] D35816: [Greedy RegAlloc] Add logic to greedy reg alloc to avoid bad eviction chains

Marina Yatsina via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 12:58:17 PDT 2017


myatsina added a comment.

In https://reviews.llvm.org/D35816#822628, @myatsina wrote:

> In https://reviews.llvm.org/D35816#819501, @qcolombet wrote:
>
> > Hi,
> >
> > The greedy allocator is already very complicated and I am not sure the additional complexity of the eviction track is worth it.
> >  Is it something that could be cleaned up in machine copy propagation? The problem is very local so that sounds doable.
> >
> > I will have a closer look to the patch because fixing the problem from the start is obviously better that patching up later, but given how rare that problem is I really believe exploring other, less complex avenue is interesting.
> >
> > Cheers,
> > Quentin
>
>
> Thank you for suggesting the machine copy propagation, I've started working on this direction, it definitely seems easier to implement it there.
>  On the other hand, if I understood correctly, one of the issues with the old llvm register allocator (linear scan) was that that it did a lot of decisions that the rewriter had to clean up afterwards, and it was intended that greedy will try to avoid such decisions. I'm not sure if this eviction chain falls under this category or not.
>
> Thanks,
> Marina


I've checked the copy propagation pass feasibility - 
I was able to catch a few new cases (probably because the increase in weight I did in my Greedy patch wasn't high enough, but that's heuristic and we might be able to tune it).
On the other hand, I'm now failing to catch all the cases that cross basic blocks because this pass works at a BB block level.

Based on this I think the solution should probably be kept in Greedy (+ possibly additional cleanup in the copy propagation pass).

Thanks,
Marina


Repository:
  rL LLVM

https://reviews.llvm.org/D35816





More information about the llvm-commits mailing list