[llvm-commits] [patch] Add a pass for duplicating indirectbr at the IL level

Bob Wilson bob.wilson at apple.com
Mon Aug 1 21:49:26 PDT 2011


On Aug 1, 2011, at 9:15 PM, Rafael Ávila de Espíndola wrote:
> 
>> Have you come up with a solution for the problem that
>> you can't judge the code size of IR instructions?  I'd like to see a
>> more detailed design proposal.
> 
> A similar problem exists with the early tail dup at the IL level too.

Right, and we haven't used that pass for at least the last few years.  I'm not sure if that was the reason why it was deprecated like that, but it is a fundamental issue with IR-level tail-dup, not a criticism of your particular implementation.

> 
>> I realize, of course, that I haven't yet provided any details of my
>> work, either.  I've got a bunch more pressing things to do this week,
>> but I'll try to make progress soon.
> 
> BTW, this is the second time you mention this pass to oppose to patch
> I am working on. The previous time it so happened that my patch
> helped both webkit and firefox and it has already been committed.
> 
> I always try to send work in progress patches to collect feedback.
> Would you mind doing the same? If reading your patch I realize it
> is clearly better, I would be more than happy finish the
> missing parts. I would also be happy to benchmark the two.

I can't.  I haven't written it yet (at least not to the point where I have anything to share).

I actually wrote something last year, realized it had a serious flaw in the algorithm, set it aside for a while and then lost all the code.  So now I have to start over….

I'm just trying to head off what looks like a collision between two projects.  Ideally we can figure out a plan for how to move forward that doesn't involve either of us wasting effort.  If we could agree on an overall plan ahead of time, we can both adjust our efforts to fit into that plan.

The alternative is that we both go our own ways, end up with 3 or 4 tail dup passes, and then have to throw one or more of them away. That would be a shame, I think.

I would be willing to implement the indirect branch dup pass that I'm working on at the IR level, except that I don't know how to solve the two problems I mentioned earlier.  If you have ideas for how to solve those, I might be able to build my pass on top of what you're doing now.

>>> Sorry, the question was more on the "how to duplicate", not "where
>>> to duplicate". If previous optimizations gives us
>>> 
>>> zed: ... br i1 %foo, %indirectgoto, %bar
>>> 
>>> and you decide that the indirect goto should be duplicated to zed,
>>> how do you do it?
>> 
>> If you want to duplicate back "zed", you need to duplicate all the
>> code between that point and the indirect branch.
> 
> Sorry, what is "that point"? the br instruction? The indirectgoto
> above is the bb created by clang with the indirectbr.

"that point" would be "zed".  I really don't think I'm understanding your question correctly.  Sorry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110801/dd3ac11d/attachment.html>


More information about the llvm-commits mailing list