[LLVMdev] Shrink Wrapping - RFC and initial implementation

John Mosby ojomojo at gmail.com
Wed Mar 18 09:51:59 PDT 2009


2009/3/17 Evan Cheng <echeng at apple.com>

>
> On Mar 13, 2009, at 10:43 AM, John Mosby wrote:
>
> I started to reduce the traversals, then decided to work on edge splitting
> because I believe it may be needed to finish shrink wrapping.
>
> Hmm. I don't think edge splitting would be required for correctness, right?
> There is always a common predecessor / successor. For the first pass, we
> should not be shooting to optimal solution.
>

That's correct, edge splitting is not really required. I have it as a side
project for the purpose of learning more about the design of the Machine
layer.


> Let me know if you think using live interval info would be worth
> investigating for shrink wrapping.
>
> The various passes currently do not compute / update live intervals for
> fixed stack slots so it's not appropriate for this. That's why the stack
> slot coloring pass does not color those slots. It would be a nice
> enhancement to add (but for a different reason). :-)
>

Thanks for the confirmation. I figured out about fixed stack slots not
participating in live intervals earlier but I was not certain if it was
available via some other means. Since shrink wrapping is more related to PRE
(applied to loads/stores), it makes more sense to do the simple analysis
anyway.

I'm working on characterizing the runtime and vm overhead, I don't yet have
> a detailed picture.
> My plan is to do the cleanups, put together a few larger test cases, go
> back and run regressions,
> then the test suite. With the larger focussed test cases, I will get usable
> numbers for compile times, and
> the test suite will extend the coverage.
> Please let me know if there is a simpler or more standard way to tackle
> this for a new pass.
>
> I would just run the test suite once the code is cleaned up. There are
> enough tests to give us a good idea about the compile time / run time
> impact. Since shrink wrapping will be guarded by a command line option, you
> can just run the test suite with ENABLE_LLCBETA. It will report everything
> we need to know.
>

Thanks, I was going to ask how ask about llc beta. I will still be adding
some stats so I can see when and what it reduces.


> What about EH and shrink wrapping? Should I disable shrink wrapping in EH
> contexts?
>
> I am not sure. If tests using EH fails, we can just disable shrink wrapping
> for functions with EH.
>
> I have held off looking at maintaining debug info integrity, let me know if
> I should look at that or if it can wait a bit.
>
> It's not an immediate problem since -O0 -g means "fast" codegen and shrink
> wrapping is not run. We can worry about this later.
>

I will be testing with some small EH examples (which Anton recommended in
the beginning) and will take care of disabling it (per-function) if this
proves to be necessary.

Thank you very much for the feedback!

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090318/d99c9f9a/attachment.html>


More information about the llvm-dev mailing list