# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=peephole-opt --verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s --- name: and_1_cmp_eq_u32_1 body: | ; GCN-LABEL: name: and_1_cmp_eq_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_u32_1_used_and body: | ; GCN-LABEL: name: and_1_cmp_eq_u32_1_used_and ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_NOP 0, implicit [[S_AND_B32_]] ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_NOP 0, implicit %1 S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_i32_1 body: | ; GCN-LABEL: name: and_1_cmp_eq_i32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_I32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_i32_1_phys body: | ; GCN-LABEL: name: and_1_cmp_eq_i32_1_phys ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: $sgpr2 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_EQ_I32 killed $sgpr2, 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 $sgpr2 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_I32 killed $sgpr2, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_i32_1_different_blocks body: | ; GCN-LABEL: name: and_1_cmp_eq_i32_1_different_blocks ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x80000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: S_CMP_EQ_I32 [[S_AND_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: successors: %bb.3(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.3: ; GCN-NEXT: S_ENDPGM 0 bb.0: liveins: $sgpr0, $vgpr0_vgpr1 successors: %bb.1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc bb.1: successors: %bb.2, %bb.1 S_CMP_EQ_I32 %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.2: successors: %bb.3 bb.3: S_ENDPGM 0 ... --- name: and_3_cmp_eq_1 body: | ; GCN-LABEL: name: and_3_cmp_eq_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 3, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_AND_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 3, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: commuted_and_1_cmp_eq_1 body: | ; GCN-LABEL: name: commuted_and_1_cmp_eq_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 killed %0, 1, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: cmp_eq_1_undef_src body: | ; GCN-LABEL: name: cmp_eq_1_undef_src ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_CMP_EQ_U32 undef %1:sreg_32, 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 S_CMP_EQ_U32 undef %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_subreg0_eq_1 body: | ; GCN-LABEL: name: and_1_cmp_subreg0_eq_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[S_AND_B32_]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1 ; GCN-NEXT: S_CMP_EQ_U32 killed [[REG_SEQUENCE]].sub0, 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc %2:sreg_64 = REG_SEQUENCE %1, %subreg.sub0, %1, %subreg.sub1 S_CMP_EQ_U32 killed %2.sub0:sreg_64, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_reg_cmp_eq_1 body: | ; GCN-LABEL: name: and_reg_cmp_eq_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 killed [[COPY]], killed [[COPY1]], implicit-def dead $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_AND_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $sgpr1, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = COPY $sgpr1 %2:sreg_32 = S_AND_B32 killed %0, killed %1, implicit-def dead $scc S_CMP_EQ_U32 killed %2:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_1_killed_scc body: | ; GCN-LABEL: name: and_1_cmp_eq_1_killed_scc ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_NOP 0, implicit $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def $scc S_NOP 0, implicit killed $scc S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: xor_1_cmp_lg_0_killed_scc body: | ; GCN-LABEL: name: xor_1_cmp_lg_0_killed_scc ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 1, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_NOP 0, implicit $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_XOR_B32 1, killed %0, implicit-def $scc S_NOP 0, implicit killed $scc S_CMP_LG_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: absdiff_1_cmp_lg_0_killed_scc body: | ; GCN-LABEL: name: absdiff_1_cmp_lg_0_killed_scc ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_ABSDIFF_I32_:%[0-9]+]]:sreg_32 = S_ABSDIFF_I32 1, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_NOP 0, implicit $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_ABSDIFF_I32 1, killed %0, implicit-def $scc S_NOP 0, implicit killed $scc S_CMP_LG_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_1_clobbered_scc body: | ; GCN-LABEL: name: and_1_cmp_eq_1_clobbered_scc ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_NOP 0, implicit-def $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_AND_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def $scc S_NOP 0, implicit-def $scc S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_2 body: | ; GCN-LABEL: name: and_1_cmp_eq_2 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_AND_B32_]], 2, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 2, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: or_1_cmp_eq_u32_1 body: | ; GCN-LABEL: name: or_1_cmp_eq_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_OR_B32_:%[0-9]+]]:sreg_32 = S_OR_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_OR_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_OR_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_ge_u32_1 body: | ; GCN-LABEL: name: and_1_cmp_ge_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GE_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_ge_i32_1 body: | ; GCN-LABEL: name: and_1_cmp_ge_i32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GE_I32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_gt_u32_0 body: | ; GCN-LABEL: name: and_1_cmp_gt_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GT_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_gt_i32_0 body: | ; GCN-LABEL: name: and_1_cmp_gt_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GT_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_gt_1 body: | ; GCN-LABEL: name: and_1_cmp_gt_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_GT_U32 killed [[S_AND_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GT_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_lg_u32_0 body: | ; GCN-LABEL: name: and_1_cmp_lg_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_LG_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_lg_i32_0 body: | ; GCN-LABEL: name: and_1_cmp_lg_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_LG_I32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_u64_1 body: | ; GCN-LABEL: name: and_1_cmp_eq_u64_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP1_B64 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 1, killed %0, implicit-def dead $scc S_CMP_EQ_U64 killed %1:sreg_64, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_lg_u64_0 body: | ; GCN-LABEL: name: and_1_cmp_lg_u64_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP1_B64 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 1, killed %0, implicit-def dead $scc S_CMP_LG_U64 killed %1:sreg_64, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_eq_u32_1 body: | ; GCN-LABEL: name: and_1_cmpk_eq_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_EQ_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_eq_i32_1 body: | ; GCN-LABEL: name: and_1_cmpk_eq_i32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_EQ_I32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_ge_u32_1 body: | ; GCN-LABEL: name: and_1_cmpk_ge_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_GE_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_ge_i32_1 body: | ; GCN-LABEL: name: and_1_cmpk_ge_i32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_GE_I32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_lg_u32_0 body: | ; GCN-LABEL: name: and_1_cmpk_lg_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_LG_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_lg_i32_0 body: | ; GCN-LABEL: name: and_1_cmpk_lg_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_LG_I32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_gt_u32_0 body: | ; GCN-LABEL: name: and_1_cmpk_gt_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_GT_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmpk_gt_i32_0 body: | ; GCN-LABEL: name: and_1_cmpk_gt_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMPK_GT_I32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_u32_1_imm_src body: | ; GCN-LABEL: name: and_1_cmp_eq_u32_1_imm_src ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: S_BITCMP1_B32 11, 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = S_AND_B32 1, 11, implicit-def dead $scc S_CMP_EQ_U32 killed %0:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_u32_0 body: | ; GCN-LABEL: name: and_1_cmp_eq_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP0_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_i32_0 body: | ; GCN-LABEL: name: and_1_cmp_eq_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP0_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_I32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_u64_0 body: | ; GCN-LABEL: name: and_1_cmp_eq_u64_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP0_B64 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 1, killed %0, implicit-def dead $scc S_CMP_EQ_U64 killed %1:sreg_64, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_lg_u32_1 body: | ; GCN-LABEL: name: and_1_cmp_lg_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP0_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_LG_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_lg_i32_1 body: | ; GCN-LABEL: name: and_1_cmp_lg_i32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP0_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_LG_I32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_lg_u64_1 body: | ; GCN-LABEL: name: and_1_cmp_lg_u64_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP0_B64 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 1, killed %0, implicit-def dead $scc S_CMP_LG_U64 killed %1:sreg_64, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_eq_u32_0_used_and body: | ; GCN-LABEL: name: and_1_cmp_eq_u32_0_used_and ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC1 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: S_NOP 0, implicit [[S_AND_B32_]] ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_EQ_U32 %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 S_NOP 0, implicit %1 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_ge_u32_0 body: | ; GCN-LABEL: name: and_1_cmp_ge_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_GE_U32 killed [[S_AND_B32_]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GE_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_cmp_gt_u32_1 body: | ; GCN-LABEL: name: and_1_cmp_gt_u32_1 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 1, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_GT_U32 killed [[S_AND_B32_]], 1, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1, killed %0, implicit-def dead $scc S_CMP_GT_U32 killed %1:sreg_32, 1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_folded_src0_cmp_eq_u32_1_folded_src2 body: | ; GCN-LABEL: name: and_1_folded_src0_cmp_eq_u32_1_folded_src2 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 1 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_MOV_B32 1 %2:sreg_32 = S_AND_B32 %1, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %2:sreg_32, %1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_folded_src1_cmp_eq_u32_1_folded_src2 body: | ; GCN-LABEL: name: and_1_folded_src1_cmp_eq_u32_1_folded_src2 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 1 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_MOV_B32 1 %2:sreg_32 = S_AND_B32 killed %0, %1, implicit-def dead $scc S_CMP_EQ_U32 killed %2:sreg_32, %1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1_folded_src1_cmp_eq_u64_1_folded_src2 body: | ; GCN-LABEL: name: and_1_folded_src1_cmp_eq_u64_1_folded_src2 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: [[S_MOV_B64_:%[0-9]+]]:sreg_64 = S_MOV_B64 1 ; GCN-NEXT: S_BITCMP1_B64 killed [[COPY]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_MOV_B64 1 %2:sreg_64 = S_AND_B64 killed %0, %1, implicit-def dead $scc S_CMP_EQ_U64 killed %2:sreg_64, %1, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1024_cmp_eq_u32_1024 body: | ; GCN-LABEL: name: and_1024_cmp_eq_u32_1024 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 10, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1024, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 1024, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_eq_u32_0x80000000 body: | ; GCN-LABEL: name: and_0x80000000_cmp_eq_u32_0x80000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 31, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 2147483648, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_ge_u32_0x80000000 body: | ; GCN-LABEL: name: and_0x80000000_cmp_ge_u32_0x80000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 31, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_GE_U32 killed %1:sreg_32, 2147483648, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_ge_i32_0x80000000 body: | ; GCN-LABEL: name: and_0x80000000_cmp_ge_i32_0x80000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 2147483648, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_GE_I32 killed [[S_AND_B32_]], 2147483648, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_GE_I32 killed %1:sreg_32, 2147483648, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_1024_cmp_ge_i32_1024 body: | ; GCN-LABEL: name: and_1024_cmp_ge_i32_1024 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 10, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 1024, killed %0, implicit-def dead $scc S_CMP_GE_I32 killed %1:sreg_32, 1024, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_lg_i32_0 body: | ; GCN-LABEL: name: and_0x80000000_cmp_lg_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 31, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_LG_I32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_gt_i32_0 body: | ; GCN-LABEL: name: and_0x80000000_cmp_gt_i32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 2147483648, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_GT_I32 killed [[S_AND_B32_]], 0, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_GT_I32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_gt_u32_0 body: | ; GCN-LABEL: name: and_0x80000000_cmp_gt_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 31, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_GT_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_eq_u64_0x80000000 body: | ; GCN-LABEL: name: and_0x80000000_cmp_eq_u64_0x80000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP1_B64 killed [[COPY]], 35, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 34359738368, killed %0, implicit-def dead $scc S_CMP_EQ_U64 killed %1:sreg_64, 34359738368, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x8000000000000000_cmp_eq_u64_0x8000000000000000 body: | ; GCN-LABEL: name: and_0x8000000000000000_cmp_eq_u64_0x8000000000000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP1_B64 killed [[COPY]], 63, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 9223372036854775808, killed %0, implicit-def dead $scc S_CMP_EQ_U64 killed %1:sreg_64, 9223372036854775808, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_2_cmp_eq_u32_2_used_and body: | ; GCN-LABEL: name: and_2_cmp_eq_u32_2_used_and ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 2, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: S_NOP 0, implicit [[S_AND_B32_]] ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2, killed %0, implicit-def dead $scc S_CMP_EQ_U32 %1:sreg_32, 2, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 S_NOP 0, implicit %1 bb.2: S_ENDPGM 0 ... --- name: and_3_cmp_eq_u32_3 body: | ; GCN-LABEL: name: and_3_cmp_eq_u32_3 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 3, killed [[COPY]], implicit-def dead $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_AND_B32_]], 3, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 3, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 3, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_3_cmp_lg_u32_0 body: | ; GCN-LABEL: name: and_3_cmp_lg_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 3, killed [[COPY]], implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 3, killed %0, implicit-def dead $scc S_CMP_LG_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_4_cmp_lg_u32_0 body: | ; GCN-LABEL: name: and_4_cmp_lg_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP1_B32 killed [[COPY]], 2, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 4, killed %0, implicit-def dead $scc S_CMP_LG_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x80000000_cmp_eq_u32_0 body: | ; GCN-LABEL: name: and_0x80000000_cmp_eq_u32_0 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_BITCMP0_B32 killed [[COPY]], 31, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0, $vgpr0_vgpr1 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_AND_B32 2147483648, killed %0, implicit-def dead $scc S_CMP_EQ_U32 killed %1:sreg_32, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: and_0x8000000000000000_cmp_lg_u64_0x8000000000000000 body: | ; GCN-LABEL: name: and_0x8000000000000000_cmp_lg_u64_0x8000000000000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1 ; GCN-NEXT: S_BITCMP0_B64 killed [[COPY]], 63, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0_sgpr1, $vgpr0_vgpr1 %0:sreg_64 = COPY $sgpr0_sgpr1 %1:sreg_64 = S_AND_B64 9223372036854775808, killed %0, implicit-def dead $scc S_CMP_LG_U64 killed %1:sreg_64, 9223372036854775808, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: s_cselect_b64_s_or_b32_s_cmp_lg_u32_0x00000000 body: | ; GCN-LABEL: name: s_cselect_b64_s_or_b32_s_cmp_lg_u32_0x00000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_CMP_LG_U32 [[COPY]], 0, implicit-def $scc ; GCN-NEXT: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 -1, 0, implicit $scc ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32_xm0_xexec = COPY [[S_CSELECT_B64_]].sub0 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec = COPY [[S_CSELECT_B64_]].sub1 ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0 %2:sreg_32 = COPY $sgpr0 S_CMP_LG_U32 %2, 0, implicit-def $scc %31:sreg_64_xexec = S_CSELECT_B64 -1, 0, implicit $scc %40:sreg_32_xm0_xexec = COPY %31.sub0:sreg_64_xexec %41:sreg_32_xm0_xexec = COPY %31.sub1:sreg_64_xexec %sgpr4:sreg_32 = S_OR_B32 %40:sreg_32_xm0_xexec, %41:sreg_32_xm0_xexec, implicit-def $scc S_CMP_LG_U32 %sgpr4, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- # Do not delete s_or_b32 because of intervening def of scc name: s_cselect_b64_s_or_b32_s_cmp_lg_u32_0x00000000_cant_optimize_intervening body: | ; GCN-LABEL: name: s_cselect_b64_s_or_b32_s_cmp_lg_u32_0x00000000_cant_optimize_intervening ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_CMP_LG_U32 [[COPY]], 0, implicit-def $scc ; GCN-NEXT: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 -1, 0, implicit $scc ; GCN-NEXT: S_CMP_LG_U32 [[COPY]], 0, implicit-def $scc ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32_xm0_xexec = COPY [[S_CSELECT_B64_]].sub0 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec = COPY [[S_CSELECT_B64_]].sub1 ; GCN-NEXT: %sgpr4:sreg_32 = S_OR_B32 [[COPY1]], [[COPY2]], implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0 %2:sreg_32 = COPY $sgpr0 S_CMP_LG_U32 %2, 0, implicit-def $scc %31:sreg_64_xexec = S_CSELECT_B64 -1, 0, implicit $scc S_CMP_LG_U32 %2, 0, implicit-def $scc %40:sreg_32_xm0_xexec = COPY %31.sub0:sreg_64_xexec %41:sreg_32_xm0_xexec = COPY %31.sub1:sreg_64_xexec %sgpr4:sreg_32 = S_OR_B32 %40:sreg_32_xm0_xexec, %41:sreg_32_xm0_xexec, implicit-def $scc S_CMP_LG_U32 %sgpr4, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- # Do not delete s_or_b32 since both operands are sub1. name: s_cselect_b64_s_or_b32_s_cmp_lg_u32_0x00000000_cant_optimize body: | ; GCN-LABEL: name: s_cselect_b64_s_or_b32_s_cmp_lg_u32_0x00000000_cant_optimize ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_CMP_LG_U32 [[COPY]], 0, implicit-def $scc ; GCN-NEXT: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 1, 0, implicit $scc ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32_xm0_xexec = COPY [[S_CSELECT_B64_]].sub1 ; GCN-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[S_CSELECT_B64_]].sub1 ; GCN-NEXT: %sgpr4:sreg_32 = S_OR_B32 [[COPY1]], [[COPY2]], implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0 %2:sreg_32 = COPY $sgpr0 S_CMP_LG_U32 %2, 0, implicit-def $scc %31:sreg_64_xexec = S_CSELECT_B64 1, 0, implicit $scc %40:sreg_32_xm0_xexec = COPY %31.sub1:sreg_64_xexec %41:sreg_32 = COPY %31.sub1:sreg_64_xexec %sgpr4:sreg_32 = S_OR_B32 %40:sreg_32_xm0_xexec, %41:sreg_32, implicit-def $scc S_CMP_LG_U32 %sgpr4, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... --- name: s_cselect_b64_undef_s_or_b32_s_cmp_lg_u32_0x00000000 body: | ; GCN-LABEL: name: s_cselect_b64_undef_s_or_b32_s_cmp_lg_u32_0x00000000 ; GCN: bb.0: ; GCN-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; GCN-NEXT: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: S_CMP_LG_U32 [[COPY]], 0, implicit-def $scc ; GCN-NEXT: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 -1, 0, implicit $scc ; GCN-NEXT: %sgpr4:sreg_32 = S_OR_B32 undef %3:sreg_32_xm0_xexec, undef %4:sreg_32_xm0_xexec, implicit-def $scc ; GCN-NEXT: S_CBRANCH_SCC0 %bb.2, implicit $scc ; GCN-NEXT: S_BRANCH %bb.1 ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.1: ; GCN-NEXT: successors: %bb.2(0x80000000) ; GCN-NEXT: {{ $}} ; GCN-NEXT: bb.2: ; GCN-NEXT: S_ENDPGM 0 bb.0: successors: %bb.1, %bb.2 liveins: $sgpr0 %2:sreg_32 = COPY $sgpr0 S_CMP_LG_U32 %2, 0, implicit-def $scc %31:sreg_64_xexec = S_CSELECT_B64 -1, 0, implicit $scc %sgpr4:sreg_32 = S_OR_B32 undef %40:sreg_32_xm0_xexec, undef %41:sreg_32_xm0_xexec, implicit-def $scc S_CMP_LG_U32 %sgpr4, 0, implicit-def $scc S_CBRANCH_SCC0 %bb.2, implicit $scc S_BRANCH %bb.1 bb.1: successors: %bb.2 bb.2: S_ENDPGM 0 ... # STARTT --- # Delete s_cmp after s_add_u32 X, 1 name: s_add_u32_X_1 body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_X_1 ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[COPY]], 1, implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_ADD_U32 %0, 1, implicit-def $scc S_CMP_EQ_U32 killed %1, 0, implicit-def $scc S_ENDPGM 0 ... --- # Delete s_cmp after s_add_u32 X, Y, where Y==1 name: s_add_u32_X_R1 body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_X_R1 ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 1 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_MOV_B32 1 %2:sreg_32 = S_ADD_U32 %0, %1, implicit-def $scc S_CMP_EQ_U32 killed %2, 0, implicit-def $scc S_ENDPGM 0 ... --- # Delete s_cmp after s_add_u32 1, X name: s_add_u32_1_X body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_1_X ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 1, [[COPY]], implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_ADD_U32 1, %0, implicit-def $scc S_CMP_EQ_U32 killed %1, 0, implicit-def $scc S_ENDPGM 0 ... --- # Delete s_cmp after s_add_u32 X, Y, where X==1 name: s_add_u32_R1_Y body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_R1_Y ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 1 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[S_MOV_B32_]], [[COPY]], implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_MOV_B32 1 %2:sreg_32 = S_ADD_U32 %1, %0, implicit-def $scc S_CMP_EQ_U32 killed %2, 0, implicit-def $scc S_ENDPGM 0 ... --- # Do not delete s_cmp after s_add_u32 X, 2 name: s_add_u32_X_2 body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_X_2 ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[COPY]], 2, implicit-def $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_ADD_U32_]], 0, implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_ADD_U32 %0, 2, implicit-def $scc S_CMP_EQ_U32 killed %1, 0, implicit-def $scc S_ENDPGM 0 ... --- # Do not delete s_cmp after s_add_u32 X, Y, where Y!=1 name: s_add_u32_X_Rnon1 body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_X_Rnon1 ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 3 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_ADD_U32_]], 0, implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_MOV_B32 3 %2:sreg_32 = S_ADD_U32 %0, %1, implicit-def $scc S_CMP_EQ_U32 killed %2, 0, implicit-def $scc S_ENDPGM 0 ... --- # Do not delete s_cmp after s_add_u32 3, X name: s_add_u32_3_X body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_3_X ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 3, [[COPY]], implicit-def $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_ADD_U32_]], 0, implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_ADD_U32 3, %0, implicit-def $scc S_CMP_EQ_U32 killed %1, 0, implicit-def $scc S_ENDPGM 0 ... --- # Do not delete s_cmp after s_add_u32 X, Y, where X!=1 name: s_add_u32_Rnon1_Y body: | bb.0: liveins: $sgpr0 ; GCN-LABEL: name: s_add_u32_Rnon1_Y ; GCN: liveins: $sgpr0 ; GCN-NEXT: {{ $}} ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0 ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 4 ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[S_MOV_B32_]], [[COPY]], implicit-def $scc ; GCN-NEXT: S_CMP_EQ_U32 killed [[S_ADD_U32_]], 0, implicit-def $scc ; GCN-NEXT: S_ENDPGM 0 %0:sreg_32 = COPY $sgpr0 %1:sreg_32 = S_MOV_B32 4 %2:sreg_32 = S_ADD_U32 %1, %0, implicit-def $scc S_CMP_EQ_U32 killed %2, 0, implicit-def $scc S_ENDPGM 0 ...