1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=machinelicm -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
6 tracksRegLiveness: true
8 ; GCN-LABEL: name: hoist_move
10 ; GCN-NEXT: successors: %bb.1(0x80000000)
12 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
13 ; GCN-NEXT: S_BRANCH %bb.1
16 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
18 ; GCN-NEXT: $exec = S_OR_B64 $exec, 1, implicit-def $scc
19 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
20 ; GCN-NEXT: S_BRANCH %bb.2
23 ; GCN-NEXT: S_ENDPGM 0
28 %0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
29 $exec = S_OR_B64 $exec, 1, implicit-def $scc
30 S_CBRANCH_EXECNZ %bb.1, implicit $exec
38 tracksRegLiveness: true
40 ; GCN-LABEL: name: no_hoist_cmp
42 ; GCN-NEXT: successors: %bb.1(0x80000000)
44 ; GCN-NEXT: S_BRANCH %bb.1
47 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
49 ; GCN-NEXT: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
50 ; GCN-NEXT: $exec = S_OR_B64 $exec, [[V_CMP_EQ_U32_e64_]], implicit-def $scc
51 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
52 ; GCN-NEXT: S_BRANCH %bb.2
55 ; GCN-NEXT: S_ENDPGM 0
60 %0:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
61 $exec = S_OR_B64 $exec, %0:sreg_64, implicit-def $scc
62 S_CBRANCH_EXECNZ %bb.1, implicit $exec
69 name: allowable_hoist_cmp
70 tracksRegLiveness: true
72 ; GCN-LABEL: name: allowable_hoist_cmp
74 ; GCN-NEXT: successors: %bb.1(0x80000000)
76 ; GCN-NEXT: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
77 ; GCN-NEXT: S_BRANCH %bb.1
80 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
82 ; GCN-NEXT: $exec = S_AND_B64 $exec, [[V_CMP_EQ_U32_e64_]], implicit-def $scc
83 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
84 ; GCN-NEXT: S_BRANCH %bb.2
87 ; GCN-NEXT: S_ENDPGM 0
92 %0:sreg_64 = V_CMP_EQ_U32_e64 1, 2, implicit $exec
93 $exec = S_AND_B64 $exec, %0:sreg_64, implicit-def $scc
94 S_CBRANCH_EXECNZ %bb.1, implicit $exec
101 name: no_hoist_readfirstlane
102 tracksRegLiveness: true
104 ; GCN-LABEL: name: no_hoist_readfirstlane
106 ; GCN-NEXT: successors: %bb.1(0x80000000)
108 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
109 ; GCN-NEXT: S_BRANCH %bb.1
112 ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
114 ; GCN-NEXT: [[V_READFIRSTLANE_B32_:%[0-9]+]]:sgpr_32 = V_READFIRSTLANE_B32 [[DEF]], implicit $exec
115 ; GCN-NEXT: $exec = S_OR_B64 $exec, 1, implicit-def $scc
116 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.1, implicit $exec
117 ; GCN-NEXT: S_BRANCH %bb.2
120 ; GCN-NEXT: S_ENDPGM 0
122 %0:vgpr_32 = IMPLICIT_DEF
126 %1:sgpr_32 = V_READFIRSTLANE_B32 %0:vgpr_32, implicit $exec
127 $exec = S_OR_B64 $exec, 1, implicit-def $scc
128 S_CBRANCH_EXECNZ %bb.1, implicit $exec