blob: 187650ff9a5370938ccd28ad74e06cad9781ed0a [file] [log] [blame]
Tom Stellard49f8bfd2015-01-06 18:00:21 +00001; RUN: llc -march=amdgcn -mcpu=SI < %s | FileCheck -check-prefix=SI %s
Marek Olsak75170772015-01-27 17:27:15 +00002; RUN: llc -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=SI %s
Matt Arsenaultd2c9e082014-07-07 18:34:45 +00003
Tom Stellard79243d92014-10-01 17:15:17 +00004; SI-LABEL: {{^}}no_reorder_v2f64_global_load_store:
Tom Stellard326d6ec2014-11-05 14:50:53 +00005; SI: buffer_load_dwordx2
6; SI: buffer_load_dwordx2
7; SI: buffer_load_dwordx2
8; SI: buffer_load_dwordx2
9; SI: buffer_store_dwordx2
10; SI: buffer_store_dwordx2
11; SI: buffer_store_dwordx2
12; SI: buffer_store_dwordx2
13; SI: s_endpgm
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000014define void @no_reorder_v2f64_global_load_store(<2 x double> addrspace(1)* nocapture %x, <2 x double> addrspace(1)* nocapture %y) nounwind {
David Blaikiea79ac142015-02-27 21:17:42 +000015 %tmp1 = load <2 x double>, <2 x double> addrspace(1)* %x, align 16
16 %tmp4 = load <2 x double>, <2 x double> addrspace(1)* %y, align 16
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000017 store <2 x double> %tmp4, <2 x double> addrspace(1)* %x, align 16
18 store <2 x double> %tmp1, <2 x double> addrspace(1)* %y, align 16
19 ret void
20}
21
Tom Stellard79243d92014-10-01 17:15:17 +000022; SI-LABEL: {{^}}no_reorder_scalarized_v2f64_local_load_store:
Tom Stellard326d6ec2014-11-05 14:50:53 +000023; SI: ds_read_b64
24; SI: ds_read_b64
25; SI: ds_write_b64
26; SI: ds_write_b64
27; SI: s_endpgm
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000028define void @no_reorder_scalarized_v2f64_local_load_store(<2 x double> addrspace(3)* nocapture %x, <2 x double> addrspace(3)* nocapture %y) nounwind {
David Blaikiea79ac142015-02-27 21:17:42 +000029 %tmp1 = load <2 x double>, <2 x double> addrspace(3)* %x, align 16
30 %tmp4 = load <2 x double>, <2 x double> addrspace(3)* %y, align 16
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000031 store <2 x double> %tmp4, <2 x double> addrspace(3)* %x, align 16
32 store <2 x double> %tmp1, <2 x double> addrspace(3)* %y, align 16
33 ret void
34}
35
Tom Stellard79243d92014-10-01 17:15:17 +000036; SI-LABEL: {{^}}no_reorder_split_v8i32_global_load_store:
Tom Stellard326d6ec2014-11-05 14:50:53 +000037; SI: buffer_load_dword
38; SI: buffer_load_dword
39; SI: buffer_load_dword
40; SI: buffer_load_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000041
Tom Stellard326d6ec2014-11-05 14:50:53 +000042; SI: buffer_load_dword
43; SI: buffer_load_dword
44; SI: buffer_load_dword
45; SI: buffer_load_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000046
Tom Stellard326d6ec2014-11-05 14:50:53 +000047; SI: buffer_load_dword
48; SI: buffer_load_dword
49; SI: buffer_load_dword
50; SI: buffer_load_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000051
Tom Stellard326d6ec2014-11-05 14:50:53 +000052; SI: buffer_load_dword
53; SI: buffer_load_dword
54; SI: buffer_load_dword
55; SI: buffer_load_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000056
57
Tom Stellard326d6ec2014-11-05 14:50:53 +000058; SI: buffer_store_dword
59; SI: buffer_store_dword
60; SI: buffer_store_dword
61; SI: buffer_store_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000062
Tom Stellard326d6ec2014-11-05 14:50:53 +000063; SI: buffer_store_dword
64; SI: buffer_store_dword
65; SI: buffer_store_dword
66; SI: buffer_store_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000067
Tom Stellard326d6ec2014-11-05 14:50:53 +000068; SI: buffer_store_dword
69; SI: buffer_store_dword
70; SI: buffer_store_dword
71; SI: buffer_store_dword
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000072
Tom Stellard326d6ec2014-11-05 14:50:53 +000073; SI: buffer_store_dword
74; SI: buffer_store_dword
75; SI: buffer_store_dword
76; SI: buffer_store_dword
77; SI: s_endpgm
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000078define void @no_reorder_split_v8i32_global_load_store(<8 x i32> addrspace(1)* nocapture %x, <8 x i32> addrspace(1)* nocapture %y) nounwind {
David Blaikiea79ac142015-02-27 21:17:42 +000079 %tmp1 = load <8 x i32>, <8 x i32> addrspace(1)* %x, align 32
80 %tmp4 = load <8 x i32>, <8 x i32> addrspace(1)* %y, align 32
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000081 store <8 x i32> %tmp4, <8 x i32> addrspace(1)* %x, align 32
82 store <8 x i32> %tmp1, <8 x i32> addrspace(1)* %y, align 32
83 ret void
84}
85
Tom Stellard79243d92014-10-01 17:15:17 +000086; SI-LABEL: {{^}}no_reorder_extload_64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000087; SI: ds_read_b64
88; SI: ds_read_b64
89; SI: ds_write_b64
90; SI-NOT: ds_read
91; SI: ds_write_b64
92; SI: s_endpgm
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000093define void @no_reorder_extload_64(<2 x i32> addrspace(3)* nocapture %x, <2 x i32> addrspace(3)* nocapture %y) nounwind {
David Blaikiea79ac142015-02-27 21:17:42 +000094 %tmp1 = load <2 x i32>, <2 x i32> addrspace(3)* %x, align 8
95 %tmp4 = load <2 x i32>, <2 x i32> addrspace(3)* %y, align 8
Matt Arsenaultd2c9e082014-07-07 18:34:45 +000096 %tmp1ext = zext <2 x i32> %tmp1 to <2 x i64>
97 %tmp4ext = zext <2 x i32> %tmp4 to <2 x i64>
98 %tmp7 = add <2 x i64> %tmp1ext, <i64 1, i64 1>
99 %tmp9 = add <2 x i64> %tmp4ext, <i64 1, i64 1>
100 %trunctmp9 = trunc <2 x i64> %tmp9 to <2 x i32>
101 %trunctmp7 = trunc <2 x i64> %tmp7 to <2 x i32>
102 store <2 x i32> %trunctmp9, <2 x i32> addrspace(3)* %x, align 8
103 store <2 x i32> %trunctmp7, <2 x i32> addrspace(3)* %y, align 8
104 ret void
105}