[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
Thu Jul 27 05:16:10 PDT 2017


myatsina added a comment.

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



================
Comment at: test/CodeGen/X86/bug26810.ll:1
+; RUN: llc < %s -march=x86 -regalloc=greedy | FileCheck %s
+; Make sure bad eviction sequence doesnt occur
----------------
qcolombet wrote:
> Could you use a .mir test to make the test more robust?
Will do.


================
Comment at: test/CodeGen/X86/bug26810.ll:3
+; Make sure bad eviction sequence doesnt occur
+; XFAIL: *
+
----------------
qcolombet wrote:
> That sounds wrong for a new test.
> 
> Testing should be positive as much as possible IMO.
I wasn't very satisfied with this check as well.
I'll make it into a positive test indeed.


Repository:
  rL LLVM

https://reviews.llvm.org/D35816





More information about the llvm-commits mailing list