4614 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx700 < %s | FileCheck -check-prefixes=GFX7,GFX7-SDAG %s3; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx700 < %s | FileCheck -check-prefixes=GFX7,GFX7-GISEL %s4; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx801 < %s | FileCheck -check-prefixes=GFX8,GFX8-SDAG %s5; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx801 < %s | FileCheck -check-prefixes=GFX8,GFX8-GISEL %s6; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx942 < %s | FileCheck -check-prefixes=GFX9,GFX9-SDAG %s7; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx942 < %s | FileCheck -check-prefixes=GFX9,GFX9-GISEL %s8; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10,GFX10-SDAG %s9; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10,GFX10-GISEL %s10; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-SDAG,GFX11-SDAG-TRUE16 %s11; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-SDAG,GFX11-SDAG-FAKE16 %s12; FIXME-TRUE16. enable gisel13; XUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL,GFX11-GISEL-TRUE16 %s14; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL,GFX11-GISEL-FAKE16 %s15; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX12,GFX12-SDAG,GFX12-SDAG-TRUE16 %s16; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX12,GFX12-SDAG,GFX12-SDAG-FAKE16 %s17; XUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx1200 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX12,GFX12-GISEL,GFX12-GISEL-TRUE16 %s18; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx1200 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX12,GFX12-GISEL,GFX12-GISEL-FAKE16 %s19 20define i8 @test_vector_reduce_smax_v2i8(<2 x i8> %v) {21; GFX7-SDAG-LABEL: test_vector_reduce_smax_v2i8:22; GFX7-SDAG: ; %bb.0: ; %entry23; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)24; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 825; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 826; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v127; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]28;29; GFX7-GISEL-LABEL: test_vector_reduce_smax_v2i8:30; GFX7-GISEL: ; %bb.0: ; %entry31; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)32; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 833; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 834; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v135; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]36;37; GFX8-LABEL: test_vector_reduce_smax_v2i8:38; GFX8: ; %bb.0: ; %entry39; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)40; GFX8-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_041; GFX8-NEXT: s_setpc_b64 s[30:31]42;43; GFX9-LABEL: test_vector_reduce_smax_v2i8:44; GFX9: ; %bb.0: ; %entry45; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)46; GFX9-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_047; GFX9-NEXT: s_setpc_b64 s[30:31]48;49; GFX10-SDAG-LABEL: test_vector_reduce_smax_v2i8:50; GFX10-SDAG: ; %bb.0: ; %entry51; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)52; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 853; GFX10-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 854; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v155; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]56;57; GFX10-GISEL-LABEL: test_vector_reduce_smax_v2i8:58; GFX10-GISEL: ; %bb.0: ; %entry59; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)60; GFX10-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 861; GFX10-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 862; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v163; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]64;65; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v2i8:66; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry67; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)68; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v0, v0, 0, 869; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 870; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)71; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l72; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]73;74; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v2i8:75; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry76; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)77; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 878; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 879; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)80; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v181; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]82;83; GFX11-GISEL-LABEL: test_vector_reduce_smax_v2i8:84; GFX11-GISEL: ; %bb.0: ; %entry85; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)86; GFX11-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 887; GFX11-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 888; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)89; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v190; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]91;92; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v2i8:93; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry94; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x095; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x096; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x097; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x098; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x099; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v0, v0, 0, 8100; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 8101; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)102; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l103; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]104;105; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v2i8:106; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry107; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0108; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x0109; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x0110; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x0111; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0112; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8113; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8114; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)115; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v1116; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]117;118; GFX12-GISEL-LABEL: test_vector_reduce_smax_v2i8:119; GFX12-GISEL: ; %bb.0: ; %entry120; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0121; GFX12-GISEL-NEXT: s_wait_expcnt 0x0122; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0123; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0124; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0125; GFX12-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8126; GFX12-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8127; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)128; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v1129; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]130entry:131 %res = call i8 @llvm.vector.reduce.smax.v2i8(<2 x i8> %v)132 ret i8 %res133}134 135define i8 @test_vector_reduce_smax_v3i8(<3 x i8> %v) {136; GFX7-SDAG-LABEL: test_vector_reduce_smax_v3i8:137; GFX7-SDAG: ; %bb.0: ; %entry138; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)139; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8140; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8141; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8142; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v2143; GFX7-SDAG-NEXT: s_movk_i32 s4, 0xff80144; GFX7-SDAG-NEXT: v_max3_i32 v0, v1, v0, s4145; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]146;147; GFX7-GISEL-LABEL: test_vector_reduce_smax_v3i8:148; GFX7-GISEL: ; %bb.0: ; %entry149; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)150; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8151; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8152; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v1153; GFX7-GISEL-NEXT: v_bfe_i32 v1, v2, 0, 8154; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v1155; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]156;157; GFX8-SDAG-LABEL: test_vector_reduce_smax_v3i8:158; GFX8-SDAG: ; %bb.0: ; %entry159; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)160; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0161; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, sext(v1), v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD162; GFX8-SDAG-NEXT: v_max_i16_e32 v0, 0xff80, v0163; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]164;165; GFX8-GISEL-LABEL: test_vector_reduce_smax_v3i8:166; GFX8-GISEL: ; %bb.0: ; %entry167; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)168; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0169; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0170; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]171;172; GFX9-SDAG-LABEL: test_vector_reduce_smax_v3i8:173; GFX9-SDAG: ; %bb.0: ; %entry174; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)175; GFX9-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8176; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0177; GFX9-SDAG-NEXT: s_movk_i32 s0, 0xff80178; GFX9-SDAG-NEXT: v_max3_i16 v0, v1, v0, s0179; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]180;181; GFX9-GISEL-LABEL: test_vector_reduce_smax_v3i8:182; GFX9-GISEL: ; %bb.0: ; %entry183; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)184; GFX9-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0185; GFX9-GISEL-NEXT: v_max_i16_sdwa v0, v0, sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0186; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]187;188; GFX10-SDAG-LABEL: test_vector_reduce_smax_v3i8:189; GFX10-SDAG: ; %bb.0: ; %entry190; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)191; GFX10-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8192; GFX10-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8193; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8194; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v2195; GFX10-SDAG-NEXT: v_max3_i16 v0, v1, v0, 0xff80196; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]197;198; GFX10-GISEL-LABEL: test_vector_reduce_smax_v3i8:199; GFX10-GISEL: ; %bb.0: ; %entry200; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)201; GFX10-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8202; GFX10-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8203; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v1204; GFX10-GISEL-NEXT: v_bfe_i32 v1, v2, 0, 8205; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v1206; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]207;208; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v3i8:209; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry210; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)211; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 8212; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v1.l213; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v0, v0, 0, 8214; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)215; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l216; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v3, 0, 8217; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)218; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l219; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l220; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)221; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v1.l, v0.l, 0xff80222; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]223;224; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v3i8:225; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry226; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)227; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 8228; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8229; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8230; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)231; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v2232; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v0, v1, v0, 0xff80233; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]234;235; GFX11-GISEL-LABEL: test_vector_reduce_smax_v3i8:236; GFX11-GISEL: ; %bb.0: ; %entry237; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)238; GFX11-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8239; GFX11-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8240; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)241; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v1242; GFX11-GISEL-NEXT: v_bfe_i32 v1, v2, 0, 8243; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v1244; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]245;246; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v3i8:247; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry248; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0249; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x0250; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x0251; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x0252; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0253; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 8254; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v1.l255; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v0, v0, 0, 8256; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)257; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l258; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v3, 0, 8259; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)260; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l261; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l262; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)263; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v1.l, v0.l, 0xff80264; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]265;266; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v3i8:267; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry268; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0269; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x0270; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x0271; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x0272; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0273; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 8274; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8275; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8276; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)277; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v2278; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v0, v1, v0, 0xff80279; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]280;281; GFX12-GISEL-LABEL: test_vector_reduce_smax_v3i8:282; GFX12-GISEL: ; %bb.0: ; %entry283; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0284; GFX12-GISEL-NEXT: s_wait_expcnt 0x0285; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0286; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0287; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0288; GFX12-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8289; GFX12-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8290; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)291; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v1292; GFX12-GISEL-NEXT: v_bfe_i32 v1, v2, 0, 8293; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v1294; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]295entry:296 %res = call i8 @llvm.vector.reduce.smax.v3i8(<3 x i8> %v)297 ret i8 %res298}299 300define i8 @test_vector_reduce_smax_v4i8(<4 x i8> %v) {301; GFX7-SDAG-LABEL: test_vector_reduce_smax_v4i8:302; GFX7-SDAG: ; %bb.0: ; %entry303; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)304; GFX7-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 8305; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8306; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8307; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8308; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v3309; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v1310; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]311;312; GFX7-GISEL-LABEL: test_vector_reduce_smax_v4i8:313; GFX7-GISEL: ; %bb.0: ; %entry314; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)315; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8316; GFX7-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8317; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8318; GFX7-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8319; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v2320; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v3321; GFX7-GISEL-NEXT: s_sext_i32_i8 s4, s4322; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v1323; GFX7-GISEL-NEXT: v_max_i32_e32 v1, s4, v1324; GFX7-GISEL-NEXT: v_max_i32_e32 v2, s4, v2325; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v1326; GFX7-GISEL-NEXT: v_max_i32_e32 v2, s4, v2327; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xff, v0328; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 8, v1329; GFX7-GISEL-NEXT: v_max_i32_e32 v3, s4, v3330; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v1331; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2332; GFX7-GISEL-NEXT: v_max_i32_e32 v3, s4, v3333; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1334; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v1335; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v3336; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 24, v1337; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v1338; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]339;340; GFX8-SDAG-LABEL: test_vector_reduce_smax_v4i8:341; GFX8-SDAG: ; %bb.0: ; %entry342; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)343; GFX8-SDAG-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v3) dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0344; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0345; GFX8-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v1346; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, v0, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0347; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]348;349; GFX8-GISEL-LABEL: test_vector_reduce_smax_v4i8:350; GFX8-GISEL: ; %bb.0: ; %entry351; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)352; GFX8-GISEL-NEXT: s_sext_i32_i8 s4, s4353; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0354; GFX8-GISEL-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0355; GFX8-GISEL-NEXT: v_mov_b32_e32 v4, s4356; GFX8-GISEL-NEXT: v_max_i16_sdwa v2, sext(v2), v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD357; GFX8-GISEL-NEXT: v_max_i16_sdwa v3, sext(v3), v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD358; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v1359; GFX8-GISEL-NEXT: v_max_i16_e32 v1, s4, v1360; GFX8-GISEL-NEXT: v_mov_b32_e32 v4, 8361; GFX8-GISEL-NEXT: v_max_i16_e32 v2, s4, v2362; GFX8-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0363; GFX8-GISEL-NEXT: v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD364; GFX8-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2365; GFX8-GISEL-NEXT: v_max_i16_e32 v3, s4, v3366; GFX8-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1367; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v0, v1368; GFX8-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v3369; GFX8-GISEL-NEXT: v_lshlrev_b32_e32 v1, 24, v1370; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v0, v1371; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]372;373; GFX9-SDAG-LABEL: test_vector_reduce_smax_v4i8:374; GFX9-SDAG: ; %bb.0: ; %entry375; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)376; GFX9-SDAG-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v3) dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0377; GFX9-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8378; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v1379; GFX9-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8380; GFX9-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8381; GFX9-SDAG-NEXT: v_max3_i16 v0, v0, v2, v1382; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]383;384; GFX9-GISEL-LABEL: test_vector_reduce_smax_v4i8:385; GFX9-GISEL: ; %bb.0: ; %entry386; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)387; GFX9-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v2) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0388; GFX9-GISEL-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v3) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0389; GFX9-GISEL-NEXT: s_sext_i32_i8 s0, s0390; GFX9-GISEL-NEXT: v_max_i16_sdwa v2, sext(v2), s0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD391; GFX9-GISEL-NEXT: v_max_i16_sdwa v3, sext(v3), s0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD392; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v1393; GFX9-GISEL-NEXT: v_max_i16_e32 v1, s0, v1394; GFX9-GISEL-NEXT: v_mov_b32_e32 v5, 8395; GFX9-GISEL-NEXT: v_max_i16_e32 v2, s0, v2396; GFX9-GISEL-NEXT: v_max_i16_e32 v3, s0, v3397; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0xff398; GFX9-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0399; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v4, v1400; GFX9-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2401; GFX9-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v3402; GFX9-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1403; GFX9-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v2404; GFX9-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2405; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]406;407; GFX10-SDAG-LABEL: test_vector_reduce_smax_v4i8:408; GFX10-SDAG: ; %bb.0: ; %entry409; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)410; GFX10-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 8411; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8412; GFX10-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8413; GFX10-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8414; GFX10-SDAG-NEXT: v_max_i16 v1, v1, v3415; GFX10-SDAG-NEXT: v_lshlrev_b16 v1, 8, v1416; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v1417; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8418; GFX10-SDAG-NEXT: v_max3_i16 v0, v0, v2, v1419; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]420;421; GFX10-GISEL-LABEL: test_vector_reduce_smax_v4i8:422; GFX10-GISEL: ; %bb.0: ; %entry423; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)424; GFX10-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8425; GFX10-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8426; GFX10-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8427; GFX10-GISEL-NEXT: s_sext_i32_i8 s4, s4428; GFX10-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8429; GFX10-GISEL-NEXT: v_mov_b32_e32 v5, 8430; GFX10-GISEL-NEXT: v_max_i16 v1, v1, v3431; GFX10-GISEL-NEXT: v_max_i16 v4, v2, s4432; GFX10-GISEL-NEXT: v_max_i16 v3, v3, s4433; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v2434; GFX10-GISEL-NEXT: v_max_i16 v2, v1, s4435; GFX10-GISEL-NEXT: v_max_i16 v4, v4, s4436; GFX10-GISEL-NEXT: v_max_i16 v3, v3, s4437; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v1438; GFX10-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0439; GFX10-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v4440; GFX10-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v3441; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v1442; GFX10-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v2443; GFX10-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v3444; GFX10-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2445; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]446;447; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v4i8:448; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry449; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)450; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 8451; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v3, 0, 8452; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 8453; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v0, v0, 0, 8454; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)455; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v1.l, v1.l, v3.l456; GFX11-SDAG-TRUE16-NEXT: v_lshlrev_b16 v1.l, 8, v1.l457; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)458; GFX11-SDAG-TRUE16-NEXT: v_lshrrev_b32_e32 v1, 8, v1459; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v1, 0, 8460; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l461; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)462; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v3.l463; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.l, v2.l464; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]465;466; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v4i8:467; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry468; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)469; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v3, 0, 8470; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8471; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 8472; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8473; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)474; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v1, v1, v3475; GFX11-SDAG-FAKE16-NEXT: v_lshlrev_b16 v1, 8, v1476; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)477; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 8, v1478; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8479; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)480; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v2, v1481; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]482;483; GFX11-GISEL-LABEL: test_vector_reduce_smax_v4i8:484; GFX11-GISEL: ; %bb.0: ; %entry485; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)486; GFX11-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8487; GFX11-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8488; GFX11-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8489; GFX11-GISEL-NEXT: s_sext_i32_i8 s0, s0490; GFX11-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8491; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)492; GFX11-GISEL-NEXT: v_max_i16 v1, v1, v3493; GFX11-GISEL-NEXT: v_max_i16 v4, v2, s0494; GFX11-GISEL-NEXT: v_max_i16 v3, v3, s0495; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)496; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v2497; GFX11-GISEL-NEXT: v_max_i16 v5, v1, s0498; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)499; GFX11-GISEL-NEXT: v_max_i16 v2, v4, s0500; GFX11-GISEL-NEXT: v_max_i16 v3, v3, s0501; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)502; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v1503; GFX11-GISEL-NEXT: v_and_b32_e32 v4, 0xff, v5504; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)505; GFX11-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2506; GFX11-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v3507; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)508; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v2, 8, v4509; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1510; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)511; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v2512; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v3513; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)514; GFX11-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2515; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]516;517; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v4i8:518; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry519; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0520; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x0521; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x0522; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x0523; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0524; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 8525; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v3, 0, 8526; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 8527; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v0, v0, 0, 8528; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)529; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v1.l, v1.l, v3.l530; GFX12-SDAG-TRUE16-NEXT: v_lshlrev_b16 v1.l, 8, v1.l531; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)532; GFX12-SDAG-TRUE16-NEXT: v_lshrrev_b32_e32 v1, 8, v1533; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v1, 0, 8534; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l535; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)536; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v3.l537; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.l, v2.l538; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]539;540; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v4i8:541; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry542; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0543; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x0544; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x0545; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x0546; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0547; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v3, 0, 8548; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8549; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 8550; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8551; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)552; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v1, v1, v3553; GFX12-SDAG-FAKE16-NEXT: v_lshlrev_b16 v1, 8, v1554; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)555; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 8, v1556; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8557; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)558; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v2, v1559; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]560;561; GFX12-GISEL-LABEL: test_vector_reduce_smax_v4i8:562; GFX12-GISEL: ; %bb.0: ; %entry563; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0564; GFX12-GISEL-NEXT: s_wait_expcnt 0x0565; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0566; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0567; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0568; GFX12-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8569; GFX12-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8570; GFX12-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8571; GFX12-GISEL-NEXT: s_sext_i32_i8 s0, s0572; GFX12-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8573; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3)574; GFX12-GISEL-NEXT: v_max_i16 v1, v1, v3575; GFX12-GISEL-NEXT: s_wait_alu depctr_sa_sdst(0)576; GFX12-GISEL-NEXT: v_max_i16 v4, v2, s0577; GFX12-GISEL-NEXT: v_max_i16 v3, v3, s0578; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v2579; GFX12-GISEL-NEXT: v_max_i16 v5, v1, s0580; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)581; GFX12-GISEL-NEXT: v_max_i16 v2, v4, s0582; GFX12-GISEL-NEXT: v_max_i16 v3, v3, s0583; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)584; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v1585; GFX12-GISEL-NEXT: v_and_b32_e32 v4, 0xff, v5586; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)587; GFX12-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2588; GFX12-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v3589; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)590; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v2, 8, v4591; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1592; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)593; GFX12-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v2594; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v3595; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)596; GFX12-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2597; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]598entry:599 %res = call i8 @llvm.vector.reduce.smax.v4i8(<4 x i8> %v)600 ret i8 %res601}602 603define i8 @test_vector_reduce_smax_v8i8(<8 x i8> %v) {604; GFX7-SDAG-LABEL: test_vector_reduce_smax_v8i8:605; GFX7-SDAG: ; %bb.0: ; %entry606; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)607; GFX7-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 8608; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8609; GFX7-SDAG-NEXT: v_bfe_i32 v4, v4, 0, 8610; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8611; GFX7-SDAG-NEXT: v_bfe_i32 v6, v6, 0, 8612; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8613; GFX7-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 8614; GFX7-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 8615; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v4616; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v5617; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v3, v7618; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v6619; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v1620; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]621;622; GFX7-GISEL-LABEL: test_vector_reduce_smax_v8i8:623; GFX7-GISEL: ; %bb.0: ; %entry624; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)625; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8626; GFX7-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 8627; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v4628; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8629; GFX7-GISEL-NEXT: v_bfe_i32 v4, v5, 0, 8630; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v4631; GFX7-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8632; GFX7-GISEL-NEXT: v_bfe_i32 v4, v6, 0, 8633; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v4634; GFX7-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8635; GFX7-GISEL-NEXT: v_bfe_i32 v4, v7, 0, 8636; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v4637; GFX7-GISEL-NEXT: s_sext_i32_i8 s4, s4638; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v2639; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v3640; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v1641; GFX7-GISEL-NEXT: v_max_i32_e32 v1, s4, v1642; GFX7-GISEL-NEXT: v_max_i32_e32 v2, s4, v2643; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v1644; GFX7-GISEL-NEXT: v_max_i32_e32 v2, s4, v2645; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xff, v0646; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 8, v1647; GFX7-GISEL-NEXT: v_max_i32_e32 v3, s4, v3648; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v1649; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2650; GFX7-GISEL-NEXT: v_max_i32_e32 v3, s4, v3651; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1652; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v1653; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v3654; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 24, v1655; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v1656; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]657;658; GFX8-SDAG-LABEL: test_vector_reduce_smax_v8i8:659; GFX8-SDAG: ; %bb.0: ; %entry660; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)661; GFX8-SDAG-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v7) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0662; GFX8-SDAG-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v5) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0663; GFX8-SDAG-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v6) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0664; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v4) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0665; GFX8-SDAG-NEXT: v_max_i16_sdwa v1, v1, v3 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD666; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v2667; GFX8-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v1668; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, v0, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0669; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]670;671; GFX8-GISEL-LABEL: test_vector_reduce_smax_v8i8:672; GFX8-GISEL: ; %bb.0: ; %entry673; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)674; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v4) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0675; GFX8-GISEL-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v5) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0676; GFX8-GISEL-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v6) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0677; GFX8-GISEL-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v7) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0678; GFX8-GISEL-NEXT: s_sext_i32_i8 s4, s4679; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v2680; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v1, v3681; GFX8-GISEL-NEXT: v_max_i16_e32 v2, s4, v2682; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v1683; GFX8-GISEL-NEXT: v_max_i16_e32 v1, s4, v1684; GFX8-GISEL-NEXT: v_mov_b32_e32 v4, 8685; GFX8-GISEL-NEXT: v_max_i16_e32 v2, s4, v2686; GFX8-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0687; GFX8-GISEL-NEXT: v_max_i16_e32 v3, s4, v3688; GFX8-GISEL-NEXT: v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD689; GFX8-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2690; GFX8-GISEL-NEXT: v_max_i16_e32 v3, s4, v3691; GFX8-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1692; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v0, v1693; GFX8-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v3694; GFX8-GISEL-NEXT: v_lshlrev_b32_e32 v1, 24, v1695; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v0, v1696; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]697;698; GFX9-SDAG-LABEL: test_vector_reduce_smax_v8i8:699; GFX9-SDAG: ; %bb.0: ; %entry700; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)701; GFX9-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 8702; GFX9-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 8703; GFX9-SDAG-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v5) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0704; GFX9-SDAG-NEXT: v_max3_i16 v1, v1, v3, v7705; GFX9-SDAG-NEXT: v_bfe_i32 v6, v6, 0, 8706; GFX9-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8707; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v4) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0708; GFX9-SDAG-NEXT: v_lshlrev_b16_e32 v1, 8, v1709; GFX9-SDAG-NEXT: v_max3_i16 v0, v0, v2, v6710; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v1711; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0712; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]713;714; GFX9-GISEL-LABEL: test_vector_reduce_smax_v8i8:715; GFX9-GISEL: ; %bb.0: ; %entry716; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)717; GFX9-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v4) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0718; GFX9-GISEL-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v5) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0719; GFX9-GISEL-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v6) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0720; GFX9-GISEL-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v7) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_0721; GFX9-GISEL-NEXT: s_sext_i32_i8 s0, s0722; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v2723; GFX9-GISEL-NEXT: v_max_i16_e32 v1, v1, v3724; GFX9-GISEL-NEXT: v_max_i16_e32 v2, s0, v2725; GFX9-GISEL-NEXT: v_max_i16_e32 v3, s0, v3726; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v1727; GFX9-GISEL-NEXT: v_max_i16_e32 v1, s0, v1728; GFX9-GISEL-NEXT: v_mov_b32_e32 v5, 8729; GFX9-GISEL-NEXT: v_max_i16_e32 v2, s0, v2730; GFX9-GISEL-NEXT: v_max_i16_e32 v3, s0, v3731; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0xff732; GFX9-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0733; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v4, v1734; GFX9-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2735; GFX9-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v3736; GFX9-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1737; GFX9-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v2738; GFX9-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2739; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]740;741; GFX10-SDAG-LABEL: test_vector_reduce_smax_v8i8:742; GFX10-SDAG: ; %bb.0: ; %entry743; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)744; GFX10-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 8745; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8746; GFX10-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 8747; GFX10-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 8748; GFX10-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 8749; GFX10-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 8750; GFX10-SDAG-NEXT: v_max_i16 v1, v1, v5751; GFX10-SDAG-NEXT: v_max3_i16 v1, v1, v3, v7752; GFX10-SDAG-NEXT: v_bfe_i32 v3, v4, 0, 8753; GFX10-SDAG-NEXT: v_bfe_i32 v4, v6, 0, 8754; GFX10-SDAG-NEXT: v_lshlrev_b16 v1, 8, v1755; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v3756; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v1757; GFX10-SDAG-NEXT: v_max3_i16 v0, v0, v2, v4758; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 8759; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v1760; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]761;762; GFX10-GISEL-LABEL: test_vector_reduce_smax_v8i8:763; GFX10-GISEL: ; %bb.0: ; %entry764; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)765; GFX10-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8766; GFX10-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 8767; GFX10-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8768; GFX10-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 8769; GFX10-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8770; GFX10-GISEL-NEXT: v_bfe_i32 v6, v6, 0, 8771; GFX10-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8772; GFX10-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 8773; GFX10-GISEL-NEXT: v_max_i16 v1, v1, v5774; GFX10-GISEL-NEXT: v_max_i16 v3, v3, v7775; GFX10-GISEL-NEXT: v_max_i16 v2, v2, v6776; GFX10-GISEL-NEXT: s_sext_i32_i8 s4, s4777; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v4778; GFX10-GISEL-NEXT: v_mov_b32_e32 v5, 8779; GFX10-GISEL-NEXT: v_max_i16 v1, v1, v3780; GFX10-GISEL-NEXT: v_max_i16 v4, v2, s4781; GFX10-GISEL-NEXT: v_max_i16 v3, v3, s4782; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v2783; GFX10-GISEL-NEXT: v_max_i16 v2, v1, s4784; GFX10-GISEL-NEXT: v_max_i16 v4, v4, s4785; GFX10-GISEL-NEXT: v_max_i16 v3, v3, s4786; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v1787; GFX10-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0788; GFX10-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v4789; GFX10-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v3790; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v1791; GFX10-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v2792; GFX10-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v3793; GFX10-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2794; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]795;796; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v8i8:797; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry798; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)799; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v5, v5, 0, 8800; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 8801; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v8, v3, 0, 8802; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v7, v7, 0, 8803; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 8804; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v5.l805; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)806; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v8.l807; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v1.l, v1.l, v3.l808; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v7.l809; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v7.l, v0.l810; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)811; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v1.l, v5.l, v3.l812; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v7, 0, 8813; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v4, 0, 8814; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v4.l, v6.l815; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)816; GFX11-SDAG-TRUE16-NEXT: v_lshlrev_b16 v5.l, 8, v0.l817; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v1.l818; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)819; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v3.l820; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v4, 0, 8821; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)822; GFX11-SDAG-TRUE16-NEXT: v_lshrrev_b32_e32 v4, 8, v5823; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l824; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l825; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)826; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v3.l827; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v4, 0, 8828; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)829; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.l, v2.l830; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v3.l831; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)832; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l833; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]834;835; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v8i8:836; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry837; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)838; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v5, v5, 0, 8839; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8840; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v7, v7, 0, 8841; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v3, 0, 8842; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8843; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 8844; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v1, v1, v5845; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)846; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v1, v1, v3, v7847; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v4, 0, 8848; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v4, v6, 0, 8849; GFX11-SDAG-FAKE16-NEXT: v_lshlrev_b16 v1, 8, v1850; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)851; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v3852; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 8, v1853; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)854; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v2, v4855; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8856; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)857; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v1858; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]859;860; GFX11-GISEL-LABEL: test_vector_reduce_smax_v8i8:861; GFX11-GISEL: ; %bb.0: ; %entry862; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)863; GFX11-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8864; GFX11-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 8865; GFX11-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8866; GFX11-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 8867; GFX11-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8868; GFX11-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8869; GFX11-GISEL-NEXT: v_max_i16 v1, v1, v5870; GFX11-GISEL-NEXT: v_bfe_i32 v5, v6, 0, 8871; GFX11-GISEL-NEXT: v_max_i16 v3, v3, v7872; GFX11-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 8873; GFX11-GISEL-NEXT: s_sext_i32_i8 s0, s0874; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)875; GFX11-GISEL-NEXT: v_max_i16 v2, v2, v5876; GFX11-GISEL-NEXT: v_max_i16 v1, v1, v3877; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)878; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v4879; GFX11-GISEL-NEXT: v_max_i16 v3, v3, s0880; GFX11-GISEL-NEXT: v_max_i16 v4, v2, s0881; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)882; GFX11-GISEL-NEXT: v_max_i16 v5, v1, s0883; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v2884; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)885; GFX11-GISEL-NEXT: v_max_i16 v3, v3, s0886; GFX11-GISEL-NEXT: v_max_i16 v2, v4, s0887; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)888; GFX11-GISEL-NEXT: v_and_b32_e32 v4, 0xff, v5889; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v1890; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)891; GFX11-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v3892; GFX11-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v2893; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)894; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v2, 8, v4895; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v1896; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)897; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v2898; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v3899; GFX11-GISEL-NEXT: v_or3_b32 v0, v0, v1, v2900; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]901;902; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v8i8:903; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry904; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0905; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x0906; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x0907; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x0908; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0909; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v5, v5, 0, 8910; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 8911; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v8, v3, 0, 8912; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v7, v7, 0, 8913; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 8914; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v5.l915; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)916; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v8.l917; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v1.l, v1.l, v3.l918; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v7.l919; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v7.l, v0.l920; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)921; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v1.l, v5.l, v3.l922; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v7, 0, 8923; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v4, 0, 8924; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v4.l, v6.l925; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)926; GFX12-SDAG-TRUE16-NEXT: v_lshlrev_b16 v5.l, 8, v0.l927; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v1.l928; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)929; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v3.l930; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v4, 0, 8931; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)932; GFX12-SDAG-TRUE16-NEXT: v_lshrrev_b32_e32 v4, 8, v5933; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l934; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l935; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)936; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v3.l937; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v3, v4, 0, 8938; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)939; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.l, v2.l940; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v3.l941; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)942; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l943; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]944;945; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v8i8:946; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry947; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0948; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x0949; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x0950; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x0951; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0952; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v5, v5, 0, 8953; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8954; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v7, v7, 0, 8955; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v3, 0, 8956; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 8957; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 8958; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v1, v1, v5959; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)960; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v1, v1, v3, v7961; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v4, 0, 8962; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v4, v6, 0, 8963; GFX12-SDAG-FAKE16-NEXT: v_lshlrev_b16 v1, 8, v1964; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)965; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v3966; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 8, v1967; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)968; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v2, v4969; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 8970; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)971; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v1972; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]973;974; GFX12-GISEL-LABEL: test_vector_reduce_smax_v8i8:975; GFX12-GISEL: ; %bb.0: ; %entry976; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0977; GFX12-GISEL-NEXT: s_wait_expcnt 0x0978; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0979; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0980; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0981; GFX12-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 8982; GFX12-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 8983; GFX12-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 8984; GFX12-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 8985; GFX12-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 8986; GFX12-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 8987; GFX12-GISEL-NEXT: v_max_i16 v1, v1, v5988; GFX12-GISEL-NEXT: v_bfe_i32 v5, v6, 0, 8989; GFX12-GISEL-NEXT: v_max_i16 v3, v3, v7990; GFX12-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 8991; GFX12-GISEL-NEXT: s_sext_i32_i8 s0, s0992; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)993; GFX12-GISEL-NEXT: v_max_i16 v2, v2, v5994; GFX12-GISEL-NEXT: v_max_i16 v1, v1, v3995; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3)996; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v4997; GFX12-GISEL-NEXT: s_wait_alu depctr_sa_sdst(0)998; GFX12-GISEL-NEXT: v_max_i16 v3, v3, s0999; GFX12-GISEL-NEXT: v_max_i16 v4, v2, s01000; GFX12-GISEL-NEXT: v_max_i16 v5, v1, s01001; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v21002; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1003; GFX12-GISEL-NEXT: v_max_i16 v3, v3, s01004; GFX12-GISEL-NEXT: v_max_i16 v2, v4, s01005; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1006; GFX12-GISEL-NEXT: v_and_b32_e32 v4, 0xff, v51007; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v11008; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1009; GFX12-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v31010; GFX12-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v21011; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)1012; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v2, 8, v41013; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v11014; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)1015; GFX12-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v21016; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v31017; GFX12-GISEL-NEXT: v_or3_b32 v0, v0, v1, v21018; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]1019entry:1020 %res = call i8 @llvm.vector.reduce.smax.v8i8(<8 x i8> %v)1021 ret i8 %res1022}1023 1024define i8 @test_vector_reduce_smax_v16i8(<16 x i8> %v) {1025; GFX7-SDAG-LABEL: test_vector_reduce_smax_v16i8:1026; GFX7-SDAG: ; %bb.0: ; %entry1027; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1028; GFX7-SDAG-NEXT: v_bfe_i32 v8, v8, 0, 81029; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 81030; GFX7-SDAG-NEXT: v_bfe_i32 v9, v9, 0, 81031; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 81032; GFX7-SDAG-NEXT: v_bfe_i32 v13, v13, 0, 81033; GFX7-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 81034; GFX7-SDAG-NEXT: v_bfe_i32 v12, v12, 0, 81035; GFX7-SDAG-NEXT: v_bfe_i32 v4, v4, 0, 81036; GFX7-SDAG-NEXT: v_bfe_i32 v11, v11, 0, 81037; GFX7-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 81038; GFX7-SDAG-NEXT: v_bfe_i32 v15, v15, 0, 81039; GFX7-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 81040; GFX7-SDAG-NEXT: v_bfe_i32 v10, v10, 0, 81041; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 81042; GFX7-SDAG-NEXT: v_bfe_i32 v14, v14, 0, 81043; GFX7-SDAG-NEXT: v_bfe_i32 v6, v6, 0, 81044; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v91045; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v81046; GFX7-SDAG-NEXT: v_max_i32_e32 v6, v6, v141047; GFX7-SDAG-NEXT: v_max_i32_e32 v2, v2, v101048; GFX7-SDAG-NEXT: v_max_i32_e32 v7, v7, v151049; GFX7-SDAG-NEXT: v_max_i32_e32 v3, v3, v111050; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v4, v121051; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v5, v131052; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v3, v71053; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v61054; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v11055; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]1056;1057; GFX7-GISEL-LABEL: test_vector_reduce_smax_v16i8:1058; GFX7-GISEL: ; %bb.0: ; %entry1059; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1060; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 81061; GFX7-GISEL-NEXT: v_bfe_i32 v8, v8, 0, 81062; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v81063; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 81064; GFX7-GISEL-NEXT: v_bfe_i32 v8, v9, 0, 81065; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v81066; GFX7-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 81067; GFX7-GISEL-NEXT: v_bfe_i32 v8, v10, 0, 81068; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v81069; GFX7-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 81070; GFX7-GISEL-NEXT: v_bfe_i32 v8, v11, 0, 81071; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v81072; GFX7-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 81073; GFX7-GISEL-NEXT: v_bfe_i32 v8, v12, 0, 81074; GFX7-GISEL-NEXT: v_max_i32_e32 v4, v4, v81075; GFX7-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 81076; GFX7-GISEL-NEXT: v_bfe_i32 v8, v13, 0, 81077; GFX7-GISEL-NEXT: v_max_i32_e32 v5, v5, v81078; GFX7-GISEL-NEXT: v_bfe_i32 v6, v6, 0, 81079; GFX7-GISEL-NEXT: v_bfe_i32 v8, v14, 0, 81080; GFX7-GISEL-NEXT: v_max_i32_e32 v6, v6, v81081; GFX7-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 81082; GFX7-GISEL-NEXT: v_bfe_i32 v8, v15, 0, 81083; GFX7-GISEL-NEXT: v_max_i32_e32 v7, v7, v81084; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v41085; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v51086; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v61087; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v71088; GFX7-GISEL-NEXT: s_sext_i32_i8 s4, s41089; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v21090; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v31091; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v11092; GFX7-GISEL-NEXT: v_max_i32_e32 v1, s4, v11093; GFX7-GISEL-NEXT: v_max_i32_e32 v2, s4, v21094; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v11095; GFX7-GISEL-NEXT: v_max_i32_e32 v2, s4, v21096; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xff, v01097; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 8, v11098; GFX7-GISEL-NEXT: v_max_i32_e32 v3, s4, v31099; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v11100; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v21101; GFX7-GISEL-NEXT: v_max_i32_e32 v3, s4, v31102; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v11103; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v11104; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v31105; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 24, v11106; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v11107; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]1108;1109; GFX8-SDAG-LABEL: test_vector_reduce_smax_v16i8:1110; GFX8-SDAG: ; %bb.0: ; %entry1111; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1112; GFX8-SDAG-NEXT: v_max_i16_sdwa v5, sext(v5), sext(v13) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01113; GFX8-SDAG-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v9) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01114; GFX8-SDAG-NEXT: v_max_i16_sdwa v7, sext(v7), sext(v15) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01115; GFX8-SDAG-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v11) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01116; GFX8-SDAG-NEXT: v_max_i16_sdwa v4, sext(v4), sext(v12) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01117; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v8) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01118; GFX8-SDAG-NEXT: v_max_i16_sdwa v6, sext(v6), sext(v14) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01119; GFX8-SDAG-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v10) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01120; GFX8-SDAG-NEXT: v_max_i16_e32 v3, v3, v71121; GFX8-SDAG-NEXT: v_max_i16_e32 v1, v1, v51122; GFX8-SDAG-NEXT: v_max_i16_e32 v2, v2, v61123; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v41124; GFX8-SDAG-NEXT: v_max_i16_sdwa v1, v1, v3 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD1125; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v21126; GFX8-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v11127; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, v0, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_01128; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]1129;1130; GFX8-GISEL-LABEL: test_vector_reduce_smax_v16i8:1131; GFX8-GISEL: ; %bb.0: ; %entry1132; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1133; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v8) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01134; GFX8-GISEL-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v9) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01135; GFX8-GISEL-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v10) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01136; GFX8-GISEL-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v11) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01137; GFX8-GISEL-NEXT: v_max_i16_sdwa v4, sext(v4), sext(v12) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01138; GFX8-GISEL-NEXT: v_max_i16_sdwa v5, sext(v5), sext(v13) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01139; GFX8-GISEL-NEXT: v_max_i16_sdwa v6, sext(v6), sext(v14) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01140; GFX8-GISEL-NEXT: v_max_i16_sdwa v7, sext(v7), sext(v15) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01141; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v41142; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v1, v51143; GFX8-GISEL-NEXT: v_max_i16_e32 v2, v2, v61144; GFX8-GISEL-NEXT: v_max_i16_e32 v3, v3, v71145; GFX8-GISEL-NEXT: s_sext_i32_i8 s4, s41146; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v21147; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v1, v31148; GFX8-GISEL-NEXT: v_max_i16_e32 v2, s4, v21149; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v11150; GFX8-GISEL-NEXT: v_max_i16_e32 v1, s4, v11151; GFX8-GISEL-NEXT: v_mov_b32_e32 v4, 81152; GFX8-GISEL-NEXT: v_max_i16_e32 v2, s4, v21153; GFX8-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_01154; GFX8-GISEL-NEXT: v_max_i16_e32 v3, s4, v31155; GFX8-GISEL-NEXT: v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD1156; GFX8-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v21157; GFX8-GISEL-NEXT: v_max_i16_e32 v3, s4, v31158; GFX8-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v11159; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v0, v11160; GFX8-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v31161; GFX8-GISEL-NEXT: v_lshlrev_b32_e32 v1, 24, v11162; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v0, v11163; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]1164;1165; GFX9-SDAG-LABEL: test_vector_reduce_smax_v16i8:1166; GFX9-SDAG: ; %bb.0: ; %entry1167; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1168; GFX9-SDAG-NEXT: v_bfe_i32 v13, v13, 0, 81169; GFX9-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 81170; GFX9-SDAG-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v9) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01171; GFX9-SDAG-NEXT: v_max_i16_sdwa v7, sext(v7), sext(v15) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01172; GFX9-SDAG-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v11) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01173; GFX9-SDAG-NEXT: v_max3_i16 v1, v1, v5, v131174; GFX9-SDAG-NEXT: v_bfe_i32 v12, v12, 0, 81175; GFX9-SDAG-NEXT: v_bfe_i32 v4, v4, 0, 81176; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v8) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01177; GFX9-SDAG-NEXT: v_max3_i16 v1, v1, v3, v71178; GFX9-SDAG-NEXT: v_max_i16_sdwa v6, sext(v6), sext(v14) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01179; GFX9-SDAG-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v10) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01180; GFX9-SDAG-NEXT: v_max3_i16 v0, v0, v4, v121181; GFX9-SDAG-NEXT: v_lshlrev_b16_e32 v1, 8, v11182; GFX9-SDAG-NEXT: v_max3_i16 v0, v0, v2, v61183; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v11184; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_01185; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]1186;1187; GFX9-GISEL-LABEL: test_vector_reduce_smax_v16i8:1188; GFX9-GISEL: ; %bb.0: ; %entry1189; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1190; GFX9-GISEL-NEXT: v_max_i16_sdwa v0, sext(v0), sext(v8) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01191; GFX9-GISEL-NEXT: v_max_i16_sdwa v1, sext(v1), sext(v9) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01192; GFX9-GISEL-NEXT: v_max_i16_sdwa v2, sext(v2), sext(v10) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01193; GFX9-GISEL-NEXT: v_max_i16_sdwa v3, sext(v3), sext(v11) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01194; GFX9-GISEL-NEXT: v_max_i16_sdwa v4, sext(v4), sext(v12) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01195; GFX9-GISEL-NEXT: v_max_i16_sdwa v5, sext(v5), sext(v13) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01196; GFX9-GISEL-NEXT: v_max_i16_sdwa v6, sext(v6), sext(v14) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01197; GFX9-GISEL-NEXT: v_max_i16_sdwa v7, sext(v7), sext(v15) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:BYTE_01198; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v41199; GFX9-GISEL-NEXT: v_max_i16_e32 v1, v1, v51200; GFX9-GISEL-NEXT: v_max_i16_e32 v2, v2, v61201; GFX9-GISEL-NEXT: v_max_i16_e32 v3, v3, v71202; GFX9-GISEL-NEXT: s_sext_i32_i8 s0, s01203; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v21204; GFX9-GISEL-NEXT: v_max_i16_e32 v1, v1, v31205; GFX9-GISEL-NEXT: v_max_i16_e32 v2, s0, v21206; GFX9-GISEL-NEXT: v_max_i16_e32 v3, s0, v31207; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v11208; GFX9-GISEL-NEXT: v_max_i16_e32 v1, s0, v11209; GFX9-GISEL-NEXT: v_mov_b32_e32 v5, 81210; GFX9-GISEL-NEXT: v_max_i16_e32 v2, s0, v21211; GFX9-GISEL-NEXT: v_max_i16_e32 v3, s0, v31212; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0xff1213; GFX9-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_01214; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v4, v11215; GFX9-GISEL-NEXT: v_and_b32_e32 v1, 0xff, v21216; GFX9-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v31217; GFX9-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v11218; GFX9-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v21219; GFX9-GISEL-NEXT: v_or3_b32 v0, v0, v1, v21220; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]1221;1222; GFX10-SDAG-LABEL: test_vector_reduce_smax_v16i8:1223; GFX10-SDAG: ; %bb.0: ; %entry1224; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1225; GFX10-SDAG-NEXT: v_bfe_i32 v9, v9, 0, 81226; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 81227; GFX10-SDAG-NEXT: v_bfe_i32 v13, v13, 0, 81228; GFX10-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 81229; GFX10-SDAG-NEXT: v_bfe_i32 v11, v11, 0, 81230; GFX10-SDAG-NEXT: v_bfe_i32 v15, v15, 0, 81231; GFX10-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 81232; GFX10-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 81233; GFX10-SDAG-NEXT: v_max_i16 v1, v1, v91234; GFX10-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 81235; GFX10-SDAG-NEXT: v_bfe_i32 v9, v12, 0, 81236; GFX10-SDAG-NEXT: v_max_i16 v7, v7, v151237; GFX10-SDAG-NEXT: v_max_i16 v3, v3, v111238; GFX10-SDAG-NEXT: v_max3_i16 v1, v1, v5, v131239; GFX10-SDAG-NEXT: v_bfe_i32 v5, v8, 0, 81240; GFX10-SDAG-NEXT: v_bfe_i32 v4, v4, 0, 81241; GFX10-SDAG-NEXT: v_bfe_i32 v8, v10, 0, 81242; GFX10-SDAG-NEXT: v_bfe_i32 v6, v6, 0, 81243; GFX10-SDAG-NEXT: v_max3_i16 v1, v1, v3, v71244; GFX10-SDAG-NEXT: v_bfe_i32 v3, v14, 0, 81245; GFX10-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 81246; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v51247; GFX10-SDAG-NEXT: v_lshlrev_b16 v1, 8, v11248; GFX10-SDAG-NEXT: v_max_i16 v3, v6, v31249; GFX10-SDAG-NEXT: v_max_i16 v2, v2, v81250; GFX10-SDAG-NEXT: v_max3_i16 v0, v0, v4, v91251; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 8, v11252; GFX10-SDAG-NEXT: v_max3_i16 v0, v0, v2, v31253; GFX10-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 81254; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v11255; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]1256;1257; GFX10-GISEL-LABEL: test_vector_reduce_smax_v16i8:1258; GFX10-GISEL: ; %bb.0: ; %entry1259; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1260; GFX10-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 81261; GFX10-GISEL-NEXT: v_bfe_i32 v8, v8, 0, 81262; GFX10-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 81263; GFX10-GISEL-NEXT: v_bfe_i32 v9, v9, 0, 81264; GFX10-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 81265; GFX10-GISEL-NEXT: v_bfe_i32 v11, v11, 0, 81266; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v81267; GFX10-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 81268; GFX10-GISEL-NEXT: v_max_i16 v1, v1, v91269; GFX10-GISEL-NEXT: v_bfe_i32 v8, v10, 0, 81270; GFX10-GISEL-NEXT: v_max_i16 v3, v3, v111271; GFX10-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 81272; GFX10-GISEL-NEXT: v_bfe_i32 v9, v13, 0, 81273; GFX10-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 81274; GFX10-GISEL-NEXT: v_bfe_i32 v10, v15, 0, 81275; GFX10-GISEL-NEXT: v_bfe_i32 v6, v6, 0, 81276; GFX10-GISEL-NEXT: v_bfe_i32 v11, v14, 0, 81277; GFX10-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 81278; GFX10-GISEL-NEXT: v_bfe_i32 v12, v12, 0, 81279; GFX10-GISEL-NEXT: v_max_i16 v5, v5, v91280; GFX10-GISEL-NEXT: v_max_i16 v7, v7, v101281; GFX10-GISEL-NEXT: v_max_i16 v2, v2, v81282; GFX10-GISEL-NEXT: v_max_i16 v6, v6, v111283; GFX10-GISEL-NEXT: v_max_i16 v4, v4, v121284; GFX10-GISEL-NEXT: v_max_i16 v1, v1, v51285; GFX10-GISEL-NEXT: v_max_i16 v3, v3, v71286; GFX10-GISEL-NEXT: s_sext_i32_i8 s4, s41287; GFX10-GISEL-NEXT: v_max_i16 v2, v2, v61288; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v41289; GFX10-GISEL-NEXT: v_mov_b32_e32 v5, 81290; GFX10-GISEL-NEXT: v_max_i16 v1, v1, v31291; GFX10-GISEL-NEXT: v_max_i16 v3, v3, s41292; GFX10-GISEL-NEXT: v_max_i16 v4, v2, s41293; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v21294; GFX10-GISEL-NEXT: v_max_i16 v2, v1, s41295; GFX10-GISEL-NEXT: v_max_i16 v3, v3, s41296; GFX10-GISEL-NEXT: v_max_i16 v4, v4, s41297; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v11298; GFX10-GISEL-NEXT: v_lshlrev_b32_sdwa v1, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_01299; GFX10-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v31300; GFX10-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v41301; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v11302; GFX10-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v21303; GFX10-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v31304; GFX10-GISEL-NEXT: v_or3_b32 v0, v0, v1, v21305; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]1306;1307; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v16i8:1308; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry1309; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1310; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v16, v4, 0, 81311; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v4.l, v5.l1312; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v9.l1313; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 81314; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v17, v0, 0, 81315; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v11.l1316; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v9, v4, 0, 81317; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v4, v5, 0, 81318; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v15.l1319; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v13, v13, 0, 81320; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v18.l, v2.l1321; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v7.l1322; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v7.l, v6.l1323; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v6, v0, 0, 81324; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v5, v5, 0, 81325; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v11, v3, 0, 81326; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v1.l1327; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v4.l1328; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 81329; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v5.l1330; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v4.l, v11.l1331; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v6.l1332; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l1333; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v9.l1334; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v6.l, v13.l1335; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.h, v2.l, v3.l1336; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v1.h, v4.l, v5.l1337; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v8, v8, 0, 81338; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v7, v7, 0, 81339; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.l, v6.l1340; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v12, v12, 0, 81341; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v9.l, v14.l1342; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v6, v10, 0, 81343; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v7.l1344; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.h, v0.h1345; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v17.l1346; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v8.l1347; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v5, v18, 0, 81348; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v4, v9, 0, 81349; GFX11-SDAG-TRUE16-NEXT: v_lshlrev_b16 v7.l, 8, v0.l1350; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v6.l1351; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.h, v2.l, v3.l1352; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v16.l1353; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v12.l1354; GFX11-SDAG-TRUE16-NEXT: v_lshrrev_b32_e32 v6, 8, v71355; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v1.l, v1.l, v4.l1356; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v5.l, v0.l1357; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1358; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.h, v0.h, v2.l, v3.l1359; GFX11-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v6, 0, 81360; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1361; GFX11-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.h, v0.l, v1.l1362; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l1363; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1364; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l1365; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1366;1367; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v16i8:1368; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry1369; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1370; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v9, v9, 0, 81371; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 81372; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v13, v13, 0, 81373; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v5, v5, 0, 81374; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v11, v11, 0, 81375; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v15, v15, 0, 81376; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v7, v7, 0, 81377; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v3, 0, 81378; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v1, v1, v91379; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 81380; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v9, v12, 0, 81381; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v7, v7, v151382; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v3, v3, v111383; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v1, v1, v5, v131384; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v5, v8, 0, 81385; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v4, v4, 0, 81386; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v8, v10, 0, 81387; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v6, v6, 0, 81388; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v1, v1, v3, v71389; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v14, 0, 81390; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 81391; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v51392; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1393; GFX11-SDAG-FAKE16-NEXT: v_lshlrev_b16 v1, 8, v11394; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v3, v6, v31395; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1396; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v2, v2, v81397; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v4, v91398; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)1399; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 8, v11400; GFX11-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v2, v31401; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)1402; GFX11-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 81403; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v11404; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]1405;1406; GFX11-GISEL-LABEL: test_vector_reduce_smax_v16i8:1407; GFX11-GISEL: ; %bb.0: ; %entry1408; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1409; GFX11-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 81410; GFX11-GISEL-NEXT: v_bfe_i32 v9, v9, 0, 81411; GFX11-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 81412; GFX11-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 81413; GFX11-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 81414; GFX11-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 81415; GFX11-GISEL-NEXT: v_max_i16 v1, v1, v91416; GFX11-GISEL-NEXT: v_bfe_i32 v9, v10, 0, 81417; GFX11-GISEL-NEXT: v_bfe_i32 v10, v11, 0, 81418; GFX11-GISEL-NEXT: v_bfe_i32 v11, v13, 0, 81419; GFX11-GISEL-NEXT: v_bfe_i32 v13, v15, 0, 81420; GFX11-GISEL-NEXT: v_bfe_i32 v6, v6, 0, 81421; GFX11-GISEL-NEXT: v_max_i16 v2, v2, v91422; GFX11-GISEL-NEXT: v_max_i16 v3, v3, v101423; GFX11-GISEL-NEXT: v_max_i16 v5, v5, v111424; GFX11-GISEL-NEXT: v_max_i16 v7, v7, v131425; GFX11-GISEL-NEXT: v_bfe_i32 v9, v14, 0, 81426; GFX11-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 81427; GFX11-GISEL-NEXT: v_bfe_i32 v8, v8, 0, 81428; GFX11-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 81429; GFX11-GISEL-NEXT: v_bfe_i32 v10, v12, 0, 81430; GFX11-GISEL-NEXT: v_max_i16 v1, v1, v51431; GFX11-GISEL-NEXT: v_max_i16 v3, v3, v71432; GFX11-GISEL-NEXT: v_max_i16 v5, v6, v91433; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v81434; GFX11-GISEL-NEXT: v_max_i16 v4, v4, v101435; GFX11-GISEL-NEXT: s_sext_i32_i8 s0, s01436; GFX11-GISEL-NEXT: v_max_i16 v1, v1, v31437; GFX11-GISEL-NEXT: v_max_i16 v2, v2, v51438; GFX11-GISEL-NEXT: v_max_i16 v3, v3, s01439; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v41440; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1441; GFX11-GISEL-NEXT: v_max_i16 v4, v1, s01442; GFX11-GISEL-NEXT: v_max_i16 v5, v2, s01443; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1444; GFX11-GISEL-NEXT: v_max_i16 v3, v3, s01445; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v21446; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1447; GFX11-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v41448; GFX11-GISEL-NEXT: v_max_i16 v4, v5, s01449; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1450; GFX11-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v31451; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v11452; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1453; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v1, 8, v21454; GFX11-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v41455; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1456; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v11457; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v21458; GFX11-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v31459; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)1460; GFX11-GISEL-NEXT: v_or3_b32 v0, v0, v1, v21461; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]1462;1463; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v16i8:1464; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry1465; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x01466; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x01467; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x01468; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x01469; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x01470; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v16, v4, 0, 81471; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v4.l, v5.l1472; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v9.l1473; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v1, v1, 0, 81474; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v17, v0, 0, 81475; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v11.l1476; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v9, v4, 0, 81477; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v4, v5, 0, 81478; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v15.l1479; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v13, v13, 0, 81480; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v18.l, v2.l1481; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v7.l1482; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v7.l, v6.l1483; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v6, v0, 0, 81484; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v5, v5, 0, 81485; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v11, v3, 0, 81486; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v1.l1487; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v4.l1488; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v2, 0, 81489; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v5.l1490; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v4.l, v11.l1491; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v5.l, v6.l1492; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l1493; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v9.l1494; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v6.l, v13.l1495; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.h, v2.l, v3.l1496; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v1.h, v4.l, v5.l1497; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v8, v8, 0, 81498; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v7, v7, 0, 81499; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.l, v6.l1500; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v12, v12, 0, 81501; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v9.l, v14.l1502; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v6, v10, 0, 81503; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v7.l1504; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.l, v1.h, v0.h1505; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v17.l1506; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v8.l1507; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v5, v18, 0, 81508; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v4, v9, 0, 81509; GFX12-SDAG-TRUE16-NEXT: v_lshlrev_b16 v7.l, 8, v0.l1510; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v0.l, v6.l1511; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.h, v2.l, v3.l1512; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v2.l, v16.l1513; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v3.l, v12.l1514; GFX12-SDAG-TRUE16-NEXT: v_lshrrev_b32_e32 v6, 8, v71515; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v1.l, v1.l, v4.l1516; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v5.l, v0.l1517; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1518; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.h, v0.h, v2.l, v3.l1519; GFX12-SDAG-TRUE16-NEXT: v_bfe_i32 v2, v6, 0, 81520; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1521; GFX12-SDAG-TRUE16-NEXT: v_max3_i16 v0.l, v0.h, v0.l, v1.l1522; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v2.l1523; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1524; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v1.l1525; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1526;1527; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v16i8:1528; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry1529; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x01530; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x01531; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x01532; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x01533; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x01534; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v9, v9, 0, 81535; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 81536; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v13, v13, 0, 81537; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v5, v5, 0, 81538; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v11, v11, 0, 81539; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v15, v15, 0, 81540; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v7, v7, 0, 81541; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v3, 0, 81542; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v1, v1, v91543; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v0, v0, 0, 81544; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v9, v12, 0, 81545; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v7, v7, v151546; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v3, v3, v111547; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v1, v1, v5, v131548; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v5, v8, 0, 81549; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v4, v4, 0, 81550; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v8, v10, 0, 81551; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v6, v6, 0, 81552; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v1, v1, v3, v71553; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v3, v14, 0, 81554; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v2, v2, 0, 81555; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v51556; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1557; GFX12-SDAG-FAKE16-NEXT: v_lshlrev_b16 v1, 8, v11558; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v3, v6, v31559; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1560; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v2, v2, v81561; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v4, v91562; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)1563; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 8, v11564; GFX12-SDAG-FAKE16-NEXT: v_max3_i16 v0, v0, v2, v31565; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)1566; GFX12-SDAG-FAKE16-NEXT: v_bfe_i32 v1, v1, 0, 81567; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v11568; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]1569;1570; GFX12-GISEL-LABEL: test_vector_reduce_smax_v16i8:1571; GFX12-GISEL: ; %bb.0: ; %entry1572; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x01573; GFX12-GISEL-NEXT: s_wait_expcnt 0x01574; GFX12-GISEL-NEXT: s_wait_samplecnt 0x01575; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x01576; GFX12-GISEL-NEXT: s_wait_kmcnt 0x01577; GFX12-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 81578; GFX12-GISEL-NEXT: v_bfe_i32 v9, v9, 0, 81579; GFX12-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 81580; GFX12-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 81581; GFX12-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 81582; GFX12-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 81583; GFX12-GISEL-NEXT: v_max_i16 v1, v1, v91584; GFX12-GISEL-NEXT: v_bfe_i32 v9, v10, 0, 81585; GFX12-GISEL-NEXT: v_bfe_i32 v10, v11, 0, 81586; GFX12-GISEL-NEXT: v_bfe_i32 v11, v13, 0, 81587; GFX12-GISEL-NEXT: v_bfe_i32 v13, v15, 0, 81588; GFX12-GISEL-NEXT: v_bfe_i32 v6, v6, 0, 81589; GFX12-GISEL-NEXT: v_max_i16 v2, v2, v91590; GFX12-GISEL-NEXT: v_max_i16 v3, v3, v101591; GFX12-GISEL-NEXT: v_max_i16 v5, v5, v111592; GFX12-GISEL-NEXT: v_max_i16 v7, v7, v131593; GFX12-GISEL-NEXT: v_bfe_i32 v9, v14, 0, 81594; GFX12-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 81595; GFX12-GISEL-NEXT: v_bfe_i32 v8, v8, 0, 81596; GFX12-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 81597; GFX12-GISEL-NEXT: v_bfe_i32 v10, v12, 0, 81598; GFX12-GISEL-NEXT: v_max_i16 v1, v1, v51599; GFX12-GISEL-NEXT: v_max_i16 v3, v3, v71600; GFX12-GISEL-NEXT: v_max_i16 v5, v6, v91601; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v81602; GFX12-GISEL-NEXT: v_max_i16 v4, v4, v101603; GFX12-GISEL-NEXT: s_sext_i32_i8 s0, s01604; GFX12-GISEL-NEXT: v_max_i16 v1, v1, v31605; GFX12-GISEL-NEXT: v_max_i16 v2, v2, v51606; GFX12-GISEL-NEXT: s_wait_alu depctr_sa_sdst(0)1607; GFX12-GISEL-NEXT: v_max_i16 v3, v3, s01608; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v41609; GFX12-GISEL-NEXT: v_max_i16 v4, v1, s01610; GFX12-GISEL-NEXT: v_max_i16 v5, v2, s01611; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1612; GFX12-GISEL-NEXT: v_max_i16 v3, v3, s01613; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v21614; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1615; GFX12-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v41616; GFX12-GISEL-NEXT: v_max_i16 v4, v5, s01617; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1618; GFX12-GISEL-NEXT: v_and_b32_e32 v3, 0xff, v31619; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v11620; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1621; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v1, 8, v21622; GFX12-GISEL-NEXT: v_and_b32_e32 v2, 0xff, v41623; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1624; GFX12-GISEL-NEXT: v_and_or_b32 v0, 0xff, v0, v11625; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v21626; GFX12-GISEL-NEXT: v_lshlrev_b32_e32 v2, 24, v31627; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)1628; GFX12-GISEL-NEXT: v_or3_b32 v0, v0, v1, v21629; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]1630entry:1631 %res = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %v)1632 ret i8 %res1633}1634 1635; FIXME: With -new-reg-bank-select, v_alignbit_b32 is regression. Need pattern to look through COPY.1636define i16 @test_vector_reduce_smax_v2i16(<2 x i16> %v) {1637; GFX7-SDAG-LABEL: test_vector_reduce_smax_v2i16:1638; GFX7-SDAG: ; %bb.0: ; %entry1639; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1640; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 161641; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 161642; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v11643; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]1644;1645; GFX7-GISEL-LABEL: test_vector_reduce_smax_v2i16:1646; GFX7-GISEL: ; %bb.0: ; %entry1647; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1648; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 161649; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 161650; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v11651; GFX7-GISEL-NEXT: v_max_i32_e32 v1, 0, v11652; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v11653; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v01654; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v11655; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v11656; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]1657;1658; GFX8-SDAG-LABEL: test_vector_reduce_smax_v2i16:1659; GFX8-SDAG: ; %bb.0: ; %entry1660; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1661; GFX8-SDAG-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11662; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]1663;1664; GFX8-GISEL-LABEL: test_vector_reduce_smax_v2i16:1665; GFX8-GISEL: ; %bb.0: ; %entry1666; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1667; GFX8-GISEL-NEXT: v_mov_b32_e32 v2, s41668; GFX8-GISEL-NEXT: v_max_i16_sdwa v1, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11669; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD1670; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v1, v01671; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]1672;1673; GFX9-SDAG-LABEL: test_vector_reduce_smax_v2i16:1674; GFX9-SDAG: ; %bb.0: ; %entry1675; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1676; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11677; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]1678;1679; GFX9-GISEL-LABEL: test_vector_reduce_smax_v2i16:1680; GFX9-GISEL: ; %bb.0: ; %entry1681; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1682; GFX9-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 161683; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v11684; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]1685;1686; GFX10-SDAG-LABEL: test_vector_reduce_smax_v2i16:1687; GFX10-SDAG: ; %bb.0: ; %entry1688; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1689; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v01690; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v11691; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]1692;1693; GFX10-GISEL-LABEL: test_vector_reduce_smax_v2i16:1694; GFX10-GISEL: ; %bb.0: ; %entry1695; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1696; GFX10-GISEL-NEXT: v_alignbit_b32 v1, s4, v0, 161697; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v11698; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]1699;1700; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v2i16:1701; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry1702; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1703; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h1704; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1705;1706; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v2i16:1707; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry1708; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1709; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v01710; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1711; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v11712; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]1713;1714; GFX11-GISEL-LABEL: test_vector_reduce_smax_v2i16:1715; GFX11-GISEL: ; %bb.0: ; %entry1716; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1717; GFX11-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 161718; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)1719; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v11720; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]1721;1722; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v2i16:1723; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry1724; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x01725; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x01726; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x01727; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x01728; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x01729; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h1730; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1731;1732; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v2i16:1733; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry1734; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x01735; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x01736; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x01737; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x01738; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x01739; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v01740; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1741; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v11742; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]1743;1744; GFX12-GISEL-LABEL: test_vector_reduce_smax_v2i16:1745; GFX12-GISEL: ; %bb.0: ; %entry1746; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x01747; GFX12-GISEL-NEXT: s_wait_expcnt 0x01748; GFX12-GISEL-NEXT: s_wait_samplecnt 0x01749; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x01750; GFX12-GISEL-NEXT: s_wait_kmcnt 0x01751; GFX12-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 161752; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)1753; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v11754; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]1755entry:1756 %res = call i16 @llvm.vector.reduce.smax.v2i16(<2 x i16> %v)1757 ret i16 %res1758}1759 1760define i16 @test_vector_reduce_smax_v3i16(<3 x i16> %v) {1761; GFX7-SDAG-LABEL: test_vector_reduce_smax_v3i16:1762; GFX7-SDAG: ; %bb.0: ; %entry1763; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1764; GFX7-SDAG-NEXT: v_and_b32_e32 v2, 0xffff, v21765; GFX7-SDAG-NEXT: v_or_b32_e32 v2, 0x80000000, v21766; GFX7-SDAG-NEXT: v_ashrrev_i32_e32 v3, 16, v21767; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 161768; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 161769; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v21770; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 161771; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v1, v31772; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]1773;1774; GFX7-GISEL-LABEL: test_vector_reduce_smax_v3i16:1775; GFX7-GISEL: ; %bb.0: ; %entry1776; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1777; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 161778; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 161779; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v11780; GFX7-GISEL-NEXT: v_bfe_i32 v1, v2, 0, 161781; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v11782; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]1783;1784; GFX8-LABEL: test_vector_reduce_smax_v3i16:1785; GFX8: ; %bb.0: ; %entry1786; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1787; GFX8-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11788; GFX8-NEXT: v_max_i16_e32 v0, v0, v11789; GFX8-NEXT: s_setpc_b64 s[30:31]1790;1791; GFX9-SDAG-LABEL: test_vector_reduce_smax_v3i16:1792; GFX9-SDAG: ; %bb.0: ; %entry1793; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1794; GFX9-SDAG-NEXT: s_movk_i32 s0, 0x80001795; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0x50401001796; GFX9-SDAG-NEXT: v_perm_b32 v1, s0, v1, v21797; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v11798; GFX9-SDAG-NEXT: s_nop 01799; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11800; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]1801;1802; GFX9-GISEL-LABEL: test_vector_reduce_smax_v3i16:1803; GFX9-GISEL: ; %bb.0: ; %entry1804; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1805; GFX9-GISEL-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11806; GFX9-GISEL-NEXT: v_max_i16_e32 v0, v0, v11807; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]1808;1809; GFX10-SDAG-LABEL: test_vector_reduce_smax_v3i16:1810; GFX10-SDAG: ; %bb.0: ; %entry1811; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1812; GFX10-SDAG-NEXT: s_movk_i32 s4, 0x80001813; GFX10-SDAG-NEXT: v_perm_b32 v1, s4, v1, 0x50401001814; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v11815; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v01816; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v11817; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]1818;1819; GFX10-GISEL-LABEL: test_vector_reduce_smax_v3i16:1820; GFX10-GISEL: ; %bb.0: ; %entry1821; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1822; GFX10-GISEL-NEXT: v_lshrrev_b32_e32 v2, 16, v01823; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v21824; GFX10-GISEL-NEXT: v_max_i16 v0, v0, v11825; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]1826;1827; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v3i16:1828; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry1829; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1830; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.h, 0x80001831; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1832; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v11833; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h1834; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1835;1836; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v3i16:1837; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry1838; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1839; GFX11-SDAG-FAKE16-NEXT: s_movk_i32 s0, 0x80001840; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)1841; GFX11-SDAG-FAKE16-NEXT: v_perm_b32 v1, s0, v1, 0x50401001842; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v11843; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1844; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v01845; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v11846; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]1847;1848; GFX11-GISEL-LABEL: test_vector_reduce_smax_v3i16:1849; GFX11-GISEL: ; %bb.0: ; %entry1850; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1851; GFX11-GISEL-NEXT: v_lshrrev_b32_e32 v2, 16, v01852; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1853; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v21854; GFX11-GISEL-NEXT: v_max_i16 v0, v0, v11855; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]1856;1857; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v3i16:1858; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry1859; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x01860; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x01861; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x01862; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x01863; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x01864; GFX12-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.h, 0x80001865; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1866; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v11867; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h1868; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1869;1870; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v3i16:1871; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry1872; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x01873; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x01874; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x01875; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x01876; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x01877; GFX12-SDAG-FAKE16-NEXT: s_movk_i32 s0, 0x80001878; GFX12-SDAG-FAKE16-NEXT: s_wait_alu depctr_sa_sdst(0)1879; GFX12-SDAG-FAKE16-NEXT: v_perm_b32 v1, s0, v1, 0x50401001880; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1881; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v11882; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v01883; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1884; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v11885; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]1886;1887; GFX12-GISEL-LABEL: test_vector_reduce_smax_v3i16:1888; GFX12-GISEL: ; %bb.0: ; %entry1889; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x01890; GFX12-GISEL-NEXT: s_wait_expcnt 0x01891; GFX12-GISEL-NEXT: s_wait_samplecnt 0x01892; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x01893; GFX12-GISEL-NEXT: s_wait_kmcnt 0x01894; GFX12-GISEL-NEXT: v_lshrrev_b32_e32 v2, 16, v01895; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1896; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v21897; GFX12-GISEL-NEXT: v_max_i16 v0, v0, v11898; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]1899entry:1900 %res = call i16 @llvm.vector.reduce.smax.v3i16(<3 x i16> %v)1901 ret i16 %res1902}1903 1904; FIXME: With -new-reg-bank-select, v_alignbit_b32 is regression. Need pattern to look through COPY.1905define i16 @test_vector_reduce_smax_v4i16(<4 x i16> %v) {1906; GFX7-SDAG-LABEL: test_vector_reduce_smax_v4i16:1907; GFX7-SDAG: ; %bb.0: ; %entry1908; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1909; GFX7-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 161910; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 161911; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 161912; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 161913; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v31914; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v11915; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]1916;1917; GFX7-GISEL-LABEL: test_vector_reduce_smax_v4i16:1918; GFX7-GISEL: ; %bb.0: ; %entry1919; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1920; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 161921; GFX7-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 161922; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v21923; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 161924; GFX7-GISEL-NEXT: v_bfe_i32 v2, v3, 0, 161925; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v21926; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v11927; GFX7-GISEL-NEXT: v_max_i32_e32 v1, 0, v11928; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v11929; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v01930; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v11931; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v11932; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]1933;1934; GFX8-SDAG-LABEL: test_vector_reduce_smax_v4i16:1935; GFX8-SDAG: ; %bb.0: ; %entry1936; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1937; GFX8-SDAG-NEXT: v_max_i16_sdwa v2, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_11938; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v11939; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v21940; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]1941;1942; GFX8-GISEL-LABEL: test_vector_reduce_smax_v4i16:1943; GFX8-GISEL: ; %bb.0: ; %entry1944; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1945; GFX8-GISEL-NEXT: v_max_i16_e32 v2, v0, v11946; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_11947; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v2, v01948; GFX8-GISEL-NEXT: v_mov_b32_e32 v2, s41949; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD1950; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v1, v01951; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]1952;1953; GFX9-SDAG-LABEL: test_vector_reduce_smax_v4i16:1954; GFX9-SDAG: ; %bb.0: ; %entry1955; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1956; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v11957; GFX9-SDAG-NEXT: s_nop 01958; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11959; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]1960;1961; GFX9-GISEL-LABEL: test_vector_reduce_smax_v4i16:1962; GFX9-GISEL: ; %bb.0: ; %entry1963; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1964; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v11965; GFX9-GISEL-NEXT: s_nop 01966; GFX9-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 161967; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v11968; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]1969;1970; GFX10-SDAG-LABEL: test_vector_reduce_smax_v4i16:1971; GFX10-SDAG: ; %bb.0: ; %entry1972; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1973; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v11974; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v01975; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v11976; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]1977;1978; GFX10-GISEL-LABEL: test_vector_reduce_smax_v4i16:1979; GFX10-GISEL: ; %bb.0: ; %entry1980; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1981; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v11982; GFX10-GISEL-NEXT: v_alignbit_b32 v1, s4, v0, 161983; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v11984; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]1985;1986; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v4i16:1987; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry1988; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1989; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v11990; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1991; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h1992; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]1993;1994; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v4i16:1995; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry1996; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1997; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v11998; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1999; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v02000; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v12001; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]2002;2003; GFX11-GISEL-LABEL: test_vector_reduce_smax_v4i16:2004; GFX11-GISEL: ; %bb.0: ; %entry2005; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2006; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v12007; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2008; GFX11-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162009; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v12010; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]2011;2012; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v4i16:2013; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry2014; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x02015; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x02016; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x02017; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x02018; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x02019; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v12020; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)2021; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h2022; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]2023;2024; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v4i16:2025; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry2026; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x02027; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x02028; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x02029; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x02030; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x02031; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v12032; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2033; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v02034; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v12035; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]2036;2037; GFX12-GISEL-LABEL: test_vector_reduce_smax_v4i16:2038; GFX12-GISEL: ; %bb.0: ; %entry2039; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x02040; GFX12-GISEL-NEXT: s_wait_expcnt 0x02041; GFX12-GISEL-NEXT: s_wait_samplecnt 0x02042; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x02043; GFX12-GISEL-NEXT: s_wait_kmcnt 0x02044; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v12045; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2046; GFX12-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162047; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v12048; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]2049entry:2050 %res = call i16 @llvm.vector.reduce.smax.v4i16(<4 x i16> %v)2051 ret i16 %res2052}2053 2054; FIXME: With -new-reg-bank-select, v_alignbit_b32 is regression. Need pattern to look through COPY.2055define i16 @test_vector_reduce_smax_v8i16(<8 x i16> %v) {2056; GFX7-SDAG-LABEL: test_vector_reduce_smax_v8i16:2057; GFX7-SDAG: ; %bb.0: ; %entry2058; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2059; GFX7-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 162060; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 162061; GFX7-SDAG-NEXT: v_bfe_i32 v4, v4, 0, 162062; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 162063; GFX7-SDAG-NEXT: v_bfe_i32 v6, v6, 0, 162064; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 162065; GFX7-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 162066; GFX7-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 162067; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v42068; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v52069; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v3, v72070; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v62071; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v12072; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]2073;2074; GFX7-GISEL-LABEL: test_vector_reduce_smax_v8i16:2075; GFX7-GISEL: ; %bb.0: ; %entry2076; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2077; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 162078; GFX7-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 162079; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v42080; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 162081; GFX7-GISEL-NEXT: v_bfe_i32 v4, v5, 0, 162082; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v42083; GFX7-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 162084; GFX7-GISEL-NEXT: v_bfe_i32 v4, v6, 0, 162085; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v42086; GFX7-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 162087; GFX7-GISEL-NEXT: v_bfe_i32 v4, v7, 0, 162088; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v42089; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v22090; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v32091; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v12092; GFX7-GISEL-NEXT: v_max_i32_e32 v1, 0, v12093; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v12094; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v02095; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v12096; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v12097; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]2098;2099; GFX8-SDAG-LABEL: test_vector_reduce_smax_v8i16:2100; GFX8-SDAG: ; %bb.0: ; %entry2101; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2102; GFX8-SDAG-NEXT: v_max_i16_sdwa v4, v1, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12103; GFX8-SDAG-NEXT: v_max_i16_sdwa v5, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12104; GFX8-SDAG-NEXT: v_max_i16_e32 v1, v1, v32105; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v22106; GFX8-SDAG-NEXT: v_max_i16_e32 v2, v5, v42107; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v12108; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v22109; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]2110;2111; GFX8-GISEL-LABEL: test_vector_reduce_smax_v8i16:2112; GFX8-GISEL: ; %bb.0: ; %entry2113; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2114; GFX8-GISEL-NEXT: v_max_i16_e32 v4, v0, v22115; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12116; GFX8-GISEL-NEXT: v_max_i16_e32 v2, v1, v32117; GFX8-GISEL-NEXT: v_max_i16_sdwa v1, v1, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12118; GFX8-GISEL-NEXT: v_max_i16_e32 v2, v4, v22119; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v12120; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v2, v02121; GFX8-GISEL-NEXT: v_mov_b32_e32 v2, s42122; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD2123; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v1, v02124; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]2125;2126; GFX9-SDAG-LABEL: test_vector_reduce_smax_v8i16:2127; GFX9-SDAG: ; %bb.0: ; %entry2128; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2129; GFX9-SDAG-NEXT: v_pk_max_i16 v1, v1, v32130; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v22131; GFX9-SDAG-NEXT: s_nop 02132; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v12133; GFX9-SDAG-NEXT: s_nop 02134; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_12135; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]2136;2137; GFX9-GISEL-LABEL: test_vector_reduce_smax_v8i16:2138; GFX9-GISEL: ; %bb.0: ; %entry2139; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2140; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v22141; GFX9-GISEL-NEXT: v_pk_max_i16 v1, v1, v32142; GFX9-GISEL-NEXT: s_nop 02143; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v12144; GFX9-GISEL-NEXT: s_nop 02145; GFX9-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162146; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v12147; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]2148;2149; GFX10-SDAG-LABEL: test_vector_reduce_smax_v8i16:2150; GFX10-SDAG: ; %bb.0: ; %entry2151; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2152; GFX10-SDAG-NEXT: v_pk_max_i16 v1, v1, v32153; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v22154; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v12155; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v02156; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v12157; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]2158;2159; GFX10-GISEL-LABEL: test_vector_reduce_smax_v8i16:2160; GFX10-GISEL: ; %bb.0: ; %entry2161; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2162; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v22163; GFX10-GISEL-NEXT: v_pk_max_i16 v1, v1, v32164; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v12165; GFX10-GISEL-NEXT: v_alignbit_b32 v1, s4, v0, 162166; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v12167; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]2168;2169; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v8i16:2170; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry2171; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2172; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v1, v1, v32173; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v22174; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2175; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v12176; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h2177; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]2178;2179; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v8i16:2180; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry2181; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2182; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v1, v1, v32183; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v22184; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2185; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v12186; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v02187; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)2188; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v12189; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]2190;2191; GFX11-GISEL-LABEL: test_vector_reduce_smax_v8i16:2192; GFX11-GISEL: ; %bb.0: ; %entry2193; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2194; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v22195; GFX11-GISEL-NEXT: v_pk_max_i16 v1, v1, v32196; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2197; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v12198; GFX11-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162199; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2200; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v12201; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]2202;2203; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v8i16:2204; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry2205; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x02206; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x02207; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x02208; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x02209; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x02210; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v1, v1, v32211; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v22212; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2213; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v12214; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h2215; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]2216;2217; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v8i16:2218; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry2219; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x02220; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x02221; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x02222; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x02223; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x02224; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v1, v1, v32225; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v22226; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2227; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v12228; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v02229; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)2230; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v12231; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]2232;2233; GFX12-GISEL-LABEL: test_vector_reduce_smax_v8i16:2234; GFX12-GISEL: ; %bb.0: ; %entry2235; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x02236; GFX12-GISEL-NEXT: s_wait_expcnt 0x02237; GFX12-GISEL-NEXT: s_wait_samplecnt 0x02238; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x02239; GFX12-GISEL-NEXT: s_wait_kmcnt 0x02240; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v22241; GFX12-GISEL-NEXT: v_pk_max_i16 v1, v1, v32242; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2243; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v12244; GFX12-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162245; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2246; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v12247; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]2248entry:2249 %res = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> %v)2250 ret i16 %res2251}2252 2253; FIXME: With -new-reg-bank-select, v_alignbit_b32 is regression. Need pattern to look through COPY.2254define i16 @test_vector_reduce_smax_v16i16(<16 x i16> %v) {2255; GFX7-SDAG-LABEL: test_vector_reduce_smax_v16i16:2256; GFX7-SDAG: ; %bb.0: ; %entry2257; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2258; GFX7-SDAG-NEXT: v_bfe_i32 v8, v8, 0, 162259; GFX7-SDAG-NEXT: v_bfe_i32 v0, v0, 0, 162260; GFX7-SDAG-NEXT: v_bfe_i32 v9, v9, 0, 162261; GFX7-SDAG-NEXT: v_bfe_i32 v1, v1, 0, 162262; GFX7-SDAG-NEXT: v_bfe_i32 v13, v13, 0, 162263; GFX7-SDAG-NEXT: v_bfe_i32 v5, v5, 0, 162264; GFX7-SDAG-NEXT: v_bfe_i32 v12, v12, 0, 162265; GFX7-SDAG-NEXT: v_bfe_i32 v4, v4, 0, 162266; GFX7-SDAG-NEXT: v_bfe_i32 v11, v11, 0, 162267; GFX7-SDAG-NEXT: v_bfe_i32 v3, v3, 0, 162268; GFX7-SDAG-NEXT: v_bfe_i32 v15, v15, 0, 162269; GFX7-SDAG-NEXT: v_bfe_i32 v7, v7, 0, 162270; GFX7-SDAG-NEXT: v_bfe_i32 v10, v10, 0, 162271; GFX7-SDAG-NEXT: v_bfe_i32 v2, v2, 0, 162272; GFX7-SDAG-NEXT: v_bfe_i32 v14, v14, 0, 162273; GFX7-SDAG-NEXT: v_bfe_i32 v6, v6, 0, 162274; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v92275; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v82276; GFX7-SDAG-NEXT: v_max_i32_e32 v6, v6, v142277; GFX7-SDAG-NEXT: v_max_i32_e32 v2, v2, v102278; GFX7-SDAG-NEXT: v_max_i32_e32 v7, v7, v152279; GFX7-SDAG-NEXT: v_max_i32_e32 v3, v3, v112280; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v4, v122281; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v5, v132282; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v3, v72283; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v62284; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v12285; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]2286;2287; GFX7-GISEL-LABEL: test_vector_reduce_smax_v16i16:2288; GFX7-GISEL: ; %bb.0: ; %entry2289; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2290; GFX7-GISEL-NEXT: v_bfe_i32 v0, v0, 0, 162291; GFX7-GISEL-NEXT: v_bfe_i32 v8, v8, 0, 162292; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v82293; GFX7-GISEL-NEXT: v_bfe_i32 v1, v1, 0, 162294; GFX7-GISEL-NEXT: v_bfe_i32 v8, v9, 0, 162295; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v82296; GFX7-GISEL-NEXT: v_bfe_i32 v2, v2, 0, 162297; GFX7-GISEL-NEXT: v_bfe_i32 v8, v10, 0, 162298; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v82299; GFX7-GISEL-NEXT: v_bfe_i32 v3, v3, 0, 162300; GFX7-GISEL-NEXT: v_bfe_i32 v8, v11, 0, 162301; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v82302; GFX7-GISEL-NEXT: v_bfe_i32 v4, v4, 0, 162303; GFX7-GISEL-NEXT: v_bfe_i32 v8, v12, 0, 162304; GFX7-GISEL-NEXT: v_max_i32_e32 v4, v4, v82305; GFX7-GISEL-NEXT: v_bfe_i32 v5, v5, 0, 162306; GFX7-GISEL-NEXT: v_bfe_i32 v8, v13, 0, 162307; GFX7-GISEL-NEXT: v_max_i32_e32 v5, v5, v82308; GFX7-GISEL-NEXT: v_bfe_i32 v6, v6, 0, 162309; GFX7-GISEL-NEXT: v_bfe_i32 v8, v14, 0, 162310; GFX7-GISEL-NEXT: v_max_i32_e32 v6, v6, v82311; GFX7-GISEL-NEXT: v_bfe_i32 v7, v7, 0, 162312; GFX7-GISEL-NEXT: v_bfe_i32 v8, v15, 0, 162313; GFX7-GISEL-NEXT: v_max_i32_e32 v7, v7, v82314; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v42315; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v52316; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v62317; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v72318; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v22319; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v32320; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v12321; GFX7-GISEL-NEXT: v_max_i32_e32 v1, 0, v12322; GFX7-GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v12323; GFX7-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v02324; GFX7-GISEL-NEXT: v_lshlrev_b32_e32 v1, 16, v12325; GFX7-GISEL-NEXT: v_or_b32_e32 v0, v0, v12326; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]2327;2328; GFX8-SDAG-LABEL: test_vector_reduce_smax_v16i16:2329; GFX8-SDAG: ; %bb.0: ; %entry2330; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2331; GFX8-SDAG-NEXT: v_max_i16_sdwa v8, v2, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12332; GFX8-SDAG-NEXT: v_max_i16_sdwa v9, v0, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12333; GFX8-SDAG-NEXT: v_max_i16_sdwa v10, v3, v7 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12334; GFX8-SDAG-NEXT: v_max_i16_sdwa v11, v1, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12335; GFX8-SDAG-NEXT: v_max_i16_e32 v2, v2, v62336; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v42337; GFX8-SDAG-NEXT: v_max_i16_e32 v3, v3, v72338; GFX8-SDAG-NEXT: v_max_i16_e32 v1, v1, v52339; GFX8-SDAG-NEXT: v_max_i16_e32 v4, v11, v102340; GFX8-SDAG-NEXT: v_max_i16_e32 v5, v9, v82341; GFX8-SDAG-NEXT: v_max_i16_e32 v1, v1, v32342; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v22343; GFX8-SDAG-NEXT: v_max_i16_e32 v2, v5, v42344; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v12345; GFX8-SDAG-NEXT: v_max_i16_e32 v0, v0, v22346; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]2347;2348; GFX8-GISEL-LABEL: test_vector_reduce_smax_v16i16:2349; GFX8-GISEL: ; %bb.0: ; %entry2350; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2351; GFX8-GISEL-NEXT: v_max_i16_e32 v8, v0, v42352; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12353; GFX8-GISEL-NEXT: v_max_i16_e32 v4, v1, v52354; GFX8-GISEL-NEXT: v_max_i16_sdwa v1, v1, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12355; GFX8-GISEL-NEXT: v_max_i16_e32 v5, v2, v62356; GFX8-GISEL-NEXT: v_max_i16_sdwa v2, v2, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12357; GFX8-GISEL-NEXT: v_max_i16_e32 v6, v3, v72358; GFX8-GISEL-NEXT: v_max_i16_sdwa v3, v3, v7 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_12359; GFX8-GISEL-NEXT: v_max_i16_e32 v5, v8, v52360; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v22361; GFX8-GISEL-NEXT: v_max_i16_e32 v2, v4, v62362; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v1, v32363; GFX8-GISEL-NEXT: v_max_i16_e32 v2, v5, v22364; GFX8-GISEL-NEXT: v_max_i16_e32 v0, v0, v12365; GFX8-GISEL-NEXT: v_max_i16_e32 v1, v2, v02366; GFX8-GISEL-NEXT: v_mov_b32_e32 v2, s42367; GFX8-GISEL-NEXT: v_max_i16_sdwa v0, v0, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD2368; GFX8-GISEL-NEXT: v_or_b32_e32 v0, v1, v02369; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]2370;2371; GFX9-SDAG-LABEL: test_vector_reduce_smax_v16i16:2372; GFX9-SDAG: ; %bb.0: ; %entry2373; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2374; GFX9-SDAG-NEXT: v_pk_max_i16 v2, v2, v62375; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v42376; GFX9-SDAG-NEXT: v_pk_max_i16 v3, v3, v72377; GFX9-SDAG-NEXT: v_pk_max_i16 v1, v1, v52378; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v22379; GFX9-SDAG-NEXT: v_pk_max_i16 v1, v1, v32380; GFX9-SDAG-NEXT: s_nop 02381; GFX9-SDAG-NEXT: v_pk_max_i16 v0, v0, v12382; GFX9-SDAG-NEXT: s_nop 02383; GFX9-SDAG-NEXT: v_max_i16_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_12384; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]2385;2386; GFX9-GISEL-LABEL: test_vector_reduce_smax_v16i16:2387; GFX9-GISEL: ; %bb.0: ; %entry2388; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2389; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v42390; GFX9-GISEL-NEXT: v_pk_max_i16 v1, v1, v52391; GFX9-GISEL-NEXT: v_pk_max_i16 v2, v2, v62392; GFX9-GISEL-NEXT: v_pk_max_i16 v3, v3, v72393; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v22394; GFX9-GISEL-NEXT: v_pk_max_i16 v1, v1, v32395; GFX9-GISEL-NEXT: s_nop 02396; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v12397; GFX9-GISEL-NEXT: s_nop 02398; GFX9-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162399; GFX9-GISEL-NEXT: v_pk_max_i16 v0, v0, v12400; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]2401;2402; GFX10-SDAG-LABEL: test_vector_reduce_smax_v16i16:2403; GFX10-SDAG: ; %bb.0: ; %entry2404; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2405; GFX10-SDAG-NEXT: v_pk_max_i16 v2, v2, v62406; GFX10-SDAG-NEXT: v_pk_max_i16 v3, v3, v72407; GFX10-SDAG-NEXT: v_pk_max_i16 v1, v1, v52408; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v42409; GFX10-SDAG-NEXT: v_pk_max_i16 v1, v1, v32410; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v22411; GFX10-SDAG-NEXT: v_pk_max_i16 v0, v0, v12412; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v02413; GFX10-SDAG-NEXT: v_max_i16 v0, v0, v12414; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]2415;2416; GFX10-GISEL-LABEL: test_vector_reduce_smax_v16i16:2417; GFX10-GISEL: ; %bb.0: ; %entry2418; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2419; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v42420; GFX10-GISEL-NEXT: v_pk_max_i16 v1, v1, v52421; GFX10-GISEL-NEXT: v_pk_max_i16 v2, v2, v62422; GFX10-GISEL-NEXT: v_pk_max_i16 v3, v3, v72423; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v22424; GFX10-GISEL-NEXT: v_pk_max_i16 v1, v1, v32425; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v12426; GFX10-GISEL-NEXT: v_alignbit_b32 v1, s4, v0, 162427; GFX10-GISEL-NEXT: v_pk_max_i16 v0, v0, v12428; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]2429;2430; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v16i16:2431; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry2432; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2433; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v2, v2, v62434; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v3, v3, v72435; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v1, v1, v52436; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v42437; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2438; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v1, v1, v32439; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v22440; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2441; GFX11-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v12442; GFX11-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h2443; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]2444;2445; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v16i16:2446; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry2447; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2448; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v2, v2, v62449; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v3, v3, v72450; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v1, v1, v52451; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v42452; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2453; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v1, v1, v32454; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v22455; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2456; GFX11-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v12457; GFX11-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v02458; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)2459; GFX11-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v12460; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]2461;2462; GFX11-GISEL-LABEL: test_vector_reduce_smax_v16i16:2463; GFX11-GISEL: ; %bb.0: ; %entry2464; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2465; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v42466; GFX11-GISEL-NEXT: v_pk_max_i16 v1, v1, v52467; GFX11-GISEL-NEXT: v_pk_max_i16 v2, v2, v62468; GFX11-GISEL-NEXT: v_pk_max_i16 v3, v3, v72469; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2470; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v22471; GFX11-GISEL-NEXT: v_pk_max_i16 v1, v1, v32472; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2473; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v12474; GFX11-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162475; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2476; GFX11-GISEL-NEXT: v_pk_max_i16 v0, v0, v12477; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]2478;2479; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_smax_v16i16:2480; GFX12-SDAG-TRUE16: ; %bb.0: ; %entry2481; GFX12-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x02482; GFX12-SDAG-TRUE16-NEXT: s_wait_expcnt 0x02483; GFX12-SDAG-TRUE16-NEXT: s_wait_samplecnt 0x02484; GFX12-SDAG-TRUE16-NEXT: s_wait_bvhcnt 0x02485; GFX12-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x02486; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v2, v2, v62487; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v3, v3, v72488; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v1, v1, v52489; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v42490; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2491; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v1, v1, v32492; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v22493; GFX12-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2494; GFX12-SDAG-TRUE16-NEXT: v_pk_max_i16 v0, v0, v12495; GFX12-SDAG-TRUE16-NEXT: v_max_i16 v0.l, v0.l, v0.h2496; GFX12-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]2497;2498; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_smax_v16i16:2499; GFX12-SDAG-FAKE16: ; %bb.0: ; %entry2500; GFX12-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x02501; GFX12-SDAG-FAKE16-NEXT: s_wait_expcnt 0x02502; GFX12-SDAG-FAKE16-NEXT: s_wait_samplecnt 0x02503; GFX12-SDAG-FAKE16-NEXT: s_wait_bvhcnt 0x02504; GFX12-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x02505; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v2, v2, v62506; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v3, v3, v72507; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v1, v1, v52508; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v42509; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2510; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v1, v1, v32511; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v22512; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2513; GFX12-SDAG-FAKE16-NEXT: v_pk_max_i16 v0, v0, v12514; GFX12-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v02515; GFX12-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)2516; GFX12-SDAG-FAKE16-NEXT: v_max_i16 v0, v0, v12517; GFX12-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]2518;2519; GFX12-GISEL-LABEL: test_vector_reduce_smax_v16i16:2520; GFX12-GISEL: ; %bb.0: ; %entry2521; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x02522; GFX12-GISEL-NEXT: s_wait_expcnt 0x02523; GFX12-GISEL-NEXT: s_wait_samplecnt 0x02524; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x02525; GFX12-GISEL-NEXT: s_wait_kmcnt 0x02526; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v42527; GFX12-GISEL-NEXT: v_pk_max_i16 v1, v1, v52528; GFX12-GISEL-NEXT: v_pk_max_i16 v2, v2, v62529; GFX12-GISEL-NEXT: v_pk_max_i16 v3, v3, v72530; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2531; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v22532; GFX12-GISEL-NEXT: v_pk_max_i16 v1, v1, v32533; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)2534; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v12535; GFX12-GISEL-NEXT: v_alignbit_b32 v1, s0, v0, 162536; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2537; GFX12-GISEL-NEXT: v_pk_max_i16 v0, v0, v12538; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]2539entry:2540 %res = call i16 @llvm.vector.reduce.smax.v16i16(<16 x i16> %v)2541 ret i16 %res2542}2543 2544 2545define i32 @test_vector_reduce_smax_v2i32(<2 x i32> %v) {2546; GFX7-LABEL: test_vector_reduce_smax_v2i32:2547; GFX7: ; %bb.0: ; %entry2548; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2549; GFX7-NEXT: v_max_i32_e32 v0, v0, v12550; GFX7-NEXT: s_setpc_b64 s[30:31]2551;2552; GFX8-LABEL: test_vector_reduce_smax_v2i32:2553; GFX8: ; %bb.0: ; %entry2554; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2555; GFX8-NEXT: v_max_i32_e32 v0, v0, v12556; GFX8-NEXT: s_setpc_b64 s[30:31]2557;2558; GFX9-LABEL: test_vector_reduce_smax_v2i32:2559; GFX9: ; %bb.0: ; %entry2560; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2561; GFX9-NEXT: v_max_i32_e32 v0, v0, v12562; GFX9-NEXT: s_setpc_b64 s[30:31]2563;2564; GFX10-LABEL: test_vector_reduce_smax_v2i32:2565; GFX10: ; %bb.0: ; %entry2566; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2567; GFX10-NEXT: v_max_i32_e32 v0, v0, v12568; GFX10-NEXT: s_setpc_b64 s[30:31]2569;2570; GFX11-LABEL: test_vector_reduce_smax_v2i32:2571; GFX11: ; %bb.0: ; %entry2572; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2573; GFX11-NEXT: v_max_i32_e32 v0, v0, v12574; GFX11-NEXT: s_setpc_b64 s[30:31]2575;2576; GFX12-LABEL: test_vector_reduce_smax_v2i32:2577; GFX12: ; %bb.0: ; %entry2578; GFX12-NEXT: s_wait_loadcnt_dscnt 0x02579; GFX12-NEXT: s_wait_expcnt 0x02580; GFX12-NEXT: s_wait_samplecnt 0x02581; GFX12-NEXT: s_wait_bvhcnt 0x02582; GFX12-NEXT: s_wait_kmcnt 0x02583; GFX12-NEXT: v_max_i32_e32 v0, v0, v12584; GFX12-NEXT: s_setpc_b64 s[30:31]2585entry:2586 %res = call i32 @llvm.vector.reduce.smax.v2i32(<2 x i32> %v)2587 ret i32 %res2588}2589 2590define i32 @test_vector_reduce_smax_v3i32(<3 x i32> %v) {2591; GFX7-SDAG-LABEL: test_vector_reduce_smax_v3i32:2592; GFX7-SDAG: ; %bb.0: ; %entry2593; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2594; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v1, v22595; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]2596;2597; GFX7-GISEL-LABEL: test_vector_reduce_smax_v3i32:2598; GFX7-GISEL: ; %bb.0: ; %entry2599; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2600; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v12601; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v22602; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]2603;2604; GFX8-SDAG-LABEL: test_vector_reduce_smax_v3i32:2605; GFX8-SDAG: ; %bb.0: ; %entry2606; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2607; GFX8-SDAG-NEXT: v_max3_i32 v0, v0, v1, v22608; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]2609;2610; GFX8-GISEL-LABEL: test_vector_reduce_smax_v3i32:2611; GFX8-GISEL: ; %bb.0: ; %entry2612; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2613; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v12614; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v22615; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]2616;2617; GFX9-SDAG-LABEL: test_vector_reduce_smax_v3i32:2618; GFX9-SDAG: ; %bb.0: ; %entry2619; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2620; GFX9-SDAG-NEXT: v_max3_i32 v0, v0, v1, v22621; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]2622;2623; GFX9-GISEL-LABEL: test_vector_reduce_smax_v3i32:2624; GFX9-GISEL: ; %bb.0: ; %entry2625; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2626; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v12627; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v22628; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]2629;2630; GFX10-SDAG-LABEL: test_vector_reduce_smax_v3i32:2631; GFX10-SDAG: ; %bb.0: ; %entry2632; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2633; GFX10-SDAG-NEXT: v_max3_i32 v0, v0, v1, v22634; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]2635;2636; GFX10-GISEL-LABEL: test_vector_reduce_smax_v3i32:2637; GFX10-GISEL: ; %bb.0: ; %entry2638; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2639; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v12640; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v22641; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]2642;2643; GFX11-SDAG-LABEL: test_vector_reduce_smax_v3i32:2644; GFX11-SDAG: ; %bb.0: ; %entry2645; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2646; GFX11-SDAG-NEXT: v_max3_i32 v0, v0, v1, v22647; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]2648;2649; GFX11-GISEL-LABEL: test_vector_reduce_smax_v3i32:2650; GFX11-GISEL: ; %bb.0: ; %entry2651; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2652; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v12653; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2654; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v22655; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]2656;2657; GFX12-SDAG-LABEL: test_vector_reduce_smax_v3i32:2658; GFX12-SDAG: ; %bb.0: ; %entry2659; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x02660; GFX12-SDAG-NEXT: s_wait_expcnt 0x02661; GFX12-SDAG-NEXT: s_wait_samplecnt 0x02662; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x02663; GFX12-SDAG-NEXT: s_wait_kmcnt 0x02664; GFX12-SDAG-NEXT: v_max3_i32 v0, v0, v1, v22665; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]2666;2667; GFX12-GISEL-LABEL: test_vector_reduce_smax_v3i32:2668; GFX12-GISEL: ; %bb.0: ; %entry2669; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x02670; GFX12-GISEL-NEXT: s_wait_expcnt 0x02671; GFX12-GISEL-NEXT: s_wait_samplecnt 0x02672; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x02673; GFX12-GISEL-NEXT: s_wait_kmcnt 0x02674; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v12675; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2676; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v22677; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]2678entry:2679 %res = call i32 @llvm.vector.reduce.smax.v3i32(<3 x i32> %v)2680 ret i32 %res2681}2682 2683define i32 @test_vector_reduce_smax_v4i32(<4 x i32> %v) {2684; GFX7-SDAG-LABEL: test_vector_reduce_smax_v4i32:2685; GFX7-SDAG: ; %bb.0: ; %entry2686; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2687; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v32688; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v2, v12689; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]2690;2691; GFX7-GISEL-LABEL: test_vector_reduce_smax_v4i32:2692; GFX7-GISEL: ; %bb.0: ; %entry2693; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2694; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v22695; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v32696; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v12697; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]2698;2699; GFX8-SDAG-LABEL: test_vector_reduce_smax_v4i32:2700; GFX8-SDAG: ; %bb.0: ; %entry2701; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2702; GFX8-SDAG-NEXT: v_max_i32_e32 v1, v1, v32703; GFX8-SDAG-NEXT: v_max3_i32 v0, v0, v2, v12704; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]2705;2706; GFX8-GISEL-LABEL: test_vector_reduce_smax_v4i32:2707; GFX8-GISEL: ; %bb.0: ; %entry2708; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2709; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v22710; GFX8-GISEL-NEXT: v_max_i32_e32 v1, v1, v32711; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v12712; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]2713;2714; GFX9-SDAG-LABEL: test_vector_reduce_smax_v4i32:2715; GFX9-SDAG: ; %bb.0: ; %entry2716; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2717; GFX9-SDAG-NEXT: v_max_i32_e32 v1, v1, v32718; GFX9-SDAG-NEXT: v_max3_i32 v0, v0, v2, v12719; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]2720;2721; GFX9-GISEL-LABEL: test_vector_reduce_smax_v4i32:2722; GFX9-GISEL: ; %bb.0: ; %entry2723; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2724; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v22725; GFX9-GISEL-NEXT: v_max_i32_e32 v1, v1, v32726; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v12727; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]2728;2729; GFX10-SDAG-LABEL: test_vector_reduce_smax_v4i32:2730; GFX10-SDAG: ; %bb.0: ; %entry2731; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2732; GFX10-SDAG-NEXT: v_max_i32_e32 v1, v1, v32733; GFX10-SDAG-NEXT: v_max3_i32 v0, v0, v2, v12734; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]2735;2736; GFX10-GISEL-LABEL: test_vector_reduce_smax_v4i32:2737; GFX10-GISEL: ; %bb.0: ; %entry2738; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2739; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v22740; GFX10-GISEL-NEXT: v_max_i32_e32 v1, v1, v32741; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v12742; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]2743;2744; GFX11-SDAG-LABEL: test_vector_reduce_smax_v4i32:2745; GFX11-SDAG: ; %bb.0: ; %entry2746; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2747; GFX11-SDAG-NEXT: v_max_i32_e32 v1, v1, v32748; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)2749; GFX11-SDAG-NEXT: v_max3_i32 v0, v0, v2, v12750; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]2751;2752; GFX11-GISEL-LABEL: test_vector_reduce_smax_v4i32:2753; GFX11-GISEL: ; %bb.0: ; %entry2754; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2755; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v22756; GFX11-GISEL-NEXT: v_max_i32_e32 v1, v1, v32757; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2758; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v12759; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]2760;2761; GFX12-SDAG-LABEL: test_vector_reduce_smax_v4i32:2762; GFX12-SDAG: ; %bb.0: ; %entry2763; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x02764; GFX12-SDAG-NEXT: s_wait_expcnt 0x02765; GFX12-SDAG-NEXT: s_wait_samplecnt 0x02766; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x02767; GFX12-SDAG-NEXT: s_wait_kmcnt 0x02768; GFX12-SDAG-NEXT: v_max_i32_e32 v1, v1, v32769; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)2770; GFX12-SDAG-NEXT: v_max3_i32 v0, v0, v2, v12771; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]2772;2773; GFX12-GISEL-LABEL: test_vector_reduce_smax_v4i32:2774; GFX12-GISEL: ; %bb.0: ; %entry2775; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x02776; GFX12-GISEL-NEXT: s_wait_expcnt 0x02777; GFX12-GISEL-NEXT: s_wait_samplecnt 0x02778; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x02779; GFX12-GISEL-NEXT: s_wait_kmcnt 0x02780; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v22781; GFX12-GISEL-NEXT: v_max_i32_e32 v1, v1, v32782; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2783; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v12784; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]2785entry:2786 %res = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %v)2787 ret i32 %res2788}2789 2790define i32 @test_vector_reduce_smax_v8i32(<8 x i32> %v) {2791; GFX7-SDAG-LABEL: test_vector_reduce_smax_v8i32:2792; GFX7-SDAG: ; %bb.0: ; %entry2793; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2794; GFX7-SDAG-NEXT: v_max_i32_e32 v2, v2, v62795; GFX7-SDAG-NEXT: v_max_i32_e32 v3, v3, v72796; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32797; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22798; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v12799; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]2800;2801; GFX7-GISEL-LABEL: test_vector_reduce_smax_v8i32:2802; GFX7-GISEL: ; %bb.0: ; %entry2803; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2804; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v42805; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v52806; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v62807; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v72808; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v22809; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v32810; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v12811; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]2812;2813; GFX8-SDAG-LABEL: test_vector_reduce_smax_v8i32:2814; GFX8-SDAG: ; %bb.0: ; %entry2815; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2816; GFX8-SDAG-NEXT: v_max_i32_e32 v2, v2, v62817; GFX8-SDAG-NEXT: v_max_i32_e32 v3, v3, v72818; GFX8-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32819; GFX8-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22820; GFX8-SDAG-NEXT: v_max_i32_e32 v0, v0, v12821; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]2822;2823; GFX8-GISEL-LABEL: test_vector_reduce_smax_v8i32:2824; GFX8-GISEL: ; %bb.0: ; %entry2825; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2826; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v42827; GFX8-GISEL-NEXT: v_max_i32_e32 v1, v1, v52828; GFX8-GISEL-NEXT: v_max_i32_e32 v2, v2, v62829; GFX8-GISEL-NEXT: v_max_i32_e32 v3, v3, v72830; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v22831; GFX8-GISEL-NEXT: v_max_i32_e32 v1, v1, v32832; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v12833; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]2834;2835; GFX9-SDAG-LABEL: test_vector_reduce_smax_v8i32:2836; GFX9-SDAG: ; %bb.0: ; %entry2837; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2838; GFX9-SDAG-NEXT: v_max_i32_e32 v2, v2, v62839; GFX9-SDAG-NEXT: v_max_i32_e32 v3, v3, v72840; GFX9-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32841; GFX9-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22842; GFX9-SDAG-NEXT: v_max_i32_e32 v0, v0, v12843; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]2844;2845; GFX9-GISEL-LABEL: test_vector_reduce_smax_v8i32:2846; GFX9-GISEL: ; %bb.0: ; %entry2847; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2848; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v42849; GFX9-GISEL-NEXT: v_max_i32_e32 v1, v1, v52850; GFX9-GISEL-NEXT: v_max_i32_e32 v2, v2, v62851; GFX9-GISEL-NEXT: v_max_i32_e32 v3, v3, v72852; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v22853; GFX9-GISEL-NEXT: v_max_i32_e32 v1, v1, v32854; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v12855; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]2856;2857; GFX10-SDAG-LABEL: test_vector_reduce_smax_v8i32:2858; GFX10-SDAG: ; %bb.0: ; %entry2859; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2860; GFX10-SDAG-NEXT: v_max_i32_e32 v3, v3, v72861; GFX10-SDAG-NEXT: v_max_i32_e32 v2, v2, v62862; GFX10-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32863; GFX10-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22864; GFX10-SDAG-NEXT: v_max_i32_e32 v0, v0, v12865; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]2866;2867; GFX10-GISEL-LABEL: test_vector_reduce_smax_v8i32:2868; GFX10-GISEL: ; %bb.0: ; %entry2869; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2870; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v42871; GFX10-GISEL-NEXT: v_max_i32_e32 v1, v1, v52872; GFX10-GISEL-NEXT: v_max_i32_e32 v2, v2, v62873; GFX10-GISEL-NEXT: v_max_i32_e32 v3, v3, v72874; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v22875; GFX10-GISEL-NEXT: v_max_i32_e32 v1, v1, v32876; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v12877; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]2878;2879; GFX11-SDAG-LABEL: test_vector_reduce_smax_v8i32:2880; GFX11-SDAG: ; %bb.0: ; %entry2881; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2882; GFX11-SDAG-NEXT: v_max_i32_e32 v3, v3, v72883; GFX11-SDAG-NEXT: v_max_i32_e32 v2, v2, v62884; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2885; GFX11-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32886; GFX11-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22887; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)2888; GFX11-SDAG-NEXT: v_max_i32_e32 v0, v0, v12889; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]2890;2891; GFX11-GISEL-LABEL: test_vector_reduce_smax_v8i32:2892; GFX11-GISEL: ; %bb.0: ; %entry2893; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2894; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v42895; GFX11-GISEL-NEXT: v_max_i32_e32 v1, v1, v52896; GFX11-GISEL-NEXT: v_max_i32_e32 v2, v2, v62897; GFX11-GISEL-NEXT: v_max_i32_e32 v3, v3, v72898; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2899; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v22900; GFX11-GISEL-NEXT: v_max_i32_e32 v1, v1, v32901; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2902; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v12903; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]2904;2905; GFX12-SDAG-LABEL: test_vector_reduce_smax_v8i32:2906; GFX12-SDAG: ; %bb.0: ; %entry2907; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x02908; GFX12-SDAG-NEXT: s_wait_expcnt 0x02909; GFX12-SDAG-NEXT: s_wait_samplecnt 0x02910; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x02911; GFX12-SDAG-NEXT: s_wait_kmcnt 0x02912; GFX12-SDAG-NEXT: v_max_i32_e32 v3, v3, v72913; GFX12-SDAG-NEXT: v_max_i32_e32 v2, v2, v62914; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2915; GFX12-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32916; GFX12-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22917; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)2918; GFX12-SDAG-NEXT: v_max_i32_e32 v0, v0, v12919; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]2920;2921; GFX12-GISEL-LABEL: test_vector_reduce_smax_v8i32:2922; GFX12-GISEL: ; %bb.0: ; %entry2923; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x02924; GFX12-GISEL-NEXT: s_wait_expcnt 0x02925; GFX12-GISEL-NEXT: s_wait_samplecnt 0x02926; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x02927; GFX12-GISEL-NEXT: s_wait_kmcnt 0x02928; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v42929; GFX12-GISEL-NEXT: v_max_i32_e32 v1, v1, v52930; GFX12-GISEL-NEXT: v_max_i32_e32 v2, v2, v62931; GFX12-GISEL-NEXT: v_max_i32_e32 v3, v3, v72932; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2933; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v22934; GFX12-GISEL-NEXT: v_max_i32_e32 v1, v1, v32935; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)2936; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v12937; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]2938entry:2939 %res = call i32 @llvm.vector.reduce.smax.v8i32(<8 x i32> %v)2940 ret i32 %res2941}2942 2943define i32 @test_vector_reduce_smax_v16i32(<16 x i32> %v) {2944; GFX7-SDAG-LABEL: test_vector_reduce_smax_v16i32:2945; GFX7-SDAG: ; %bb.0: ; %entry2946; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2947; GFX7-SDAG-NEXT: v_max_i32_e32 v7, v7, v152948; GFX7-SDAG-NEXT: v_max_i32_e32 v6, v6, v142949; GFX7-SDAG-NEXT: v_max_i32_e32 v4, v4, v122950; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v82951; GFX7-SDAG-NEXT: v_max_i32_e32 v5, v5, v132952; GFX7-SDAG-NEXT: v_max_i32_e32 v1, v1, v92953; GFX7-SDAG-NEXT: v_max3_i32 v2, v2, v10, v62954; GFX7-SDAG-NEXT: v_max3_i32 v3, v3, v11, v72955; GFX7-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32956; GFX7-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22957; GFX7-SDAG-NEXT: v_max_i32_e32 v0, v0, v12958; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]2959;2960; GFX7-GISEL-LABEL: test_vector_reduce_smax_v16i32:2961; GFX7-GISEL: ; %bb.0: ; %entry2962; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2963; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v82964; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v92965; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v102966; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v112967; GFX7-GISEL-NEXT: v_max_i32_e32 v4, v4, v122968; GFX7-GISEL-NEXT: v_max_i32_e32 v5, v5, v132969; GFX7-GISEL-NEXT: v_max_i32_e32 v6, v6, v142970; GFX7-GISEL-NEXT: v_max_i32_e32 v7, v7, v152971; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v42972; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v52973; GFX7-GISEL-NEXT: v_max_i32_e32 v2, v2, v62974; GFX7-GISEL-NEXT: v_max_i32_e32 v3, v3, v72975; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v22976; GFX7-GISEL-NEXT: v_max_i32_e32 v1, v1, v32977; GFX7-GISEL-NEXT: v_max_i32_e32 v0, v0, v12978; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]2979;2980; GFX8-SDAG-LABEL: test_vector_reduce_smax_v16i32:2981; GFX8-SDAG: ; %bb.0: ; %entry2982; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2983; GFX8-SDAG-NEXT: v_max_i32_e32 v7, v7, v152984; GFX8-SDAG-NEXT: v_max_i32_e32 v6, v6, v142985; GFX8-SDAG-NEXT: v_max_i32_e32 v4, v4, v122986; GFX8-SDAG-NEXT: v_max_i32_e32 v0, v0, v82987; GFX8-SDAG-NEXT: v_max_i32_e32 v5, v5, v132988; GFX8-SDAG-NEXT: v_max_i32_e32 v1, v1, v92989; GFX8-SDAG-NEXT: v_max3_i32 v2, v2, v10, v62990; GFX8-SDAG-NEXT: v_max3_i32 v3, v3, v11, v72991; GFX8-SDAG-NEXT: v_max3_i32 v1, v1, v5, v32992; GFX8-SDAG-NEXT: v_max3_i32 v0, v0, v4, v22993; GFX8-SDAG-NEXT: v_max_i32_e32 v0, v0, v12994; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]2995;2996; GFX8-GISEL-LABEL: test_vector_reduce_smax_v16i32:2997; GFX8-GISEL: ; %bb.0: ; %entry2998; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2999; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v83000; GFX8-GISEL-NEXT: v_max_i32_e32 v1, v1, v93001; GFX8-GISEL-NEXT: v_max_i32_e32 v2, v2, v103002; GFX8-GISEL-NEXT: v_max_i32_e32 v3, v3, v113003; GFX8-GISEL-NEXT: v_max_i32_e32 v4, v4, v123004; GFX8-GISEL-NEXT: v_max_i32_e32 v5, v5, v133005; GFX8-GISEL-NEXT: v_max_i32_e32 v6, v6, v143006; GFX8-GISEL-NEXT: v_max_i32_e32 v7, v7, v153007; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v43008; GFX8-GISEL-NEXT: v_max_i32_e32 v1, v1, v53009; GFX8-GISEL-NEXT: v_max_i32_e32 v2, v2, v63010; GFX8-GISEL-NEXT: v_max_i32_e32 v3, v3, v73011; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v23012; GFX8-GISEL-NEXT: v_max_i32_e32 v1, v1, v33013; GFX8-GISEL-NEXT: v_max_i32_e32 v0, v0, v13014; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]3015;3016; GFX9-SDAG-LABEL: test_vector_reduce_smax_v16i32:3017; GFX9-SDAG: ; %bb.0: ; %entry3018; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3019; GFX9-SDAG-NEXT: v_max_i32_e32 v7, v7, v153020; GFX9-SDAG-NEXT: v_max_i32_e32 v6, v6, v143021; GFX9-SDAG-NEXT: v_max_i32_e32 v4, v4, v123022; GFX9-SDAG-NEXT: v_max_i32_e32 v0, v0, v83023; GFX9-SDAG-NEXT: v_max_i32_e32 v5, v5, v133024; GFX9-SDAG-NEXT: v_max_i32_e32 v1, v1, v93025; GFX9-SDAG-NEXT: v_max3_i32 v2, v2, v10, v63026; GFX9-SDAG-NEXT: v_max3_i32 v3, v3, v11, v73027; GFX9-SDAG-NEXT: v_max3_i32 v1, v1, v5, v33028; GFX9-SDAG-NEXT: v_max3_i32 v0, v0, v4, v23029; GFX9-SDAG-NEXT: v_max_i32_e32 v0, v0, v13030; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]3031;3032; GFX9-GISEL-LABEL: test_vector_reduce_smax_v16i32:3033; GFX9-GISEL: ; %bb.0: ; %entry3034; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3035; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v83036; GFX9-GISEL-NEXT: v_max_i32_e32 v1, v1, v93037; GFX9-GISEL-NEXT: v_max_i32_e32 v2, v2, v103038; GFX9-GISEL-NEXT: v_max_i32_e32 v3, v3, v113039; GFX9-GISEL-NEXT: v_max_i32_e32 v4, v4, v123040; GFX9-GISEL-NEXT: v_max_i32_e32 v5, v5, v133041; GFX9-GISEL-NEXT: v_max_i32_e32 v6, v6, v143042; GFX9-GISEL-NEXT: v_max_i32_e32 v7, v7, v153043; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v43044; GFX9-GISEL-NEXT: v_max_i32_e32 v1, v1, v53045; GFX9-GISEL-NEXT: v_max_i32_e32 v2, v2, v63046; GFX9-GISEL-NEXT: v_max_i32_e32 v3, v3, v73047; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v23048; GFX9-GISEL-NEXT: v_max_i32_e32 v1, v1, v33049; GFX9-GISEL-NEXT: v_max_i32_e32 v0, v0, v13050; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]3051;3052; GFX10-SDAG-LABEL: test_vector_reduce_smax_v16i32:3053; GFX10-SDAG: ; %bb.0: ; %entry3054; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3055; GFX10-SDAG-NEXT: v_max_i32_e32 v7, v7, v153056; GFX10-SDAG-NEXT: v_max_i32_e32 v6, v6, v143057; GFX10-SDAG-NEXT: v_max_i32_e32 v4, v4, v123058; GFX10-SDAG-NEXT: v_max_i32_e32 v0, v0, v83059; GFX10-SDAG-NEXT: v_max_i32_e32 v5, v5, v133060; GFX10-SDAG-NEXT: v_max_i32_e32 v1, v1, v93061; GFX10-SDAG-NEXT: v_max3_i32 v3, v3, v11, v73062; GFX10-SDAG-NEXT: v_max3_i32 v2, v2, v10, v63063; GFX10-SDAG-NEXT: v_max3_i32 v1, v1, v5, v33064; GFX10-SDAG-NEXT: v_max3_i32 v0, v0, v4, v23065; GFX10-SDAG-NEXT: v_max_i32_e32 v0, v0, v13066; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]3067;3068; GFX10-GISEL-LABEL: test_vector_reduce_smax_v16i32:3069; GFX10-GISEL: ; %bb.0: ; %entry3070; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3071; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v83072; GFX10-GISEL-NEXT: v_max_i32_e32 v1, v1, v93073; GFX10-GISEL-NEXT: v_max_i32_e32 v2, v2, v103074; GFX10-GISEL-NEXT: v_max_i32_e32 v3, v3, v113075; GFX10-GISEL-NEXT: v_max_i32_e32 v4, v4, v123076; GFX10-GISEL-NEXT: v_max_i32_e32 v5, v5, v133077; GFX10-GISEL-NEXT: v_max_i32_e32 v6, v6, v143078; GFX10-GISEL-NEXT: v_max_i32_e32 v7, v7, v153079; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v43080; GFX10-GISEL-NEXT: v_max_i32_e32 v1, v1, v53081; GFX10-GISEL-NEXT: v_max_i32_e32 v2, v2, v63082; GFX10-GISEL-NEXT: v_max_i32_e32 v3, v3, v73083; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v23084; GFX10-GISEL-NEXT: v_max_i32_e32 v1, v1, v33085; GFX10-GISEL-NEXT: v_max_i32_e32 v0, v0, v13086; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]3087;3088; GFX11-SDAG-LABEL: test_vector_reduce_smax_v16i32:3089; GFX11-SDAG: ; %bb.0: ; %entry3090; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3091; GFX11-SDAG-NEXT: v_max_i32_e32 v7, v7, v153092; GFX11-SDAG-NEXT: v_max_i32_e32 v6, v6, v143093; GFX11-SDAG-NEXT: v_max_i32_e32 v4, v4, v123094; GFX11-SDAG-NEXT: v_max_i32_e32 v0, v0, v83095; GFX11-SDAG-NEXT: v_max_i32_e32 v5, v5, v133096; GFX11-SDAG-NEXT: v_max_i32_e32 v1, v1, v93097; GFX11-SDAG-NEXT: v_max3_i32 v3, v3, v11, v73098; GFX11-SDAG-NEXT: v_max3_i32 v2, v2, v10, v63099; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)3100; GFX11-SDAG-NEXT: v_max3_i32 v1, v1, v5, v33101; GFX11-SDAG-NEXT: v_max3_i32 v0, v0, v4, v23102; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)3103; GFX11-SDAG-NEXT: v_max_i32_e32 v0, v0, v13104; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]3105;3106; GFX11-GISEL-LABEL: test_vector_reduce_smax_v16i32:3107; GFX11-GISEL: ; %bb.0: ; %entry3108; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3109; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v83110; GFX11-GISEL-NEXT: v_max_i32_e32 v1, v1, v93111; GFX11-GISEL-NEXT: v_max_i32_e32 v2, v2, v103112; GFX11-GISEL-NEXT: v_max_i32_e32 v3, v3, v113113; GFX11-GISEL-NEXT: v_max_i32_e32 v4, v4, v123114; GFX11-GISEL-NEXT: v_max_i32_e32 v5, v5, v133115; GFX11-GISEL-NEXT: v_max_i32_e32 v6, v6, v143116; GFX11-GISEL-NEXT: v_max_i32_e32 v7, v7, v153117; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)3118; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v43119; GFX11-GISEL-NEXT: v_max_i32_e32 v1, v1, v53120; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)3121; GFX11-GISEL-NEXT: v_max_i32_e32 v2, v2, v63122; GFX11-GISEL-NEXT: v_max_i32_e32 v3, v3, v73123; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)3124; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v23125; GFX11-GISEL-NEXT: v_max_i32_e32 v1, v1, v33126; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)3127; GFX11-GISEL-NEXT: v_max_i32_e32 v0, v0, v13128; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]3129;3130; GFX12-SDAG-LABEL: test_vector_reduce_smax_v16i32:3131; GFX12-SDAG: ; %bb.0: ; %entry3132; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x03133; GFX12-SDAG-NEXT: s_wait_expcnt 0x03134; GFX12-SDAG-NEXT: s_wait_samplecnt 0x03135; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x03136; GFX12-SDAG-NEXT: s_wait_kmcnt 0x03137; GFX12-SDAG-NEXT: v_max_i32_e32 v7, v7, v153138; GFX12-SDAG-NEXT: v_max_i32_e32 v6, v6, v143139; GFX12-SDAG-NEXT: v_max_i32_e32 v4, v4, v123140; GFX12-SDAG-NEXT: v_max_i32_e32 v0, v0, v83141; GFX12-SDAG-NEXT: v_max_i32_e32 v5, v5, v133142; GFX12-SDAG-NEXT: v_max_i32_e32 v1, v1, v93143; GFX12-SDAG-NEXT: v_max3_i32 v3, v3, v11, v73144; GFX12-SDAG-NEXT: v_max3_i32 v2, v2, v10, v63145; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)3146; GFX12-SDAG-NEXT: v_max3_i32 v1, v1, v5, v33147; GFX12-SDAG-NEXT: v_max3_i32 v0, v0, v4, v23148; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)3149; GFX12-SDAG-NEXT: v_max_i32_e32 v0, v0, v13150; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]3151;3152; GFX12-GISEL-LABEL: test_vector_reduce_smax_v16i32:3153; GFX12-GISEL: ; %bb.0: ; %entry3154; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x03155; GFX12-GISEL-NEXT: s_wait_expcnt 0x03156; GFX12-GISEL-NEXT: s_wait_samplecnt 0x03157; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x03158; GFX12-GISEL-NEXT: s_wait_kmcnt 0x03159; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v83160; GFX12-GISEL-NEXT: v_max_i32_e32 v1, v1, v93161; GFX12-GISEL-NEXT: v_max_i32_e32 v2, v2, v103162; GFX12-GISEL-NEXT: v_max_i32_e32 v3, v3, v113163; GFX12-GISEL-NEXT: v_max_i32_e32 v4, v4, v123164; GFX12-GISEL-NEXT: v_max_i32_e32 v5, v5, v133165; GFX12-GISEL-NEXT: v_max_i32_e32 v6, v6, v143166; GFX12-GISEL-NEXT: v_max_i32_e32 v7, v7, v153167; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)3168; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v43169; GFX12-GISEL-NEXT: v_max_i32_e32 v1, v1, v53170; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)3171; GFX12-GISEL-NEXT: v_max_i32_e32 v2, v2, v63172; GFX12-GISEL-NEXT: v_max_i32_e32 v3, v3, v73173; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)3174; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v23175; GFX12-GISEL-NEXT: v_max_i32_e32 v1, v1, v33176; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)3177; GFX12-GISEL-NEXT: v_max_i32_e32 v0, v0, v13178; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]3179entry:3180 %res = call i32 @llvm.vector.reduce.smax.v16i32(<16 x i32> %v)3181 ret i32 %res3182}3183 3184define i64 @test_vector_reduce_smax_v2i64(<2 x i64> %v) {3185; GFX7-LABEL: test_vector_reduce_smax_v2i64:3186; GFX7: ; %bb.0: ; %entry3187; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3188; GFX7-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3189; GFX7-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3190; GFX7-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3191; GFX7-NEXT: s_setpc_b64 s[30:31]3192;3193; GFX8-LABEL: test_vector_reduce_smax_v2i64:3194; GFX8: ; %bb.0: ; %entry3195; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3196; GFX8-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3197; GFX8-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3198; GFX8-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3199; GFX8-NEXT: s_setpc_b64 s[30:31]3200;3201; GFX9-LABEL: test_vector_reduce_smax_v2i64:3202; GFX9: ; %bb.0: ; %entry3203; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3204; GFX9-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3205; GFX9-NEXT: s_nop 13206; GFX9-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3207; GFX9-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3208; GFX9-NEXT: s_setpc_b64 s[30:31]3209;3210; GFX10-LABEL: test_vector_reduce_smax_v2i64:3211; GFX10: ; %bb.0: ; %entry3212; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3213; GFX10-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3214; GFX10-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3215; GFX10-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3216; GFX10-NEXT: s_setpc_b64 s[30:31]3217;3218; GFX11-LABEL: test_vector_reduce_smax_v2i64:3219; GFX11: ; %bb.0: ; %entry3220; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3221; GFX11-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3222; GFX11-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13223; GFX11-NEXT: s_setpc_b64 s[30:31]3224;3225; GFX12-LABEL: test_vector_reduce_smax_v2i64:3226; GFX12: ; %bb.0: ; %entry3227; GFX12-NEXT: s_wait_loadcnt_dscnt 0x03228; GFX12-NEXT: s_wait_expcnt 0x03229; GFX12-NEXT: s_wait_samplecnt 0x03230; GFX12-NEXT: s_wait_bvhcnt 0x03231; GFX12-NEXT: s_wait_kmcnt 0x03232; GFX12-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3233; GFX12-NEXT: s_wait_alu depctr_va_vcc(0)3234; GFX12-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13235; GFX12-NEXT: s_setpc_b64 s[30:31]3236entry:3237 %res = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %v)3238 ret i64 %res3239}3240 3241define i64 @test_vector_reduce_smax_v3i64(<3 x i64> %v) {3242; GFX7-SDAG-LABEL: test_vector_reduce_smax_v3i64:3243; GFX7-SDAG: ; %bb.0: ; %entry3244; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3245; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3246; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3247; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3248; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3249; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3250; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3251; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]3252;3253; GFX7-GISEL-LABEL: test_vector_reduce_smax_v3i64:3254; GFX7-GISEL: ; %bb.0: ; %entry3255; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3256; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3257; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3258; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3259; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3260; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3261; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3262; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]3263;3264; GFX8-SDAG-LABEL: test_vector_reduce_smax_v3i64:3265; GFX8-SDAG: ; %bb.0: ; %entry3266; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3267; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3268; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3269; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3270; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3271; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3272; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3273; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]3274;3275; GFX8-GISEL-LABEL: test_vector_reduce_smax_v3i64:3276; GFX8-GISEL: ; %bb.0: ; %entry3277; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3278; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3279; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3280; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3281; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3282; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3283; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3284; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]3285;3286; GFX9-SDAG-LABEL: test_vector_reduce_smax_v3i64:3287; GFX9-SDAG: ; %bb.0: ; %entry3288; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3289; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3290; GFX9-SDAG-NEXT: s_nop 13291; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3292; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3293; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3294; GFX9-SDAG-NEXT: s_nop 13295; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3296; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3297; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]3298;3299; GFX9-GISEL-LABEL: test_vector_reduce_smax_v3i64:3300; GFX9-GISEL: ; %bb.0: ; %entry3301; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3302; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3303; GFX9-GISEL-NEXT: s_nop 13304; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3305; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3306; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3307; GFX9-GISEL-NEXT: s_nop 13308; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3309; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3310; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]3311;3312; GFX10-SDAG-LABEL: test_vector_reduce_smax_v3i64:3313; GFX10-SDAG: ; %bb.0: ; %entry3314; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3315; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3316; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3317; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3318; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3319; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc_lo3320; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc_lo3321; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]3322;3323; GFX10-GISEL-LABEL: test_vector_reduce_smax_v3i64:3324; GFX10-GISEL: ; %bb.0: ; %entry3325; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3326; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3327; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3328; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3329; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3330; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc_lo3331; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc_lo3332; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]3333;3334; GFX11-SDAG-LABEL: test_vector_reduce_smax_v3i64:3335; GFX11-SDAG: ; %bb.0: ; %entry3336; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3337; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3338; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v1, v3, v1 :: v_dual_cndmask_b32 v0, v2, v03339; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)3340; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3341; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13342; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]3343;3344; GFX11-GISEL-LABEL: test_vector_reduce_smax_v3i64:3345; GFX11-GISEL: ; %bb.0: ; %entry3346; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3347; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3348; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13349; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)3350; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3351; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13352; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]3353;3354; GFX12-SDAG-LABEL: test_vector_reduce_smax_v3i64:3355; GFX12-SDAG: ; %bb.0: ; %entry3356; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x03357; GFX12-SDAG-NEXT: s_wait_expcnt 0x03358; GFX12-SDAG-NEXT: s_wait_samplecnt 0x03359; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x03360; GFX12-SDAG-NEXT: s_wait_kmcnt 0x03361; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3362; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3363; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v1, v3, v1 :: v_dual_cndmask_b32 v0, v2, v03364; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)3365; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3366; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3367; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13368; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]3369;3370; GFX12-GISEL-LABEL: test_vector_reduce_smax_v3i64:3371; GFX12-GISEL: ; %bb.0: ; %entry3372; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x03373; GFX12-GISEL-NEXT: s_wait_expcnt 0x03374; GFX12-GISEL-NEXT: s_wait_samplecnt 0x03375; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x03376; GFX12-GISEL-NEXT: s_wait_kmcnt 0x03377; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3378; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3379; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13380; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)3381; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3382; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3383; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13384; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]3385entry:3386 %res = call i64 @llvm.vector.reduce.smax.v3i64(<3 x i64> %v)3387 ret i64 %res3388}3389 3390define i64 @test_vector_reduce_smax_v4i64(<4 x i64> %v) {3391; GFX7-SDAG-LABEL: test_vector_reduce_smax_v4i64:3392; GFX7-SDAG: ; %bb.0: ; %entry3393; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3394; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3395; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3396; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3397; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3398; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3399; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3400; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3401; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3402; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3403; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]3404;3405; GFX7-GISEL-LABEL: test_vector_reduce_smax_v4i64:3406; GFX7-GISEL: ; %bb.0: ; %entry3407; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3408; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3409; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3410; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3411; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3412; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3413; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3414; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3415; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3416; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3417; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]3418;3419; GFX8-SDAG-LABEL: test_vector_reduce_smax_v4i64:3420; GFX8-SDAG: ; %bb.0: ; %entry3421; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3422; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3423; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3424; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3425; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3426; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3427; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3428; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3429; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3430; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3431; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]3432;3433; GFX8-GISEL-LABEL: test_vector_reduce_smax_v4i64:3434; GFX8-GISEL: ; %bb.0: ; %entry3435; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3436; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3437; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3438; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3439; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3440; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3441; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3442; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3443; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3444; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3445; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]3446;3447; GFX9-SDAG-LABEL: test_vector_reduce_smax_v4i64:3448; GFX9-SDAG: ; %bb.0: ; %entry3449; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3450; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3451; GFX9-SDAG-NEXT: s_nop 13452; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3453; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3454; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3455; GFX9-SDAG-NEXT: s_nop 13456; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3457; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3458; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3459; GFX9-SDAG-NEXT: s_nop 13460; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3461; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3462; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]3463;3464; GFX9-GISEL-LABEL: test_vector_reduce_smax_v4i64:3465; GFX9-GISEL: ; %bb.0: ; %entry3466; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3467; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3468; GFX9-GISEL-NEXT: s_nop 13469; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3470; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3471; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3472; GFX9-GISEL-NEXT: s_nop 13473; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3474; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3475; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3476; GFX9-GISEL-NEXT: s_nop 13477; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3478; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3479; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]3480;3481; GFX10-SDAG-LABEL: test_vector_reduce_smax_v4i64:3482; GFX10-SDAG: ; %bb.0: ; %entry3483; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3484; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[6:7]3485; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[0:1], v[4:5]3486; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc_lo3487; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc_lo3488; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, v5, v1, s43489; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v0, v4, v0, s43490; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3491; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3492; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3493; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]3494;3495; GFX10-GISEL-LABEL: test_vector_reduce_smax_v4i64:3496; GFX10-GISEL: ; %bb.0: ; %entry3497; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3498; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3499; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[6:7]3500; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc_lo3501; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc_lo3502; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s43503; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s43504; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3505; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3506; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3507; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]3508;3509; GFX11-SDAG-LABEL: test_vector_reduce_smax_v4i64:3510; GFX11-SDAG: ; %bb.0: ; %entry3511; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3512; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[6:7]3513; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[0:1], v[4:5]3514; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v3, v7, v3 :: v_dual_cndmask_b32 v2, v6, v23515; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)3516; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, v5, v1, s03517; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v0, v4, v0, s03518; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3519; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13520; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]3521;3522; GFX11-GISEL-LABEL: test_vector_reduce_smax_v4i64:3523; GFX11-GISEL: ; %bb.0: ; %entry3524; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3525; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3526; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]3527; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13528; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)3529; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s03530; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s03531; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3532; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13533; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]3534;3535; GFX12-SDAG-LABEL: test_vector_reduce_smax_v4i64:3536; GFX12-SDAG: ; %bb.0: ; %entry3537; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x03538; GFX12-SDAG-NEXT: s_wait_expcnt 0x03539; GFX12-SDAG-NEXT: s_wait_samplecnt 0x03540; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x03541; GFX12-SDAG-NEXT: s_wait_kmcnt 0x03542; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[6:7]3543; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[0:1], v[4:5]3544; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3545; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v3, v7, v3 :: v_dual_cndmask_b32 v2, v6, v23546; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)3547; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)3548; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v1, v5, v1, s03549; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v0, v4, v0, s03550; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3551; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3552; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13553; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]3554;3555; GFX12-GISEL-LABEL: test_vector_reduce_smax_v4i64:3556; GFX12-GISEL: ; %bb.0: ; %entry3557; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x03558; GFX12-GISEL-NEXT: s_wait_expcnt 0x03559; GFX12-GISEL-NEXT: s_wait_samplecnt 0x03560; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x03561; GFX12-GISEL-NEXT: s_wait_kmcnt 0x03562; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3563; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]3564; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3565; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13566; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)3567; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)3568; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s03569; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s03570; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3571; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3572; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13573; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]3574entry:3575 %res = call i64 @llvm.vector.reduce.smax.v4i64(<4 x i64> %v)3576 ret i64 %res3577}3578 3579define i64 @test_vector_reduce_smax_v8i64(<8 x i64> %v) {3580; GFX7-SDAG-LABEL: test_vector_reduce_smax_v8i64:3581; GFX7-SDAG: ; %bb.0: ; %entry3582; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3583; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[12:13]3584; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc3585; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc3586; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]3587; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc3588; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc3589; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[14:15]3590; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc3591; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc3592; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3593; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3594; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3595; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3596; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3597; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3598; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3599; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3600; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3601; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3602; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3603; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3604; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]3605;3606; GFX7-GISEL-LABEL: test_vector_reduce_smax_v8i64:3607; GFX7-GISEL: ; %bb.0: ; %entry3608; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3609; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]3610; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc3611; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc3612; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3613; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3614; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3615; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[12:13]3616; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc3617; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc3618; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[14:15]3619; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc3620; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc3621; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3622; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3623; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3624; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3625; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3626; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3627; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3628; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3629; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3630; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]3631;3632; GFX8-SDAG-LABEL: test_vector_reduce_smax_v8i64:3633; GFX8-SDAG: ; %bb.0: ; %entry3634; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3635; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[12:13]3636; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc3637; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc3638; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]3639; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc3640; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc3641; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[14:15]3642; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc3643; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc3644; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3645; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3646; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3647; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3648; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3649; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3650; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3651; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3652; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3653; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3654; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3655; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3656; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]3657;3658; GFX8-GISEL-LABEL: test_vector_reduce_smax_v8i64:3659; GFX8-GISEL: ; %bb.0: ; %entry3660; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3661; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]3662; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc3663; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc3664; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3665; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3666; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3667; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[12:13]3668; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc3669; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc3670; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[14:15]3671; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc3672; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc3673; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3674; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3675; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3676; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3677; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3678; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3679; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3680; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3681; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3682; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]3683;3684; GFX9-SDAG-LABEL: test_vector_reduce_smax_v8i64:3685; GFX9-SDAG: ; %bb.0: ; %entry3686; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3687; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[12:13]3688; GFX9-SDAG-NEXT: s_nop 13689; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc3690; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc3691; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]3692; GFX9-SDAG-NEXT: s_nop 13693; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc3694; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc3695; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[14:15]3696; GFX9-SDAG-NEXT: s_nop 13697; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc3698; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc3699; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3700; GFX9-SDAG-NEXT: s_nop 13701; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3702; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3703; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3704; GFX9-SDAG-NEXT: s_nop 13705; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3706; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3707; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3708; GFX9-SDAG-NEXT: s_nop 13709; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3710; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3711; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3712; GFX9-SDAG-NEXT: s_nop 13713; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3714; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3715; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]3716;3717; GFX9-GISEL-LABEL: test_vector_reduce_smax_v8i64:3718; GFX9-GISEL: ; %bb.0: ; %entry3719; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3720; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]3721; GFX9-GISEL-NEXT: s_nop 13722; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc3723; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc3724; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3725; GFX9-GISEL-NEXT: s_nop 13726; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3727; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3728; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[12:13]3729; GFX9-GISEL-NEXT: s_nop 13730; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc3731; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc3732; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[14:15]3733; GFX9-GISEL-NEXT: s_nop 13734; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc3735; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc3736; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3737; GFX9-GISEL-NEXT: s_nop 13738; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3739; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3740; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]3741; GFX9-GISEL-NEXT: s_nop 13742; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc3743; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc3744; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3745; GFX9-GISEL-NEXT: s_nop 13746; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3747; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3748; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]3749;3750; GFX10-SDAG-LABEL: test_vector_reduce_smax_v8i64:3751; GFX10-SDAG: ; %bb.0: ; %entry3752; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3753; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[4:5], v[12:13]3754; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[6:7], v[14:15]3755; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s5, v[2:3], v[10:11]3756; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc_lo3757; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc_lo3758; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]3759; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v7, v15, v7, s43760; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v6, v14, v6, s43761; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v3, v11, v3, s53762; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, v10, v2, s53763; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc_lo3764; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc_lo3765; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[6:7]3766; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[0:1], v[4:5]3767; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc_lo3768; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc_lo3769; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, v5, v1, s43770; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v0, v4, v0, s43771; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3772; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3773; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3774; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]3775;3776; GFX10-GISEL-LABEL: test_vector_reduce_smax_v8i64:3777; GFX10-GISEL: ; %bb.0: ; %entry3778; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3779; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]3780; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[10:11]3781; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s5, v[4:5], v[12:13]3782; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc_lo3783; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc_lo3784; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[14:15]3785; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s43786; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s43787; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s53788; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s53789; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc_lo3790; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc_lo3791; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3792; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[6:7]3793; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc_lo3794; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc_lo3795; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s43796; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s43797; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3798; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo3799; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo3800; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]3801;3802; GFX11-SDAG-LABEL: test_vector_reduce_smax_v8i64:3803; GFX11-SDAG: ; %bb.0: ; %entry3804; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3805; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[4:5], v[12:13]3806; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[6:7], v[14:15]3807; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[2:3], v[10:11]3808; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v5, v13, v5 :: v_dual_cndmask_b32 v4, v12, v43809; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]3810; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_4) | instid1(VALU_DEP_2)3811; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v7, v15, v7, s03812; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v6, v14, v6, s03813; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v3, v11, v3, s13814; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, v10, v2, s13815; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v1, v9, v1 :: v_dual_cndmask_b32 v0, v8, v03816; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[6:7]3817; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)3818; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[0:1], v[4:5]3819; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v3, v7, v3 :: v_dual_cndmask_b32 v2, v6, v23820; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, v5, v1, s03821; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v0, v4, v0, s03822; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)3823; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3824; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13825; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]3826;3827; GFX11-GISEL-LABEL: test_vector_reduce_smax_v8i64:3828; GFX11-GISEL: ; %bb.0: ; %entry3829; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3830; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]3831; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[10:11]3832; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[12:13]3833; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v8, v0 :: v_dual_cndmask_b32 v1, v9, v13834; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[14:15]3835; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_4) | instid1(VALU_DEP_2)3836; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s03837; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s03838; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s13839; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s13840; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v6, v14, v6 :: v_dual_cndmask_b32 v7, v15, v73841; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3842; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)3843; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]3844; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13845; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s03846; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s03847; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)3848; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3849; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13850; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]3851;3852; GFX12-SDAG-LABEL: test_vector_reduce_smax_v8i64:3853; GFX12-SDAG: ; %bb.0: ; %entry3854; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x03855; GFX12-SDAG-NEXT: s_wait_expcnt 0x03856; GFX12-SDAG-NEXT: s_wait_samplecnt 0x03857; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x03858; GFX12-SDAG-NEXT: s_wait_kmcnt 0x03859; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[4:5], v[12:13]3860; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[6:7], v[14:15]3861; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[2:3], v[10:11]3862; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3863; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v5, v13, v5 :: v_dual_cndmask_b32 v4, v12, v43864; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]3865; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)3866; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v7, v15, v7, s03867; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v6, v14, v6, s03868; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v3, v11, v3, s13869; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v2, v10, v2, s13870; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3871; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v1, v9, v1 :: v_dual_cndmask_b32 v0, v8, v03872; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)3873; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[6:7]3874; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[0:1], v[4:5]3875; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3876; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v3, v7, v3 :: v_dual_cndmask_b32 v2, v6, v23877; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)3878; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)3879; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v1, v5, v1, s03880; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v0, v4, v0, s03881; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3882; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)3883; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13884; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]3885;3886; GFX12-GISEL-LABEL: test_vector_reduce_smax_v8i64:3887; GFX12-GISEL: ; %bb.0: ; %entry3888; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x03889; GFX12-GISEL-NEXT: s_wait_expcnt 0x03890; GFX12-GISEL-NEXT: s_wait_samplecnt 0x03891; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x03892; GFX12-GISEL-NEXT: s_wait_kmcnt 0x03893; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]3894; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[10:11]3895; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[12:13]3896; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3897; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v8, v0 :: v_dual_cndmask_b32 v1, v9, v13898; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[14:15]3899; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)3900; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s03901; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s03902; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s13903; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s13904; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3905; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v6, v14, v6 :: v_dual_cndmask_b32 v7, v15, v73906; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)3907; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]3908; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]3909; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3910; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v13911; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)3912; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)3913; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s03914; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s03915; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]3916; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)3917; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v13918; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]3919entry:3920 %res = call i64 @llvm.vector.reduce.smax.v8i64(<8 x i64> %v)3921 ret i64 %res3922}3923 3924define i64 @test_vector_reduce_smax_v16i64(<16 x i64> %v) {3925; GFX7-SDAG-LABEL: test_vector_reduce_smax_v16i64:3926; GFX7-SDAG: ; %bb.0: ; %entry3927; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3928; GFX7-SDAG-NEXT: buffer_load_dword v31, off, s[0:3], s323929; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[8:9], v[24:25]3930; GFX7-SDAG-NEXT: v_cmp_gt_i64_e64 s[4:5], v[10:11], v[26:27]3931; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v9, v25, v9, vcc3932; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v8, v24, v8, vcc3933; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[16:17]3934; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v11, v27, v11, s[4:5]3935; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v17, v1, vcc3936; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v16, v0, vcc3937; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[12:13], v[28:29]3938; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v10, v26, v10, s[4:5]3939; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v13, v29, v13, vcc3940; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v12, v28, v12, vcc3941; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[20:21]3942; GFX7-SDAG-NEXT: v_cmp_gt_i64_e64 s[6:7], v[0:1], v[8:9]3943; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v5, v21, v5, vcc3944; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v4, v20, v4, vcc3945; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[22:23]3946; GFX7-SDAG-NEXT: v_cmp_gt_i64_e64 s[4:5], v[4:5], v[12:13]3947; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v7, v23, v7, vcc3948; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v6, v22, v6, vcc3949; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[18:19]3950; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v5, v13, v5, s[4:5]3951; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v3, v19, v3, vcc3952; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v18, v2, vcc3953; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]3954; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, v9, v1, s[6:7]3955; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v4, v12, v4, s[4:5]3956; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v0, v8, v0, s[6:7]3957; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc3958; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc3959; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]3960; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc3961; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc3962; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0)3963; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[14:15], v[30:31]3964; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v5, v31, v15, vcc3965; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v4, v30, v14, vcc3966; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[4:5]3967; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc3968; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v4, v4, v6, vcc3969; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[4:5]3970; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v2, vcc3971; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v3, v5, v3, vcc3972; GFX7-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]3973; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc3974; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc3975; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]3976;3977; GFX7-GISEL-LABEL: test_vector_reduce_smax_v16i64:3978; GFX7-GISEL: ; %bb.0: ; %entry3979; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3980; GFX7-GISEL-NEXT: buffer_load_dword v31, off, s[0:3], s323981; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[16:17]3982; GFX7-GISEL-NEXT: v_cmp_gt_i64_e64 s[4:5], v[10:11], v[26:27]3983; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v16, v0, vcc3984; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v17, v1, vcc3985; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[18:19]3986; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v10, v26, v10, s[4:5]3987; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v18, v2, vcc3988; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v3, v19, v3, vcc3989; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[20:21]3990; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v11, v27, v11, s[4:5]3991; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v4, v20, v4, vcc3992; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v5, v21, v5, vcc3993; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[22:23]3994; GFX7-GISEL-NEXT: v_cmp_gt_i64_e64 s[4:5], v[2:3], v[10:11]3995; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v6, v22, v6, vcc3996; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v7, v23, v7, vcc3997; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[8:9], v[24:25]3998; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s[4:5]3999; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v8, v24, v8, vcc4000; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v9, v25, v9, vcc4001; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[12:13], v[28:29]4002; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s[4:5]4003; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v12, v28, v12, vcc4004; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v13, v29, v13, vcc4005; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]4006; GFX7-GISEL-NEXT: v_cmp_gt_i64_e64 s[6:7], v[4:5], v[12:13]4007; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc4008; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s[6:7]4009; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc4010; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s[6:7]4011; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]4012; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc4013; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc4014; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0)4015; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[14:15], v[30:31]4016; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v4, v30, v14, vcc4017; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v5, v31, v15, vcc4018; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[4:5]4019; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v4, v4, v6, vcc4020; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc4021; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[4:5]4022; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v4, v2, vcc4023; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v3, v5, v3, vcc4024; GFX7-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]4025; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc4026; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc4027; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]4028;4029; GFX8-SDAG-LABEL: test_vector_reduce_smax_v16i64:4030; GFX8-SDAG: ; %bb.0: ; %entry4031; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4032; GFX8-SDAG-NEXT: buffer_load_dword v31, off, s[0:3], s324033; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[8:9], v[24:25]4034; GFX8-SDAG-NEXT: v_cmp_gt_i64_e64 s[4:5], v[10:11], v[26:27]4035; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v9, v25, v9, vcc4036; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v8, v24, v8, vcc4037; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[16:17]4038; GFX8-SDAG-NEXT: v_cndmask_b32_e64 v11, v27, v11, s[4:5]4039; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v17, v1, vcc4040; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v16, v0, vcc4041; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[12:13], v[28:29]4042; GFX8-SDAG-NEXT: v_cndmask_b32_e64 v10, v26, v10, s[4:5]4043; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v13, v29, v13, vcc4044; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v12, v28, v12, vcc4045; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[20:21]4046; GFX8-SDAG-NEXT: v_cmp_gt_i64_e64 s[6:7], v[0:1], v[8:9]4047; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v5, v21, v5, vcc4048; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v4, v20, v4, vcc4049; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[22:23]4050; GFX8-SDAG-NEXT: v_cmp_gt_i64_e64 s[4:5], v[4:5], v[12:13]4051; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v7, v23, v7, vcc4052; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v6, v22, v6, vcc4053; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[18:19]4054; GFX8-SDAG-NEXT: v_cndmask_b32_e64 v5, v13, v5, s[4:5]4055; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v3, v19, v3, vcc4056; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v2, v18, v2, vcc4057; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[10:11]4058; GFX8-SDAG-NEXT: v_cndmask_b32_e64 v1, v9, v1, s[6:7]4059; GFX8-SDAG-NEXT: v_cndmask_b32_e64 v4, v12, v4, s[4:5]4060; GFX8-SDAG-NEXT: v_cndmask_b32_e64 v0, v8, v0, s[6:7]4061; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v3, v11, v3, vcc4062; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v2, v10, v2, vcc4063; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]4064; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc4065; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc4066; GFX8-SDAG-NEXT: s_waitcnt vmcnt(0)4067; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[14:15], v[30:31]4068; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v5, v31, v15, vcc4069; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v4, v30, v14, vcc4070; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[4:5]4071; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc4072; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v4, v4, v6, vcc4073; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[4:5]4074; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v2, vcc4075; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v3, v5, v3, vcc4076; GFX8-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]4077; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc4078; GFX8-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc4079; GFX8-SDAG-NEXT: s_setpc_b64 s[30:31]4080;4081; GFX8-GISEL-LABEL: test_vector_reduce_smax_v16i64:4082; GFX8-GISEL: ; %bb.0: ; %entry4083; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4084; GFX8-GISEL-NEXT: buffer_load_dword v31, off, s[0:3], s324085; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[16:17]4086; GFX8-GISEL-NEXT: v_cmp_gt_i64_e64 s[4:5], v[10:11], v[26:27]4087; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v16, v0, vcc4088; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v17, v1, vcc4089; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[18:19]4090; GFX8-GISEL-NEXT: v_cndmask_b32_e64 v10, v26, v10, s[4:5]4091; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v2, v18, v2, vcc4092; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v3, v19, v3, vcc4093; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[20:21]4094; GFX8-GISEL-NEXT: v_cndmask_b32_e64 v11, v27, v11, s[4:5]4095; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v4, v20, v4, vcc4096; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v5, v21, v5, vcc4097; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[22:23]4098; GFX8-GISEL-NEXT: v_cmp_gt_i64_e64 s[4:5], v[2:3], v[10:11]4099; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v6, v22, v6, vcc4100; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v7, v23, v7, vcc4101; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[8:9], v[24:25]4102; GFX8-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s[4:5]4103; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v8, v24, v8, vcc4104; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v9, v25, v9, vcc4105; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[12:13], v[28:29]4106; GFX8-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s[4:5]4107; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v12, v28, v12, vcc4108; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v13, v29, v13, vcc4109; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]4110; GFX8-GISEL-NEXT: v_cmp_gt_i64_e64 s[6:7], v[4:5], v[12:13]4111; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc4112; GFX8-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s[6:7]4113; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc4114; GFX8-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s[6:7]4115; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]4116; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc4117; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc4118; GFX8-GISEL-NEXT: s_waitcnt vmcnt(0)4119; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[14:15], v[30:31]4120; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v4, v30, v14, vcc4121; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v5, v31, v15, vcc4122; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[4:5]4123; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v4, v4, v6, vcc4124; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc4125; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[4:5]4126; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v2, v4, v2, vcc4127; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v3, v5, v3, vcc4128; GFX8-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]4129; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc4130; GFX8-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc4131; GFX8-GISEL-NEXT: s_setpc_b64 s[30:31]4132;4133; GFX9-SDAG-LABEL: test_vector_reduce_smax_v16i64:4134; GFX9-SDAG: ; %bb.0: ; %entry4135; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4136; GFX9-SDAG-NEXT: scratch_load_dword v31, off, s324137; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[8:9], v[24:25]4138; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[0:1], v[0:1], v[16:17]4139; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[2:3], v[12:13], v[28:29]4140; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[4:5], v[4:5], v[20:21]4141; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[6:7], v[6:7], v[22:23]4142; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[8:9], v[10:11], v[26:27]4143; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[10:11], v[2:3], v[18:19]4144; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v9, v25, v9, vcc4145; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, v17, v1, s[0:1]4146; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v13, v29, v13, s[2:3]4147; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v17, v21, v5, s[4:5]4148; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v5, v23, v7, s[6:7]4149; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v7, v27, v11, s[8:9]4150; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, v19, v3, s[10:11]4151; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v8, v24, v8, vcc4152; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v0, v16, v0, s[0:1]4153; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v12, v28, v12, s[2:3]4154; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v16, v20, v4, s[4:5]4155; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v4, v22, v6, s[6:7]4156; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v6, v26, v10, s[8:9]4157; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, v18, v2, s[10:11]4158; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[6:7]4159; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[0:1], v[16:17], v[12:13]4160; GFX9-SDAG-NEXT: v_cmp_gt_i64_e64 s[2:3], v[0:1], v[8:9]4161; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v3, v7, v3, vcc4162; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v7, v13, v17, s[0:1]4163; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, v9, v1, s[2:3]4164; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc4165; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v6, v12, v16, s[0:1]4166; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v0, v8, v0, s[2:3]4167; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[6:7]4168; GFX9-SDAG-NEXT: s_nop 14169; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v7, v1, vcc4170; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v6, v0, vcc4171; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0)4172; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[14:15], v[30:31]4173; GFX9-SDAG-NEXT: s_nop 14174; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v7, v31, v15, vcc4175; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v6, v30, v14, vcc4176; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[4:5], v[6:7]4177; GFX9-SDAG-NEXT: s_nop 14178; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v5, v7, v5, vcc4179; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v4, v6, v4, vcc4180; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[4:5]4181; GFX9-SDAG-NEXT: s_nop 14182; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v2, vcc4183; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v3, v5, v3, vcc4184; GFX9-SDAG-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]4185; GFX9-SDAG-NEXT: s_nop 14186; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc4187; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc4188; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]4189;4190; GFX9-GISEL-LABEL: test_vector_reduce_smax_v16i64:4191; GFX9-GISEL: ; %bb.0: ; %entry4192; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4193; GFX9-GISEL-NEXT: scratch_load_dword v31, off, s324194; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[16:17]4195; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[2:3], v[4:5], v[20:21]4196; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[6:7], v[8:9], v[24:25]4197; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[10:11], v[12:13], v[28:29]4198; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v16, v0, vcc4199; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v4, v20, v4, s[2:3]4200; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v8, v24, v8, s[6:7]4201; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v12, v28, v12, s[10:11]4202; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v17, v1, vcc4203; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v5, v21, v5, s[2:3]4204; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v9, v25, v9, s[6:7]4205; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v13, v29, v13, s[10:11]4206; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[8:9]4207; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[2:3], v[4:5], v[12:13]4208; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[0:1], v[2:3], v[18:19]4209; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc4210; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s[2:3]4211; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc4212; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s[2:3]4213; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[4:5]4214; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[4:5], v[6:7], v[22:23]4215; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[8:9], v[10:11], v[26:27]4216; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc4217; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc4218; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, v18, v2, s[0:1]4219; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v6, v22, v6, s[4:5]4220; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v10, v26, v10, s[8:9]4221; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, v19, v3, s[0:1]4222; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v7, v23, v7, s[4:5]4223; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v11, v27, v11, s[8:9]4224; GFX9-GISEL-NEXT: v_cmp_gt_i64_e64 s[0:1], v[2:3], v[10:11]4225; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0)4226; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[14:15], v[30:31]4227; GFX9-GISEL-NEXT: s_nop 14228; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v4, v30, v14, vcc4229; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v5, v31, v15, vcc4230; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[6:7], v[4:5]4231; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s[0:1]4232; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s[0:1]4233; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v4, v4, v6, vcc4234; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc4235; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[2:3], v[4:5]4236; GFX9-GISEL-NEXT: s_nop 14237; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, v4, v2, vcc4238; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v3, v5, v3, vcc4239; GFX9-GISEL-NEXT: v_cmp_gt_i64_e32 vcc, v[0:1], v[2:3]4240; GFX9-GISEL-NEXT: s_nop 14241; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc4242; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc4243; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]4244;4245; GFX10-SDAG-LABEL: test_vector_reduce_smax_v16i64:4246; GFX10-SDAG: ; %bb.0: ; %entry4247; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4248; GFX10-SDAG-NEXT: buffer_load_dword v31, off, s[0:3], s324249; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[8:9], v[24:25]4250; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[0:1], v[16:17]4251; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s5, v[12:13], v[28:29]4252; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s6, v[6:7], v[22:23]4253; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v9, v25, v9, vcc_lo4254; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v8, v24, v8, vcc_lo4255; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, v17, v1, s44256; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v0, v16, v0, s44257; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[10:11], v[26:27]4258; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[18:19]4259; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v13, v29, v13, s54260; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v12, v28, v12, s54261; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s5, v[4:5], v[20:21]4262; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v7, v23, v7, s64263; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v11, v27, v11, vcc_lo4264; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v10, v26, v10, vcc_lo4265; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v3, v19, v3, s44266; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, v18, v2, s44267; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v5, v21, v5, s54268; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v4, v20, v4, s54269; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v6, v22, v6, s64270; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s5, v[0:1], v[8:9]4271; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[10:11]4272; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, v9, v1, s54273; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v3, v11, v3, s44274; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, v10, v2, s44275; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v0, v8, v0, s54276; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0)4277; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[14:15], v[30:31]4278; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v15, v31, v15, vcc_lo4279; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v14, v30, v14, vcc_lo4280; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[4:5], v[12:13]4281; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[6:7], v[14:15]4282; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v5, v13, v5, vcc_lo4283; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v4, v12, v4, vcc_lo4284; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v7, v15, v7, s44285; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v6, v14, v6, s44286; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]4287; GFX10-SDAG-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[6:7]4288; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc_lo4289; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc_lo4290; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, v6, v2, s44291; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v3, v7, v3, s44292; GFX10-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]4293; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo4294; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo4295; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]4296;4297; GFX10-GISEL-LABEL: test_vector_reduce_smax_v16i64:4298; GFX10-GISEL: ; %bb.0: ; %entry4299; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4300; GFX10-GISEL-NEXT: buffer_load_dword v31, off, s[0:3], s324301; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[16:17]4302; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[18:19]4303; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s5, v[4:5], v[20:21]4304; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v16, v0, vcc_lo4305; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v17, v1, vcc_lo4306; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[22:23]4307; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v18, v2, s44308; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v3, v19, v3, s44309; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[8:9], v[24:25]4310; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, v20, v4, s54311; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v5, v21, v5, s54312; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v6, v22, v6, vcc_lo4313; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v7, v23, v7, vcc_lo4314; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[10:11], v[26:27]4315; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v8, v24, v8, s44316; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s5, v[12:13], v[28:29]4317; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v9, v25, v9, s44318; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v10, v26, v10, vcc_lo4319; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v11, v27, v11, vcc_lo4320; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]4321; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v12, v28, v12, s54322; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v13, v29, v13, s54323; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc_lo4324; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s5, v[4:5], v[12:13]4325; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc_lo4326; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s54327; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s54328; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0)4329; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[14:15], v[30:31]4330; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v14, v30, v14, s44331; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v15, v31, v15, s44332; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[10:11]4333; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[14:15]4334; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s44335; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s44336; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v6, v14, v6, vcc_lo4337; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v7, v15, v7, vcc_lo4338; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]4339; GFX10-GISEL-NEXT: v_cmp_gt_i64_e64 s4, v[2:3], v[6:7]4340; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v4, v0, vcc_lo4341; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc_lo4342; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s44343; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s44344; GFX10-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]4345; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc_lo4346; GFX10-GISEL-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc_lo4347; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]4348;4349; GFX11-SDAG-LABEL: test_vector_reduce_smax_v16i64:4350; GFX11-SDAG: ; %bb.0: ; %entry4351; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4352; GFX11-SDAG-NEXT: scratch_load_b32 v31, off, s324353; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[8:9], v[24:25]4354; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[0:1], v[16:17]4355; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[12:13], v[28:29]4356; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s2, v[6:7], v[22:23]4357; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v9, v25, v9 :: v_dual_cndmask_b32 v8, v24, v84358; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4)4359; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, v17, v1, s04360; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v0, v16, v0, s04361; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[10:11], v[26:27]4362; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[18:19]4363; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v13, v29, v13, s14364; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v12, v28, v12, s14365; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[20:21]4366; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v7, v23, v7, s24367; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v11, v27, v11 :: v_dual_cndmask_b32 v10, v26, v104368; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v3, v19, v3, s04369; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, v18, v2, s04370; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v5, v21, v5, s14371; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v4, v20, v4, s14372; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v6, v22, v6, s24373; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[0:1], v[8:9]4374; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[10:11]4375; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)4376; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, v9, v1, s14377; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v3, v11, v3, s04378; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, v10, v2, s04379; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v0, v8, v0, s14380; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0)4381; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[14:15], v[30:31]4382; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v15, v31, v15 :: v_dual_cndmask_b32 v14, v30, v144383; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[4:5], v[12:13]4384; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)4385; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[6:7], v[14:15]4386; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v5, v13, v5 :: v_dual_cndmask_b32 v4, v12, v44387; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v7, v15, v7, s04388; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v6, v14, v6, s04389; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)4390; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]4391; GFX11-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]4392; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v1, v5, v1 :: v_dual_cndmask_b32 v0, v4, v04393; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)4394; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, v6, v2, s04395; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v3, v7, v3, s04396; GFX11-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]4397; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v14398; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]4399;4400; GFX11-GISEL-LABEL: test_vector_reduce_smax_v16i64:4401; GFX11-GISEL: ; %bb.0: ; %entry4402; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)4403; GFX11-GISEL-NEXT: scratch_load_b32 v31, off, s324404; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[16:17]4405; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[18:19]4406; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[20:21]4407; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v16, v0 :: v_dual_cndmask_b32 v1, v17, v14408; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[22:23]4409; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4)4410; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v18, v2, s04411; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v3, v19, v3, s04412; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[8:9], v[24:25]4413; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, v20, v4, s14414; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v5, v21, v5, s14415; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v6, v22, v6 :: v_dual_cndmask_b32 v7, v23, v74416; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[10:11], v[26:27]4417; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v8, v24, v8, s04418; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[12:13], v[28:29]4419; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v9, v25, v9, s04420; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v10, v26, v10 :: v_dual_cndmask_b32 v11, v27, v114421; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)4422; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]4423; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v12, v28, v12, s14424; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v13, v29, v13, s14425; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v8, v0 :: v_dual_cndmask_b32 v1, v9, v14426; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)4427; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[12:13]4428; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s14429; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s14430; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0)4431; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[14:15], v[30:31]4432; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)4433; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v14, v30, v14, s04434; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v15, v31, v15, s04435; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[10:11]4436; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[14:15]4437; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_2)4438; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s04439; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s04440; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v6, v14, v6 :: v_dual_cndmask_b32 v7, v15, v74441; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]4442; GFX11-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]4443; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v14444; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)4445; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s04446; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s04447; GFX11-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]4448; GFX11-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v14449; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]4450;4451; GFX12-SDAG-LABEL: test_vector_reduce_smax_v16i64:4452; GFX12-SDAG: ; %bb.0: ; %entry4453; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x04454; GFX12-SDAG-NEXT: s_wait_expcnt 0x04455; GFX12-SDAG-NEXT: s_wait_samplecnt 0x04456; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x04457; GFX12-SDAG-NEXT: s_wait_kmcnt 0x04458; GFX12-SDAG-NEXT: scratch_load_b32 v31, off, s324459; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[8:9], v[24:25]4460; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[0:1], v[16:17]4461; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[12:13], v[28:29]4462; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s2, v[6:7], v[22:23]4463; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)4464; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v9, v25, v9 :: v_dual_cndmask_b32 v8, v24, v84465; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)4466; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v1, v17, v1, s04467; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v0, v16, v0, s04468; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[10:11], v[26:27]4469; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[18:19]4470; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v13, v29, v13, s14471; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v12, v28, v12, s14472; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[20:21]4473; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v7, v23, v7, s24474; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)4475; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v11, v27, v11 :: v_dual_cndmask_b32 v10, v26, v104476; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)4477; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v3, v19, v3, s04478; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v2, v18, v2, s04479; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v5, v21, v5, s14480; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v4, v20, v4, s14481; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v6, v22, v6, s24482; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s1, v[0:1], v[8:9]4483; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[10:11]4484; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)4485; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)4486; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v1, v9, v1, s14487; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v3, v11, v3, s04488; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v2, v10, v2, s04489; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v0, v8, v0, s14490; GFX12-SDAG-NEXT: s_wait_loadcnt 0x04491; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[14:15], v[30:31]4492; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)4493; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v15, v31, v15 :: v_dual_cndmask_b32 v14, v30, v144494; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[4:5], v[12:13]4495; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_2)4496; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[6:7], v[14:15]4497; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)4498; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v5, v13, v5 :: v_dual_cndmask_b32 v4, v12, v44499; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)4500; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v7, v15, v7, s04501; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v6, v14, v6, s04502; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)4503; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]4504; GFX12-SDAG-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]4505; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)4506; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v1, v5, v1 :: v_dual_cndmask_b32 v0, v4, v04507; GFX12-SDAG-NEXT: s_wait_alu depctr_va_sdst(0)4508; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)4509; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v2, v6, v2, s04510; GFX12-SDAG-NEXT: v_cndmask_b32_e64 v3, v7, v3, s04511; GFX12-SDAG-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]4512; GFX12-SDAG-NEXT: s_wait_alu depctr_va_vcc(0)4513; GFX12-SDAG-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v14514; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]4515;4516; GFX12-GISEL-LABEL: test_vector_reduce_smax_v16i64:4517; GFX12-GISEL: ; %bb.0: ; %entry4518; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x04519; GFX12-GISEL-NEXT: s_wait_expcnt 0x04520; GFX12-GISEL-NEXT: s_wait_samplecnt 0x04521; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x04522; GFX12-GISEL-NEXT: s_wait_kmcnt 0x04523; GFX12-GISEL-NEXT: scratch_load_b32 v31, off, s324524; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[16:17]4525; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[18:19]4526; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[20:21]4527; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4528; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v16, v0 :: v_dual_cndmask_b32 v1, v17, v14529; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[22:23]4530; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4531; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v2, v18, v2, s04532; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v3, v19, v3, s04533; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[8:9], v[24:25]4534; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v4, v20, v4, s14535; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v5, v21, v5, s14536; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4537; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v6, v22, v6 :: v_dual_cndmask_b32 v7, v23, v74538; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[10:11], v[26:27]4539; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4540; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v8, v24, v8, s04541; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[12:13], v[28:29]4542; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v9, v25, v9, s04543; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4544; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v10, v26, v10 :: v_dual_cndmask_b32 v11, v27, v114545; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)4546; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[8:9]4547; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4548; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v12, v28, v12, s14549; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v13, v29, v13, s14550; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4551; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v8, v0 :: v_dual_cndmask_b32 v1, v9, v14552; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)4553; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s1, v[4:5], v[12:13]4554; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4555; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v4, v12, v4, s14556; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v5, v13, v5, s14557; GFX12-GISEL-NEXT: s_wait_loadcnt 0x04558; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[14:15], v[30:31]4559; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4560; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)4561; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v14, v30, v14, s04562; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v15, v31, v15, s04563; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[10:11]4564; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[14:15]4565; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4566; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_4) | instid1(VALU_DEP_2)4567; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v2, v10, v2, s04568; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v3, v11, v3, s04569; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4570; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v6, v14, v6 :: v_dual_cndmask_b32 v7, v15, v74571; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[4:5]4572; GFX12-GISEL-NEXT: v_cmp_gt_i64_e64 s0, v[2:3], v[6:7]4573; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4574; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v4, v0 :: v_dual_cndmask_b32 v1, v5, v14575; GFX12-GISEL-NEXT: s_wait_alu depctr_va_sdst(0)4576; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)4577; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v2, v6, v2, s04578; GFX12-GISEL-NEXT: v_cndmask_b32_e64 v3, v7, v3, s04579; GFX12-GISEL-NEXT: v_cmp_gt_i64_e32 vcc_lo, v[0:1], v[2:3]4580; GFX12-GISEL-NEXT: s_wait_alu depctr_va_vcc(0)4581; GFX12-GISEL-NEXT: v_dual_cndmask_b32 v0, v2, v0 :: v_dual_cndmask_b32 v1, v3, v14582; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]4583entry:4584 %res = call i64 @llvm.vector.reduce.smax.v16i64(<16 x i64> %v)4585 ret i64 %res4586}4587 4588declare i8 @llvm.vector.reduce.smax.v2i8(<2 x i8>)4589declare i8 @llvm.vector.reduce.smax.v3i8(<3 x i8>)4590declare i8 @llvm.vector.reduce.smax.v4i8(<4 x i8>)4591declare i8 @llvm.vector.reduce.smax.v8i8(<8 x i8>)4592declare i8 @llvm.vector.reduce.smax.v16i8(<16 x i8>)4593 4594declare i16 @llvm.vector.reduce.smax.v2i16(<2 x i16>)4595declare i16 @llvm.vector.reduce.smax.v3i16(<3 x i16>)4596declare i16 @llvm.vector.reduce.smax.v4i16(<4 x i16>)4597declare i16 @llvm.vector.reduce.smax.v8i16(<8 x i16>)4598declare i16 @llvm.vector.reduce.smax.v16i16(<16 x i16>)4599 4600declare i32 @llvm.vector.reduce.smax.v2i32(<2 x i32>)4601declare i32 @llvm.vector.reduce.smax.v3i32(<3 x i32>)4602declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>)4603declare i32 @llvm.vector.reduce.smax.v8i32(<8 x i32>)4604declare i32 @llvm.vector.reduce.smax.v16i32(<16 x i32>)4605 4606declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>)4607declare i64 @llvm.vector.reduce.smax.v3i64(<3 x i64>)4608declare i64 @llvm.vector.reduce.smax.v4i64(<4 x i64>)4609declare i64 @llvm.vector.reduce.smax.v8i64(<8 x i64>)4610declare i64 @llvm.vector.reduce.smax.v16i64(<16 x i64>)4611;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:4612; GFX11-GISEL-FAKE16: {{.*}}4613; GFX12-GISEL-FAKE16: {{.*}}4614