[llvm] r220811 - Transforms: reapply SVN r219899

Reid Kleckner rnk at google.com
Mon Nov 3 11:50:30 PST 2014


I think the changes for musttail were wrong here, but I need to think
harder. Mechanically, inlining one level of musttail -> musttail should
work, but it violates the langref guarantees. Maybe we need to finesse the
reference.

This is the kind of optimizer change that should really get pre-commit code
review.

On Fri, Oct 31, 2014 at 11:02 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> >
> > -; Don't insert lifetime end markers here, the lifetime is trivially
> over due
> > -; the return.
> > -; CHECK: define void @test_byval_a(
> > -; CHECK: musttail call void @test_byval_c(
> > -; CHECK-NEXT: ret void
> > -
> > -declare void @test_byval_c(i32* byval %p)
> > -define internal void @test_byval_b(i32* byval %p) {
> > -  musttail call void @test_byval_c(i32* byval %p)
> > -  ret void
> > -}
> > -define void @test_byval_a(i32* byval %p) {
> > -  musttail call void @test_byval_b(i32* byval %p)
> > -  ret void
> > -}
> > -
> > -; Don't insert a stack restore, we're about to return.
> > -; CHECK: define void @test_dynalloca_a(
> > -; CHECK: call i8* @llvm.stacksave(
> > -; CHECK: alloca i8, i32 %n
> > -; CHECK: musttail call void @test_dynalloca_c(
> > -; CHECK-NEXT: ret void
> > -
> > -declare void @escape(i8* %buf)
> > -declare void @test_dynalloca_c(i32* byval %p, i32 %n)
> > -define internal void @test_dynalloca_b(i32* byval %p, i32 %n)
> alwaysinline {
> > -  %buf = alloca i8, i32 %n              ; dynamic alloca
> > -  call void @escape(i8* %buf)           ; escape it
> > -  musttail call void @test_dynalloca_c(i32* byval %p, i32 %n)
> > -  ret void
> > -}
> > -define void @test_dynalloca_a(i32* byval %p, i32 %n) {
> > -  musttail call void @test_dynalloca_b(i32* byval %p, i32 %n)
> > -  ret void
> > -}
>
> Why remove these tests? The musttail case in particular is interesting.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141103/c8c10513/attachment.html>


More information about the llvm-commits mailing list