llvm.org GIT mirror llvm / 4b5bc47
[X86][NFC] Convert memcpy/memset tests to update_llc_test_checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348477 91177308-0d34-0410-b5e6-96231b3b80d8 Clement Courbet 1 year, 3 months ago
3 changed file(s) with 55 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -asm-verbose=false | FileCheck %s
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s | FileCheck %s --check-prefix=X86
12
23 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
34 target triple = "x86_64-unknown-linux-gnu"
1112 ; Memcpy lowering should emit stores of immediates containing string data from
1213 ; the correct offsets.
1314
14 ; CHECK-LABEL: foo:
15 ; CHECK: movb $0, 6(%rdi)
16 ; CHECK: movw $15212, 4(%rdi)
17 ; CHECK: movl $1802117222, (%rdi)
1815 define void @foo(i8* %tmp2) {
16 ; X86-LABEL: foo:
17 ; X86: # %bb.0:
18 ; X86-NEXT: movb $0, 6(%rdi)
19 ; X86-NEXT: movw $15212, 4(%rdi) # imm = 0x3B6C
20 ; X86-NEXT: movl $1802117222, (%rdi) # imm = 0x6B6A2066
21 ; X86-NEXT: retq
1922 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @0, i64 0, i64 3), i64 7, i1 false)
2023 ret void
2124 }
99 ; CHECK-NEXT: pushl $0
1010 ; CHECK-NEXT: calll _memset
1111 ; CHECK-NEXT: addl $16, %esp
12 ; CHECK-NEXT: ud2
1213 entry:
1314 call void @llvm.memset.p0i8.i32(i8* null, i8 0, i32 188, i1 false)
1415 unreachable
2122 ; CHECK-NEXT: movl %ecx, {{[0-9]+}}(%esp)
2223 ; CHECK-NEXT: movl $76, {{[0-9]+}}(%esp)
2324 ; CHECK-NEXT: calll _memset
25 ; CHECK-NEXT: ud2
2426 entry:
2527 call void @llvm.memset.p0i8.i32(i8* undef, i8 %c, i32 76, i1 false)
2628 unreachable
None ; RUN: llc < %s -mtriple=i386-apple-darwin10.0 -mcpu=core2 -relocation-model=dynamic-no-pic --asm-verbose=0 | FileCheck -check-prefix=I386 %s
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -mcpu=core2 -relocation-model=dynamic-no-pic --asm-verbose=0 | FileCheck -check-prefix=CORE2 %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -mcpu=corei7 -relocation-model=dynamic-no-pic --asm-verbose=0 | FileCheck -check-prefix=COREI7 %s
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-apple-darwin10.0 -mcpu=core2 -relocation-model=dynamic-no-pic | FileCheck -check-prefix=I386 %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -mcpu=core2 -relocation-model=dynamic-no-pic | FileCheck -check-prefix=CORE2 %s
3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -mcpu=corei7 -relocation-model=dynamic-no-pic | FileCheck -check-prefix=COREI7 %s
34
45 @.str1 = internal constant [31 x i8] c"DHRYSTONE PROGRAM, SOME STRING\00", align 8
56 @.str3 = internal constant [31 x i8] c"DHRYSTONE PROGRAM, 2'ND STRING\00", align 8
67
78 define void @func() nounwind ssp {
9 ; I386-LABEL: func:
10 ; I386: ## %bb.0: ## %entry
11 ; I386-NEXT: pushl %esi
12 ; I386-NEXT: subl $40, %esp
13 ; I386-NEXT: leal {{[0-9]+}}(%esp), %esi
14 ; I386-NEXT: .p2align 4, 0x90
15 ; I386-NEXT: LBB0_1: ## %bb
16 ; I386-NEXT: ## =>This Inner Loop Header: Depth=1
17 ; I386-NEXT: subl $4, %esp
18 ; I386-NEXT: pushl $31
19 ; I386-NEXT: pushl $_.str3
20 ; I386-NEXT: pushl %esi
21 ; I386-NEXT: calll _memcpy
22 ; I386-NEXT: addl $16, %esp
23 ; I386-NEXT: jmp LBB0_1
24 ;
25 ; CORE2-LABEL: func:
26 ; CORE2: ## %bb.0: ## %entry
27 ; CORE2-NEXT: movabsq $20070800167293728, %rax ## imm = 0x474E4952545320
28 ; CORE2-NEXT: movabsq $2325069237881678925, %rcx ## imm = 0x20444E2732202C4D
29 ; CORE2-NEXT: movabsq $4706902966564560965, %rdx ## imm = 0x4152474F52502045
30 ; CORE2-NEXT: movabsq $5642821575076104260, %rsi ## imm = 0x4E4F545359524844
31 ; CORE2-NEXT: .p2align 4, 0x90
32 ; CORE2-NEXT: LBB0_1: ## %bb
33 ; CORE2-NEXT: ## =>This Inner Loop Header: Depth=1
34 ; CORE2-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
35 ; CORE2-NEXT: movq %rcx, -{{[0-9]+}}(%rsp)
36 ; CORE2-NEXT: movq %rdx, -{{[0-9]+}}(%rsp)
37 ; CORE2-NEXT: movq %rsi, -{{[0-9]+}}(%rsp)
38 ; CORE2-NEXT: jmp LBB0_1
39 ;
40 ; COREI7-LABEL: func:
41 ; COREI7: ## %bb.0: ## %entry
42 ; COREI7-NEXT: movups _.str3+{{.*}}(%rip), %xmm0
43 ; COREI7-NEXT: movups {{.*}}(%rip), %xmm1
44 ; COREI7-NEXT: .p2align 4, 0x90
45 ; COREI7-NEXT: LBB0_1: ## %bb
46 ; COREI7-NEXT: ## =>This Inner Loop Header: Depth=1
47 ; COREI7-NEXT: movups %xmm0, -{{[0-9]+}}(%rsp)
48 ; COREI7-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
49 ; COREI7-NEXT: jmp LBB0_1
850 entry:
951 %String2Loc = alloca [31 x i8], align 1
1052 br label %bb
1961 }
2062
2163 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
22
23 ; I386: calll {{_?}}memcpy
24
25 ; CORE2: movabsq
26 ; CORE2: movabsq
27 ; CORE2: movabsq
28
29 ; COREI7: movups _.str3
30
31 ; CORE2: .section
32 ; CORE2: .p2align 3
33 ; CORE2-NEXT: _.str1:
34 ; CORE2-NEXT: .asciz "DHRYSTONE PROGRAM, SOME STRING"
35 ; CORE2: .p2align 3
36 ; CORE2-NEXT: _.str3: