File: fix-wwm-vgpr-copy.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (47 lines) | stat: -rw-r--r-- 1,576 bytes parent folder | download | duplicates (4)
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
46
47
; RUN: llc -mtriple=amdgcn--amdpal -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s

declare i64 @llvm.amdgcn.icmp.i32(i32, i32, i32) #0
declare i32 @llvm.amdgcn.set.inactive.i32(i32, i32) #0
declare i32 @llvm.amdgcn.wwm.i32(i32) #1
declare void @llvm.amdgcn.tbuffer.store.f32(float, <4 x i32>, i32, i32, i32, i32, i32, i32, i1, i1) #2
declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #2

define amdgpu_hs void @foo(i32 inreg %arg, <4 x i32> inreg %buffer) {
entry:
  br label %work

bb42:
  br label %bb602

bb602:
  %tmp603 = phi i32 [ 0, %bb42 ], [ 1, %work ]
  %tmp607 = icmp eq i32 %tmp603, %tmp1196
  br i1 %tmp607, label %bb49, label %bb54

bb49:
  tail call void @llvm.amdgcn.tbuffer.store.f32(float 1.000000e+00, <4 x i32> %buffer, i32 0, i32 1, i32 1, i32 4, i32 4, i32 7, i1 true, i1 false) #7
  ret void

bb54:
  ret void

work:
; GCN: s_not_b64 exec, exec
; GCN: v_mov_b32_e32 v[[tmp1189:[0-9]+]], 1
; GCN: s_not_b64 exec, exec
  %tmp1189 = tail call i32 @llvm.amdgcn.set.inactive.i32(i32 4, i32 1)

; GCN: s_or_saveexec_b64 s{{\[}}[[LO:[0-9]+]]:[[HI:[0-9]+]]{{\]}}, -1
; GCN: v_lshlrev_b32_e32 v[[tmp1191:[0-9]+]], 2, v[[tmp1189]]
  %tmp1191 = mul i32 %tmp1189, 4

; GCN: s_mov_b64 exec, s{{\[}}[[LO]]:[[HI]]{{\]}}
  %tmp1196 = tail call i32 @llvm.amdgcn.wwm.i32(i32 %tmp1191)

  %tmp34 = icmp eq i32 %arg, 0
  br i1 %tmp34, label %bb602, label %bb42
}

attributes #0 = { convergent nounwind readnone }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { nounwind writeonly }