[llvm-commits] ideas for 10096

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Jun 28 17:08:43 PDT 2011


>> *) Fix bit rot on the strong phi elimination. IT currently crashes 
>> when building firefox.
> 
> If you can attach a reduced .ll file to a bug I should be able to 
> look at it this weekend. When I stopped working on strong phi 
> elimination it was working well on x86.

I will try to open a bug before the weekend ].

>> So, do you agree with the third option being the best or would a 
>> preprocess pass (or fixing the strong phi elimination) be better?
> 
> This one-pass algorithm sounds like a dominance-based coalescing 
> algorithm applied to the live ranges of the two live intervals, with 
> a dominance test approximated by something weaker. I would be
> worried about a compile-time regression, since I see the optimistic
> case kicking in quite a bit when running -debug on the coalescer.
> Can't you just handle this in the exceptional case of coalescing,
> i.e. check whether both valnos are defined by a copy of the same
> value in the same basic block and pick the first one to be the
> 'leader'?

That is what I am trying to do, it is just a bit hard to do in the current
code organization.

> I think the correct thing long-term is for phi elimination to
> produce parallel copies, and for the coalescer to take advantage of
> this. It would then be even easier to do this sort of a check.

Yes, it would avoid having to go looking for the other copy. I wonder
if there would still be value in handling copies not introduced by
phi elimination.

> When checking whether two seemingly overlapping live ranges actually
> interfere, you could just check whether they are defined by the same
> value at the same parallel copy.
> 
> I have been working on this off and on with a branch, but I wanted
> to wait until linear scan is gone (taking physical register
> coalescing with it) before heavily modifying the coalescer on trunk.

Cool.
I will try to implement this one case since it looks like it has a really
large impart in jsinterp.o. I will also upload a testcase of the strong phi failure.

Do you have any good references on coalescing? Every text I found starts with
"build in interference graph" as if that was a completely trivial task :-) 

> Cameron

Cheers,
Rafael



More information about the llvm-commits mailing list