[llvm] r339760 - [X86] Add sibling-call test cases
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 15 03:56:50 PDT 2018
The commit subject should also had "[NFC]", since this is literally no
functional change.
On Wed, Aug 15, 2018 at 1:54 PM, Aleksandr Urakov via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: aleksandr.urakov
> Date: Wed Aug 15 03:54:06 2018
> New Revision: 339760
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339760&view=rev
> Log:
> [X86] Add sibling-call test cases
>
> This commit adds new sibling-call test cases, so it will be possible to see
> how these test cases will be changed after applying D45653.
> See D45653 for details.
>
> Modified:
> llvm/trunk/test/CodeGen/X86/sibcall.ll
>
> Modified: llvm/trunk/test/CodeGen/X86/sibcall.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sibcall.ll?rev=339760&r1=339759&r2=339760&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/sibcall.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/sibcall.ll Wed Aug 15 03:54:06 2018
> @@ -606,3 +606,112 @@ entry:
> }
>
> declare fastcc double @foo20(double) nounwind
> +
> +; bug 28417
> +define fastcc void @t21_sret_to_sret(%struct.foo* noalias sret %agg.result) nounwind {
> +; 32-LABEL: t21_sret_to_sret:
> +; 32: jmp {{_?}}t21_f_sret
> +; 64-LABEL: t21_sret_to_sret:
> +; 64: jmp {{_?}}t21_f_sret
> +; X32-LABEL: t21_sret_to_sret:
> +; X32: # %bb.0:
> +; X32-NEXT: pushl %esi
> +; X32-NEXT: subl $8, %esp
> +; X32-NEXT: movl %ecx, %esi
> +; X32-NEXT: calll t21_f_sret
> +; X32-NEXT: movl %esi, %eax
> +; X32-NEXT: addl $8, %esp
> +; X32-NEXT: popl %esi
> +; X32-NEXT: retl
> +;
> +; X64-LABEL: t21_sret_to_sret:
> +; X64: # %bb.0:
> +; X64-NEXT: pushq %rbx
> +; X64-NEXT: movq %rdi, %rbx
> +; X64-NEXT: callq t21_f_sret
> +; X64-NEXT: movq %rbx, %rax
> +; X64-NEXT: popq %rbx
> +; X64-NEXT: retq
> +;
> +; X32ABI-LABEL: t21_sret_to_sret:
> +; X32ABI: # %bb.0:
> +; X32ABI-NEXT: pushq %rbx
> +; X32ABI-NEXT: movl %edi, %ebx
> +; X32ABI-NEXT: callq t21_f_sret
> +; X32ABI-NEXT: movl %ebx, %eax
> +; X32ABI-NEXT: popq %rbx
> +; X32ABI-NEXT: retq
> + tail call fastcc void @t21_f_sret(%struct.foo* noalias sret %agg.result) nounwind
> + ret void
> +}
> +
> +define fastcc void @t21_sret_to_non_sret(%struct.foo* noalias sret %agg.result) nounwind {
> +; 32-LABEL: t21_sret_to_non_sret:
> +; 32: calll {{_?}}t21_f_non_sret
> +; 32: retl
> +; 64-LABEL: t21_sret_to_non_sret:
> +; 64: callq {{_?}}t21_f_non_sret
> +; 64: retq
> +; X32-LABEL: t21_sret_to_non_sret:
> +; X32: # %bb.0:
> +; X32-NEXT: pushl %esi
> +; X32-NEXT: subl $8, %esp
> +; X32-NEXT: movl %ecx, %esi
> +; X32-NEXT: calll t21_f_non_sret
> +; X32-NEXT: movl %esi, %eax
> +; X32-NEXT: addl $8, %esp
> +; X32-NEXT: popl %esi
> +; X32-NEXT: retl
> +;
> +; X64-LABEL: t21_sret_to_non_sret:
> +; X64: # %bb.0:
> +; X64-NEXT: pushq %rbx
> +; X64-NEXT: movq %rdi, %rbx
> +; X64-NEXT: callq t21_f_non_sret
> +; X64-NEXT: movq %rbx, %rax
> +; X64-NEXT: popq %rbx
> +; X64-NEXT: retq
> +;
> +; X32ABI-LABEL: t21_sret_to_non_sret:
> +; X32ABI: # %bb.0:
> +; X32ABI-NEXT: pushq %rbx
> +; X32ABI-NEXT: movl %edi, %ebx
> +; X32ABI-NEXT: callq t21_f_non_sret
> +; X32ABI-NEXT: movl %ebx, %eax
> +; X32ABI-NEXT: popq %rbx
> +; X32ABI-NEXT: retq
> + tail call fastcc void @t21_f_non_sret(%struct.foo* %agg.result) nounwind
> + ret void
> +}
> +
> +define fastcc void @t21_non_sret_to_sret(%struct.foo* %agg.result) nounwind {
> +; 32-LABEL: t21_non_sret_to_sret:
> +; 32: jmp {{_?}}t21_f_sret
> +; 64-LABEL: t21_non_sret_to_sret:
> +; 64: jmp {{_?}}t21_f_sret
> +; X32-LABEL: t21_non_sret_to_sret:
> +; X32: # %bb.0:
> +; X32-NEXT: subl $12, %esp
> +; X32-NEXT: calll t21_f_sret
> +; X32-NEXT: addl $12, %esp
> +; X32-NEXT: retl
> +;
> +; X64-LABEL: t21_non_sret_to_sret:
> +; X64: # %bb.0:
> +; X64-NEXT: pushq %rax
> +; X64-NEXT: callq t21_f_sret
> +; X64-NEXT: popq %rax
> +; X64-NEXT: retq
> +;
> +; X32ABI-LABEL: t21_non_sret_to_sret:
> +; X32ABI: # %bb.0:
> +; X32ABI-NEXT: pushq %rax
> +; X32ABI-NEXT: callq t21_f_sret
> +; X32ABI-NEXT: popq %rax
> +; X32ABI-NEXT: retq
> + tail call fastcc void @t21_f_sret(%struct.foo* noalias sret %agg.result) nounwind
> + ret void
> +}
> +
> +declare fastcc void @t21_f_sret(%struct.foo* noalias sret) nounwind
> +declare fastcc void @t21_f_non_sret(%struct.foo*) nounwind
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list