[PATCH] Allow tail call optimization through multiple/nested struct extractions/insertions

Stephen Lin swlin at post.harvard.edu
Mon Apr 22 08:52:12 PDT 2013


On Sat, Apr 20, 2013 at 2:02 PM, Stephen Lin <swlin at post.harvard.edu> wrote:
> Hmm, in retrospect, this was probably not really worth it, but I
> extended this to handle reordering and regrouping of struct elements
> (as long as the original order and grouping is reestablished before
> the call).
>
> I know it doesn't seem all that likely to be useful (I'm guessing some
> functional code with record types *might* be able to take advantage of
> it in some corner cases): I just found the limitation initially when
> making a new test and thought it would be very quick fix.
>
> It ended up being a bit more subtle, actually; but the work is done
> now and there's no apparent downside, so I figured I might as well
> submit it for review. Also, since it was more subtle than I expected,
> I added more plausible false positive cases involving combinations of
> nesting, grouping, and undefined values, just to be as certain as
> possible it's doing the right thing. If there's any more cases anyone
> can think of to add to be safe, please let me know.
>
> Any comment or suggestion is appreciated. Also, I'm sure there's some
> degenerate cases this doesn't handle fully, but this seems like the
> cleanest way of handling my originally planned test and other similar
> cases without carrying excessive amounts of state around.
>
> -Stephen
>

I added another test, to be safe.
-Stephen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tail-call-reorder-struct.patch
Type: application/octet-stream
Size: 15611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130422/7e98cb3d/attachment.obj>


More information about the llvm-commits mailing list