[PATCH] Add a shrink-wrapping pass to improve the placement of prologue and epilogue.
qcolombet at apple.com
Wed Apr 22 16:40:01 PDT 2015
Thanks for your feedback Daniel.
> On Apr 22, 2015, at 4:24 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
> I was looking at the old version, but ...
> This is essentially the Chow paper, but
> 1. The dataflow is not really expensive (It's O(N), the same as your
> current algorithm). If it is, you should do it differently ;) It can
> be computed really fast. Definitely faster than computing
Post dominators are already available.
Moreover, the data flow algorithm is much more expensive in space and, like I said, the handling of frequencies is a hack.
Finally, implementing the Chow paper was never working, which make me believe that are some complexity not well understood here :).
Honestly, when I started this work, I looked into Chow’s paper and to me there is too much implementation details that are hidden under the carpet… the fact that the previous attempt to implement this never worked make me decide to take an alternative approach.
> 2. The chow paper handles multiple save/restore points :)
Like I said, I do not think this is useful, at least for now. The problem with several save/restore points is that:
- You will likely degrade the runtime for certain path. Chow has no solution for that IIRC.
- You will increase the code size. That is a fact.
The bottom line is that I do not think this is worth paying the complexing (space/runtime) and frankly, if we want to go into the multiple points version, shrink-wrapping remains a black box and we can change its algorithm later and eventually resort on Chow's version.
What do you think?
> If your concern is #1, that's solvable, easily.
> If the concern is "avoiding placement into bad blocks", that's also
> solvable. Chow does not use the other lazy code motion calculations
> for some reason. If it did, it would not place it into loops :)
> In fact, it will give you the placement points, and you can choose
> which you want, and then it will give you the insertion/deletions to
> make that happen.
> On Wed, Apr 22, 2015 at 4:12 PM, Quentin Colombet <qcolombet at apple.com> wrote:
>> Hi Daniel,
>> rL LLVM
>> EMAIL PREFERENCES
More information about the llvm-commits