File: schedule-regpressure-limit-clustering.ll

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (45 lines) | stat: -rw-r--r-- 1,723 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s

; Interleave loads and stores to fit into 9 VGPR limit.
; This requires to avoid load/store clustering.

; Reschedule the second scheduling region without clustering while
; the first region is skipped.

; GCN: global_load_dwordx4
; GCN: global_store_dwordx4
; GCN: global_load_dwordx4
; GCN: global_store_dwordx4
; GCN: global_load_dwordx4
; GCN: global_store_dwordx4
; GCN: NumVgprs: {{[0-9]$}}
; GCN: ScratchSize: 0{{$}}

define amdgpu_kernel void @load_store_max_9vgprs(ptr addrspace(1) nocapture noalias readonly %arg, ptr addrspace(1) nocapture noalias %arg1, i1 %cnd) #1 {
bb:
  %id = call i32 @llvm.amdgcn.workitem.id.x()
  %base = getelementptr inbounds <4 x i32>, ptr addrspace(1) %arg, i32 %id
  br i1 %cnd, label %bb1, label %bb2

bb1:
  %tmp = getelementptr inbounds <4 x i32>, ptr addrspace(1) %base, i32 1
  %tmp2 = load <4 x i32>, ptr addrspace(1) %tmp, align 4
  %tmp3 = getelementptr inbounds <4 x i32>, ptr addrspace(1) %base, i32 3
  %tmp4 = load <4 x i32>, ptr addrspace(1) %tmp3, align 4
  %tmp5 = getelementptr inbounds <4 x i32>, ptr addrspace(1) %base, i32 5
  %tmp6 = load <4 x i32>, ptr addrspace(1) %tmp5, align 4
  store <4 x i32> %tmp2, ptr addrspace(1) %arg1, align 4
  %tmp7 = getelementptr inbounds <4 x i32>, ptr addrspace(1) %arg1, i64 3
  store <4 x i32> %tmp4, ptr addrspace(1) %tmp7, align 4
  %tmp8 = getelementptr inbounds <4 x i32>, ptr addrspace(1) %arg1, i64 5
  store <4 x i32> %tmp6, ptr addrspace(1) %tmp8, align 4
  br label %bb2

bb2:
  ret void
}

declare i32 @llvm.amdgcn.workitem.id.x() #0

attributes #0 = { nounwind readnone }
attributes #1 = { "amdgpu-num-vgpr"="9" }