blob: f73d303056492c6428e1e8ab734d560ed3ee409e [file] [log] [blame]
Matt Arsenaultc10853f2014-08-06 00:29:43 +00001; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC -check-prefix=SI %s
2
3
4declare i32 @llvm.r600.read.tidig.x() #1
5
6; FIXME: This currently doesn't do a great job of clustering the
7; loads, which end up with extra moves between them. Right now, it
8; seems the only things areLoadsFromSameBasePtr is accomplishing is
9; ordering the loads so that the lower address loads come first.
10
11; FUNC-LABEL: @cluster_global_arg_loads
12; SI: BUFFER_LOAD_DWORD [[REG0:v[0-9]+]], v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, 0 addr64
13; SI: BUFFER_LOAD_DWORD [[REG1:v[0-9]+]], v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, 0 addr64 offset:0x4
14; SI: BUFFER_STORE_DWORD [[REG0]]
15; SI: BUFFER_STORE_DWORD [[REG1]]
16define void @cluster_global_arg_loads(i32 addrspace(1)* %out0, i32 addrspace(1)* %out1, i32 addrspace(1)* %ptr) #0 {
17 %load0 = load i32 addrspace(1)* %ptr, align 4
18 %gep = getelementptr i32 addrspace(1)* %ptr, i32 1
19 %load1 = load i32 addrspace(1)* %gep, align 4
20 store i32 %load0, i32 addrspace(1)* %out0, align 4
21 store i32 %load1, i32 addrspace(1)* %out1, align 4
22 ret void
23}
24
25attributes #0 = { nounwind }
26attributes #1 = { nounwind readnone }