1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=early-machinelicm -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
3 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=early-machinelicm -o - %s | FileCheck -check-prefix=GCN %s
7 tracksRegLiveness: true
9 ; GCN-LABEL: name: hoist_move
11 ; GCN-NEXT: successors: %bb.1(0x80000000)
13 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
14 ; GCN-NEXT: S_BRANCH %bb.1
17 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
19 ; GCN-NEXT: $exec = S_OR_B64 $exec, 1, implicit-def $scc
20 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
21 ; GCN-NEXT: S_BRANCH %bb.2
24 ; GCN-NEXT: S_ENDPGM 0
29 %0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
30 $exec = S_OR_B64 $exec, 1, implicit-def $scc
31 S_CBRANCH_EXECNZ %bb.1, implicit $exec
39 tracksRegLiveness: true
41 ; GCN-LABEL: name: no_hoist_cmp
43 ; GCN-NEXT: successors: %bb.1(0x80000000)
45 ; GCN-NEXT: S_BRANCH %bb.1
48 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
50 ; GCN-NEXT: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
51 ; GCN-NEXT: $exec = S_OR_B64 $exec, [[V_CMP_EQ_U32_e64_]], implicit-def $scc
52 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
53 ; GCN-NEXT: S_BRANCH %bb.2
56 ; GCN-NEXT: S_ENDPGM 0
61 %0:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
62 $exec = S_OR_B64 $exec, %0:sreg_64, implicit-def $scc
63 S_CBRANCH_EXECNZ %bb.1, implicit $exec
70 name: allowable_hoist_cmp
71 tracksRegLiveness: true
73 ; GCN-LABEL: name: allowable_hoist_cmp
75 ; GCN-NEXT: successors: %bb.1(0x80000000)
77 ; GCN-NEXT: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
78 ; GCN-NEXT: S_BRANCH %bb.1
81 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
83 ; GCN-NEXT: $exec = S_AND_B64 $exec, [[V_CMP_EQ_U32_e64_]], implicit-def $scc
84 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
85 ; GCN-NEXT: S_BRANCH %bb.2
88 ; GCN-NEXT: S_ENDPGM 0
93 %0:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
94 $exec = S_AND_B64 $exec, %0:sreg_64, implicit-def $scc
95 S_CBRANCH_EXECNZ %bb.1, implicit $exec
102 name: no_hoist_readfirstlane
103 tracksRegLiveness: true
105 ; GCN-LABEL: name: no_hoist_readfirstlane
107 ; GCN-NEXT: successors: %bb.1(0x80000000)
109 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
110 ; GCN-NEXT: S_BRANCH %bb.1
113 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
115 ; GCN-NEXT: [[V_READFIRSTLANE_B32_:%[0-9]+]]:sgpr_32 = V_READFIRSTLANE_B32 [[DEF]], implicit $exec
116 ; GCN-NEXT: $exec = S_OR_B64 $exec, 1, implicit-def $scc
117 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
118 ; GCN-NEXT: S_BRANCH %bb.2
121 ; GCN-NEXT: S_ENDPGM 0
123 %0:vgpr_32 = IMPLICIT_DEF
127 %1:sgpr_32 = V_READFIRSTLANE_B32 %0:vgpr_32, implicit $exec
128 $exec = S_OR_B64 $exec, 1, implicit-def $scc
129 S_CBRANCH_EXECNZ %bb.1, implicit $exec