Skip to content

Commit 7501423

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 676cfcb commit 7501423

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

llvm/test/CodeGen/AMDGPU/licm-wwm.mir

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
# Machine LICM may hoist an intruction from a WWM region, which will force SI-WQM pass
5+
# to create a second WWM region. This is an unwanted hoisting.
6+
7+
---
8+
name: licm_move_wwm
9+
tracksRegLiveness: true
10+
body: |
11+
; GCN-LABEL: name: licm_move_wwm
12+
; GCN: bb.0:
13+
; GCN-NEXT: successors: %bb.1(0x80000000)
14+
; GCN-NEXT: {{ $}}
15+
; GCN-NEXT: [[ENTER_STRICT_WWM:%[0-9]+]]:sreg_32 = ENTER_STRICT_WWM -1, implicit-def $exec, implicit-def $scc, implicit $exec
16+
; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
17+
; GCN-NEXT: $exec_lo = EXIT_STRICT_WWM [[ENTER_STRICT_WWM]]
18+
; GCN-NEXT: S_BRANCH %bb.1
19+
; GCN-NEXT: {{ $}}
20+
; GCN-NEXT: bb.1:
21+
; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
22+
; GCN-NEXT: {{ $}}
23+
; GCN-NEXT: [[ENTER_STRICT_WWM1:%[0-9]+]]:sreg_32 = ENTER_STRICT_WWM -1, implicit-def $exec, implicit-def $scc, implicit $exec
24+
; GCN-NEXT: [[V_READFIRSTLANE_B32_:%[0-9]+]]:sreg_32 = V_READFIRSTLANE_B32 [[V_MOV_B32_e32_]], implicit $exec
25+
; GCN-NEXT: $exec_lo = EXIT_STRICT_WWM [[ENTER_STRICT_WWM1]]
26+
; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY [[V_READFIRSTLANE_B32_]]
27+
; GCN-NEXT: $exec_lo = S_OR_B32 $exec_lo, [[COPY]], implicit-def $scc
28+
; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
29+
; GCN-NEXT: S_BRANCH %bb.2
30+
; GCN-NEXT: {{ $}}
31+
; GCN-NEXT: bb.2:
32+
; GCN-NEXT: S_ENDPGM 0
33+
bb.0:
34+
S_BRANCH %bb.1
35+
36+
bb.1:
37+
%0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
38+
%1:sreg_32 = V_READFIRSTLANE_B32 killed %0:vgpr_32, implicit $exec
39+
early-clobber %2:sreg_32 = STRICT_WWM killed %1:sreg_32, implicit $exec
40+
$exec_lo = S_OR_B32 $exec_lo, %2, implicit-def $scc
41+
S_CBRANCH_EXECNZ %bb.1, implicit $exec
42+
S_BRANCH %bb.2
43+
44+
bb.2:
45+
S_ENDPGM 0
46+
...

0 commit comments

Comments
 (0)