https://llvm.org/bugs/show_bug.cgi?id=23470

            Bug ID: 23470
           Summary: Inefficient lowering of 'musttail' call
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

consider:
target triple = "x86_64-pc-linux"

define void @f(i8* %x) {
  %bc = bitcast i8* %x to void (i8*)*
  musttail call void (i8*) %bc(i8* %x)
  ret void
}

running it through llc gives:
f:                                      # @f
        .cfi_startproc
# BB#0:
        pushq   %rax
.Ltmp0:
        .cfi_def_cfa_offset 16
        popq    %rax
        jmpq    *%rdi                   # TAILCALL
.Lfunc_end0:
        .size   f, .Lfunc_end0-f
        .cfi_endproc

The push/pop pair seems superfluous.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to