[llvm-commits] Enable early dup of any small bb

Rafael Avila de Espindola respindola at mozilla.com
Fri Jun 10 13:57:04 PDT 2011


> If the llvm-testsuite is all you've got, that would be a good start.
> We don't have enough real applications in the testsuite, but I don't
> know what else to suggest.

I will give that and clang itself a try.

>> The problem I have found have to do with the register allocator
>> being unhappy with the output of early tail dup. As a test, I tried
>> reducing the limit to the very minimum that would duplicate the
>> original blocks and stop. It helped a bit, but the register
>> allocator was still confused. Maybe in a case not as insane as
>> jsinterp.o the decision of what to duplicate is more important.
>
> Maybe I missed some things, but did you ever track down the root
> cause of the allocator's confusion?  It seems like fixing the
> allocator would be the right thing to do here, regardless of whether
> we make other changes to tail dup.

I haven't found what is confusing the register allocator (or phielim) 
yet. I started looking at this as a short time solution, but found that, 
in jsinterp.o at least, the minimum necessary duplication already breaks ra.

Finding that enabling early dup of small blocks helps code size and 
performance a bit was a happy accident.

>> What were your plans for the indirectbr duplication pass?
>
> I'd basically like it to "undo" the front-end's merging of indirect
> branches.  The idea I was working on duplicated regions of code, not
> just individual blocks, based on dominance info.  Basically each
> successor of the indirect branch, corresponding to a "case" in a
> switch statement, dominates a region of code ending with one or more
> jumps back to the indirect branch, and we should try to duplicate one
> and only one copy of the indirect branch into each of those regions.

I would be happy to beta test it once I am able to make RA happy with 
the extra duplicated blocks :-)

Cheers,
Rafael



More information about the llvm-commits mailing list