Skip to content

Commit 263a435

Browse files
committed
[AMDGPU] Add test for VALU hoisiting from WWM region. NFC.
The test demonstraits a suboptimal VALU hoisting from a WWM region. As a result we have 2 WWM regions instead of one.
1 parent 1e11314 commit 263a435

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2+
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -run-pass=early-machinelicm,si-wqm -o - %s | FileCheck -check-prefix=GCN %s
3+
4+
---
5+
name: licm_move_wwm
6+
tracksRegLiveness: true
7+
body: |
8+
; GCN-LABEL: name: licm_move_wwm
9+
; GCN: bb.0:
10+
; GCN-NEXT: successors: %bb.1(0x80000000)
11+
; GCN-NEXT: {{ $}}
12+
; GCN-NEXT: [[ENTER_STRICT_WWM:%[0-9]+]]:sreg_32 = ENTER_STRICT_WWM -1, implicit-def $exec, implicit-def $scc, implicit $exec
13+
; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
14+
; GCN-NEXT: $exec_lo = EXIT_STRICT_WWM [[ENTER_STRICT_WWM]]
15+
; GCN-NEXT: S_BRANCH %bb.1
16+
; GCN-NEXT: {{ $}}
17+
; GCN-NEXT: bb.1:
18+
; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
19+
; GCN-NEXT: {{ $}}
20+
; GCN-NEXT: [[ENTER_STRICT_WWM1:%[0-9]+]]:sreg_32 = ENTER_STRICT_WWM -1, implicit-def $exec, implicit-def $scc, implicit $exec
21+
; GCN-NEXT: [[V_READFIRSTLANE_B32_:%[0-9]+]]:sreg_32 = V_READFIRSTLANE_B32 [[V_MOV_B32_e32_]], implicit $exec
22+
; GCN-NEXT: $exec_lo = EXIT_STRICT_WWM [[ENTER_STRICT_WWM1]]
23+
; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY [[V_READFIRSTLANE_B32_]]
24+
; GCN-NEXT: $exec_lo = S_OR_B32 $exec_lo, [[COPY]], implicit-def $scc
25+
; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
26+
; GCN-NEXT: S_BRANCH %bb.2
27+
; GCN-NEXT: {{ $}}
28+
; GCN-NEXT: bb.2:
29+
; GCN-NEXT: S_ENDPGM 0
30+
bb.0:
31+
S_BRANCH %bb.1
32+
33+
bb.1:
34+
%0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
35+
%1:sreg_32 = V_READFIRSTLANE_B32 killed %0:vgpr_32, implicit $exec
36+
early-clobber %2:sreg_32 = STRICT_WWM killed %1:sreg_32, implicit $exec
37+
$exec_lo = S_OR_B32 $exec_lo, %2, implicit-def $scc
38+
S_CBRANCH_EXECNZ %bb.1, implicit $exec
39+
S_BRANCH %bb.2
40+
41+
bb.2:
42+
S_ENDPGM 0
43+
...

0 commit comments

Comments
 (0)