87 lines · plain
1; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefixes=ALL %s2; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefixes=ALL %s3; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefixes=ALL %s4;5; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefixes=ALL %s6; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefixes=ALL %s7; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefixes=ALL %s8 9; We don't need to save registers before using them inside preserve_none function.10define preserve_nonecc RETTYPE @preserve_nonecc1(i64, i64, double, double) nounwind {11entry:12;ALL-LABEL: preserve_nonecc113;ALL: pushq %rbp14;ALL-NEXT: InlineAsm Start15;ALL-NEXT: InlineAsm End16;ALL-NEXT: popq %rbp17;ALL-NEXT: retq18 call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{rbp},~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15}"()19 ret RETTYPE RETVAL20}21 22; When calling a preserve_none function, all live registers must be saved and23; restored around the function call.24declare preserve_nonecc RETTYPE @bar(i64, i64, double, double)25define void @preserve_nonecc2() nounwind {26entry:27;ALL-LABEL: preserve_nonecc228;ALL: movq %rax29;ALL: movq %rdx30;ALL: movq %r1131;ALL: movaps %xmm232;ALL: movaps %xmm333;ALL: movaps %xmm434;ALL: movaps %xmm535;ALL: movaps %xmm636;ALL: movaps %xmm737;ALL: movaps %xmm838;ALL: movaps %xmm939;ALL: movaps %xmm1040;ALL: movaps %xmm1141;ALL: movaps %xmm1242;ALL: movaps %xmm1343;ALL: movaps %xmm1444;ALL: movaps %xmm1545;ALL: movq {{.*}}, %rax46;ALL: movq {{.*}}, %rdx47;ALL: movq {{.*}}, %r1148;ALL: movaps {{.*}} %xmm249;ALL: movaps {{.*}} %xmm350;ALL: movaps {{.*}} %xmm451;ALL: movaps {{.*}} %xmm552;ALL: movaps {{.*}} %xmm653;ALL: movaps {{.*}} %xmm754;ALL: movaps {{.*}} %xmm855;ALL: movaps {{.*}} %xmm956;ALL: movaps {{.*}} %xmm1057;ALL: movaps {{.*}} %xmm1158;ALL: movaps {{.*}} %xmm1259;ALL: movaps {{.*}} %xmm1360;ALL: movaps {{.*}} %xmm1461;ALL: movaps {{.*}} %xmm1562 %a0 = call i64 asm sideeffect "", "={rax}"() nounwind63 %a1 = call i64 asm sideeffect "", "={rcx}"() nounwind64 %a2 = call i64 asm sideeffect "", "={rdx}"() nounwind65 %a3 = call i64 asm sideeffect "", "={r8}"() nounwind66 %a4 = call i64 asm sideeffect "", "={r9}"() nounwind67 %a5 = call i64 asm sideeffect "", "={r10}"() nounwind68 %a6 = call i64 asm sideeffect "", "={r11}"() nounwind69 %a10 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind70 %a11 = call <2 x double> asm sideeffect "", "={xmm3}"() nounwind71 %a12 = call <2 x double> asm sideeffect "", "={xmm4}"() nounwind72 %a13 = call <2 x double> asm sideeffect "", "={xmm5}"() nounwind73 %a14 = call <2 x double> asm sideeffect "", "={xmm6}"() nounwind74 %a15 = call <2 x double> asm sideeffect "", "={xmm7}"() nounwind75 %a16 = call <2 x double> asm sideeffect "", "={xmm8}"() nounwind76 %a17 = call <2 x double> asm sideeffect "", "={xmm9}"() nounwind77 %a18 = call <2 x double> asm sideeffect "", "={xmm10}"() nounwind78 %a19 = call <2 x double> asm sideeffect "", "={xmm11}"() nounwind79 %a20 = call <2 x double> asm sideeffect "", "={xmm12}"() nounwind80 %a21 = call <2 x double> asm sideeffect "", "={xmm13}"() nounwind81 %a22 = call <2 x double> asm sideeffect "", "={xmm14}"() nounwind82 %a23 = call <2 x double> asm sideeffect "", "={xmm15}"() nounwind83 call preserve_nonecc RETTYPE @bar(i64 1, i64 2, double 3.0, double 4.0)84 call void asm sideeffect "", "{rax},{rcx},{rdx},{r8},{r9},{r10},{r11},{xmm2},{xmm3},{xmm4},{xmm5},{xmm6},{xmm7},{xmm8},{xmm9},{xmm10},{xmm11},{xmm12},{xmm13},{xmm14},{xmm15}"(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, <2 x double> %a10, <2 x double> %a11, <2 x double> %a12, <2 x double> %a13, <2 x double> %a14, <2 x double> %a15, <2 x double> %a16, <2 x double> %a17, <2 x double> %a18, <2 x double> %a19, <2 x double> %a20, <2 x double> %a21, <2 x double> %a22, <2 x double> %a23)85 ret void86}87