blob: 3c01adbb83fff47f4520586b4b5bfda73631c6df [file] [log] [blame]
Clement Courbet203fc172017-04-21 09:20:50 +00001; RUN: llc -mtriple=x86_64-linux-gnu -mattr=-ermsb < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOFAST
2; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+ermsb < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=FAST
Clement Courbeta7c233f2017-04-21 09:20:44 +00003; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=haswell < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=HASWELL
4; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=generic < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=GENERIC
Clement Courbet1ce3b822017-04-21 09:20:39 +00005
6%struct.large = type { [4096 x i8] }
7
8declare void @foo(%struct.large* align 8 byval) nounwind
9
10define void @test1(%struct.large* nocapture %x) nounwind {
11 call void @foo(%struct.large* align 8 byval %x)
12 ret void
13
14; ALL-LABEL: test1:
15; NOFAST: rep;movsq
Clement Courbeta7c233f2017-04-21 09:20:44 +000016; GENERIC: rep;movsq
Clement Courbet1ce3b822017-04-21 09:20:39 +000017; FAST: rep;movsb
Clement Courbeta7c233f2017-04-21 09:20:44 +000018; HASWELL: rep;movsb
Clement Courbet1ce3b822017-04-21 09:20:39 +000019}
Clement Courbetd5f61822017-04-21 09:20:55 +000020
21define void @test2(%struct.large* nocapture %x) nounwind minsize {
22 call void @foo(%struct.large* align 8 byval %x)
23 ret void
24
25; ALL-LABEL: test2:
26; NOFAST: rep;movsq
27; GENERIC: rep;movsq
28; FAST: rep;movsb
29; HASWELL: rep;movsb
30}
31
32%struct.large_oddsize = type { [4095 x i8] }
33
34declare void @foo_oddsize(%struct.large_oddsize* align 8 byval) nounwind
35
36define void @test3(%struct.large_oddsize* nocapture %x) nounwind minsize {
37 call void @foo_oddsize(%struct.large_oddsize* align 8 byval %x)
38 ret void
39
40; ALL-LABEL: test3:
41; NOFAST: rep;movsb
42; GENERIC: rep;movsb
43; FAST: rep;movsb
44; HASWELL: rep;movsb
45}