brintos

brintos / llvm-project-archived public Read only

0
0
Text · 159.2 KiB · dfc59f6 Raw
3473 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 -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 -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 -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 -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 -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL,GFX11-GISEL-TRUE16 %s14; RUN: llc -global-isel=1 -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 -mtriple=amdgcn -mcpu=gfx1200 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX12,GFX12-GISEL,GFX12-GISEL-TRUE16 %s18; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1200 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX12,GFX12-GISEL,GFX12-GISEL-FAKE16 %s19 20define i8 @test_vector_reduce_and_v2i8(<2 x i8> %v) {21; GFX7-SDAG-LABEL: test_vector_reduce_and_v2i8:22; GFX7-SDAG:       ; %bb.0: ; %entry23; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)24; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v125; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v026; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]27;28; GFX7-GISEL-LABEL: test_vector_reduce_and_v2i8:29; GFX7-GISEL:       ; %bb.0: ; %entry30; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)31; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v132; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]33;34; GFX8-SDAG-LABEL: test_vector_reduce_and_v2i8:35; GFX8-SDAG:       ; %bb.0: ; %entry36; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)37; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v138; GFX8-SDAG-NEXT:    v_and_b32_sdwa v1, v1, v1 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_139; GFX8-SDAG-NEXT:    v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD40; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]41;42; GFX8-GISEL-LABEL: test_vector_reduce_and_v2i8:43; GFX8-GISEL:       ; %bb.0: ; %entry44; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)45; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v146; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]47;48; GFX9-SDAG-LABEL: test_vector_reduce_and_v2i8:49; GFX9-SDAG:       ; %bb.0: ; %entry50; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)51; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v152; GFX9-SDAG-NEXT:    v_and_b32_sdwa v1, v1, v1 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_153; GFX9-SDAG-NEXT:    s_nop 054; GFX9-SDAG-NEXT:    v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD55; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]56;57; GFX9-GISEL-LABEL: test_vector_reduce_and_v2i8:58; GFX9-GISEL:       ; %bb.0: ; %entry59; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)60; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v161; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]62;63; GFX10-SDAG-LABEL: test_vector_reduce_and_v2i8:64; GFX10-SDAG:       ; %bb.0: ; %entry65; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)66; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v167; GFX10-SDAG-NEXT:    v_and_b32_sdwa v1, v1, v1 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_168; GFX10-SDAG-NEXT:    v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD69; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]70;71; GFX10-GISEL-LABEL: test_vector_reduce_and_v2i8:72; GFX10-GISEL:       ; %bb.0: ; %entry73; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)74; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v175; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]76;77; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v2i8:78; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry79; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)80; GFX11-SDAG-TRUE16-NEXT:    v_lshrrev_b16 v0.h, 8, v1.l81; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l82; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)83; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v1.l, v0.h84; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l85; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)86; GFX11-SDAG-TRUE16-NEXT:    v_lshlrev_b16 v0.h, 8, v0.h87; GFX11-SDAG-TRUE16-NEXT:    v_or_b16 v0.l, v0.l, v0.h88; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]89;90; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v2i8:91; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry92; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)93; GFX11-SDAG-FAKE16-NEXT:    v_lshrrev_b16 v2, 8, v194; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v195; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)96; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v297; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v098; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)99; GFX11-SDAG-FAKE16-NEXT:    v_lshlrev_b16 v1, 8, v1100; GFX11-SDAG-FAKE16-NEXT:    v_or_b32_e32 v0, v0, v1101; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]102;103; GFX11-GISEL-LABEL: test_vector_reduce_and_v2i8:104; GFX11-GISEL:       ; %bb.0: ; %entry105; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)106; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1107; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]108;109; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v2i8:110; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry111; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x0112; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x0113; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x0114; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x0115; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x0116; GFX12-SDAG-TRUE16-NEXT:    v_lshrrev_b16 v0.h, 8, v1.l117; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l118; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)119; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v1.l, v0.h120; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l121; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)122; GFX12-SDAG-TRUE16-NEXT:    v_lshlrev_b16 v0.h, 8, v0.h123; GFX12-SDAG-TRUE16-NEXT:    v_or_b16 v0.l, v0.l, v0.h124; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]125;126; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v2i8:127; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry128; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x0129; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x0130; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x0131; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x0132; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x0133; GFX12-SDAG-FAKE16-NEXT:    v_lshrrev_b16 v2, 8, v1134; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1135; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)136; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v2137; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0138; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)139; GFX12-SDAG-FAKE16-NEXT:    v_lshlrev_b16 v1, 8, v1140; GFX12-SDAG-FAKE16-NEXT:    v_or_b32_e32 v0, v0, v1141; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]142;143; GFX12-GISEL-LABEL: test_vector_reduce_and_v2i8:144; GFX12-GISEL:       ; %bb.0: ; %entry145; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x0146; GFX12-GISEL-NEXT:    s_wait_expcnt 0x0147; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x0148; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x0149; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x0150; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1151; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]152entry:153  %res = call i8 @llvm.vector.reduce.and.v2i8(<2 x i8> %v)154  ret i8 %res155}156 157define i8 @test_vector_reduce_and_v3i8(<3 x i8> %v) {158; GFX7-SDAG-LABEL: test_vector_reduce_and_v3i8:159; GFX7-SDAG:       ; %bb.0: ; %entry160; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)161; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2162; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1163; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]164;165; GFX7-GISEL-LABEL: test_vector_reduce_and_v3i8:166; GFX7-GISEL:       ; %bb.0: ; %entry167; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)168; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1169; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2170; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]171;172; GFX8-SDAG-LABEL: test_vector_reduce_and_v3i8:173; GFX8-SDAG:       ; %bb.0: ; %entry174; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)175; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2176; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1177; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]178;179; GFX8-GISEL-LABEL: test_vector_reduce_and_v3i8:180; GFX8-GISEL:       ; %bb.0: ; %entry181; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)182; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1183; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2184; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]185;186; GFX9-SDAG-LABEL: test_vector_reduce_and_v3i8:187; GFX9-SDAG:       ; %bb.0: ; %entry188; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)189; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2190; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1191; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]192;193; GFX9-GISEL-LABEL: test_vector_reduce_and_v3i8:194; GFX9-GISEL:       ; %bb.0: ; %entry195; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)196; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1197; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2198; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]199;200; GFX10-SDAG-LABEL: test_vector_reduce_and_v3i8:201; GFX10-SDAG:       ; %bb.0: ; %entry202; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)203; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2204; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1205; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]206;207; GFX10-GISEL-LABEL: test_vector_reduce_and_v3i8:208; GFX10-GISEL:       ; %bb.0: ; %entry209; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)210; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1211; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2212; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]213;214; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v3i8:215; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry216; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)217; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v2.l218; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)219; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l220; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]221;222; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v3i8:223; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry224; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)225; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2226; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)227; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1228; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]229;230; GFX11-GISEL-LABEL: test_vector_reduce_and_v3i8:231; GFX11-GISEL:       ; %bb.0: ; %entry232; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)233; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1234; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)235; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2236; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]237;238; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v3i8:239; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry240; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x0241; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x0242; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x0243; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x0244; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x0245; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v2.l246; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)247; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l248; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]249;250; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v3i8:251; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry252; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x0253; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x0254; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x0255; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x0256; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x0257; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2258; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)259; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1260; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]261;262; GFX12-GISEL-LABEL: test_vector_reduce_and_v3i8:263; GFX12-GISEL:       ; %bb.0: ; %entry264; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x0265; GFX12-GISEL-NEXT:    s_wait_expcnt 0x0266; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x0267; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x0268; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x0269; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1270; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)271; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2272; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]273entry:274  %res = call i8 @llvm.vector.reduce.and.v3i8(<3 x i8> %v)275  ret i8 %res276}277 278define i8 @test_vector_reduce_and_v4i8(<4 x i8> %v) {279; GFX7-SDAG-LABEL: test_vector_reduce_and_v4i8:280; GFX7-SDAG:       ; %bb.0: ; %entry281; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)282; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3283; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2284; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1285; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0286; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]287;288; GFX7-GISEL-LABEL: test_vector_reduce_and_v4i8:289; GFX7-GISEL:       ; %bb.0: ; %entry290; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)291; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2292; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3293; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1294; GFX7-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8295; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]296;297; GFX8-SDAG-LABEL: test_vector_reduce_and_v4i8:298; GFX8-SDAG:       ; %bb.0: ; %entry299; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)300; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3301; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2302; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1303; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0304; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]305;306; GFX8-GISEL-LABEL: test_vector_reduce_and_v4i8:307; GFX8-GISEL:       ; %bb.0: ; %entry308; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)309; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2310; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3311; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1312; GFX8-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8313; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]314;315; GFX9-SDAG-LABEL: test_vector_reduce_and_v4i8:316; GFX9-SDAG:       ; %bb.0: ; %entry317; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)318; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3319; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2320; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1321; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0322; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]323;324; GFX9-GISEL-LABEL: test_vector_reduce_and_v4i8:325; GFX9-GISEL:       ; %bb.0: ; %entry326; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)327; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2328; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3329; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1330; GFX9-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8331; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]332;333; GFX10-SDAG-LABEL: test_vector_reduce_and_v4i8:334; GFX10-SDAG:       ; %bb.0: ; %entry335; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)336; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3337; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2338; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1339; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0340; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]341;342; GFX10-GISEL-LABEL: test_vector_reduce_and_v4i8:343; GFX10-GISEL:       ; %bb.0: ; %entry344; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)345; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2346; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3347; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1348; GFX10-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8349; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]350;351; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v4i8:352; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry353; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)354; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v1.l, v3.l355; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v2.l356; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)357; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v0.h358; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l359; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]360;361; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v4i8:362; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry363; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)364; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v3365; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2366; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)367; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1368; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0369; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]370;371; GFX11-GISEL-LABEL: test_vector_reduce_and_v4i8:372; GFX11-GISEL:       ; %bb.0: ; %entry373; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)374; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2375; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3376; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)377; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1378; GFX11-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8379; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]380;381; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v4i8:382; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry383; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x0384; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x0385; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x0386; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x0387; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x0388; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v1.l, v3.l389; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v2.l390; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)391; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v0.h392; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l393; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]394;395; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v4i8:396; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry397; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x0398; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x0399; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x0400; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x0401; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x0402; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v3403; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2404; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)405; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1406; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0407; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]408;409; GFX12-GISEL-LABEL: test_vector_reduce_and_v4i8:410; GFX12-GISEL:       ; %bb.0: ; %entry411; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x0412; GFX12-GISEL-NEXT:    s_wait_expcnt 0x0413; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x0414; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x0415; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x0416; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2417; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3418; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)419; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1420; GFX12-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8421; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]422entry:423  %res = call i8 @llvm.vector.reduce.and.v4i8(<4 x i8> %v)424  ret i8 %res425}426 427define i8 @test_vector_reduce_and_v8i8(<8 x i8> %v) {428; GFX7-SDAG-LABEL: test_vector_reduce_and_v8i8:429; GFX7-SDAG:       ; %bb.0: ; %entry430; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)431; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6432; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4433; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7434; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5435; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3436; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2437; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1438; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0439; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]440;441; GFX7-GISEL-LABEL: test_vector_reduce_and_v8i8:442; GFX7-GISEL:       ; %bb.0: ; %entry443; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)444; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4445; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5446; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6447; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7448; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2449; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3450; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1451; GFX7-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8452; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]453;454; GFX8-SDAG-LABEL: test_vector_reduce_and_v8i8:455; GFX8-SDAG:       ; %bb.0: ; %entry456; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)457; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6458; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4459; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7460; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5461; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3462; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2463; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1464; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0465; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]466;467; GFX8-GISEL-LABEL: test_vector_reduce_and_v8i8:468; GFX8-GISEL:       ; %bb.0: ; %entry469; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)470; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4471; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5472; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6473; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7474; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2475; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3476; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1477; GFX8-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8478; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]479;480; GFX9-SDAG-LABEL: test_vector_reduce_and_v8i8:481; GFX9-SDAG:       ; %bb.0: ; %entry482; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)483; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6484; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4485; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7486; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5487; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3488; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2489; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1490; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0491; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]492;493; GFX9-GISEL-LABEL: test_vector_reduce_and_v8i8:494; GFX9-GISEL:       ; %bb.0: ; %entry495; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)496; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4497; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5498; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6499; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7500; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2501; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3502; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1503; GFX9-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8504; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]505;506; GFX10-SDAG-LABEL: test_vector_reduce_and_v8i8:507; GFX10-SDAG:       ; %bb.0: ; %entry508; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)509; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6510; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7511; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5512; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4513; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3514; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2515; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1516; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0517; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]518;519; GFX10-GISEL-LABEL: test_vector_reduce_and_v8i8:520; GFX10-GISEL:       ; %bb.0: ; %entry521; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)522; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4523; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5524; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6525; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7526; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2527; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3528; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1529; GFX10-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8530; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]531;532; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v8i8:533; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry534; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)535; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v2.l, v6.l536; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.h, v3.l, v7.l537; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v5.l538; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v4.l539; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)540; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v1.h541; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v0.h542; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)543; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l544; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l545; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]546;547; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v8i8:548; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry549; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)550; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v6551; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v7552; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v5553; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v4554; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)555; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v3556; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2557; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)558; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1559; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0560; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]561;562; GFX11-GISEL-LABEL: test_vector_reduce_and_v8i8:563; GFX11-GISEL:       ; %bb.0: ; %entry564; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)565; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4566; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5567; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6568; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7569; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)570; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2571; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3572; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)573; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1574; GFX11-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8575; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]576;577; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v8i8:578; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry579; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x0580; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x0581; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x0582; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x0583; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x0584; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v2.l, v6.l585; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.h, v3.l, v7.l586; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v5.l587; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v4.l588; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)589; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v1.h590; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v0.h591; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)592; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l593; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l594; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]595;596; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v8i8:597; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry598; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x0599; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x0600; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x0601; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x0602; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x0603; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v6604; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v7605; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v5606; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v4607; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)608; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v3609; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2610; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)611; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1612; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0613; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]614;615; GFX12-GISEL-LABEL: test_vector_reduce_and_v8i8:616; GFX12-GISEL:       ; %bb.0: ; %entry617; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x0618; GFX12-GISEL-NEXT:    s_wait_expcnt 0x0619; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x0620; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x0621; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x0622; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4623; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5624; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6625; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7626; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)627; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2628; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3629; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)630; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1631; GFX12-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8632; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]633entry:634  %res = call i8 @llvm.vector.reduce.and.v8i8(<8 x i8> %v)635  ret i8 %res636}637 638define i8 @test_vector_reduce_and_v16i8(<16 x i8> %v) {639; GFX7-SDAG-LABEL: test_vector_reduce_and_v16i8:640; GFX7-SDAG:       ; %bb.0: ; %entry641; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)642; GFX7-SDAG-NEXT:    v_and_b32_e32 v5, v5, v13643; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v9644; GFX7-SDAG-NEXT:    v_and_b32_e32 v7, v7, v15645; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v11646; GFX7-SDAG-NEXT:    v_and_b32_e32 v4, v4, v12647; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v8648; GFX7-SDAG-NEXT:    v_and_b32_e32 v6, v6, v14649; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v10650; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6651; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4652; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7653; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5654; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3655; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2656; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1657; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0658; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]659;660; GFX7-GISEL-LABEL: test_vector_reduce_and_v16i8:661; GFX7-GISEL:       ; %bb.0: ; %entry662; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)663; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v8664; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v9665; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v10666; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v11667; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, v4, v12668; GFX7-GISEL-NEXT:    v_and_b32_e32 v5, v5, v13669; GFX7-GISEL-NEXT:    v_and_b32_e32 v6, v6, v14670; GFX7-GISEL-NEXT:    v_and_b32_e32 v7, v7, v15671; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4672; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5673; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6674; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7675; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2676; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3677; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1678; GFX7-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8679; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]680;681; GFX8-SDAG-LABEL: test_vector_reduce_and_v16i8:682; GFX8-SDAG:       ; %bb.0: ; %entry683; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)684; GFX8-SDAG-NEXT:    v_and_b32_e32 v5, v5, v13685; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v9686; GFX8-SDAG-NEXT:    v_and_b32_e32 v7, v7, v15687; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v11688; GFX8-SDAG-NEXT:    v_and_b32_e32 v4, v4, v12689; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v8690; GFX8-SDAG-NEXT:    v_and_b32_e32 v6, v6, v14691; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v10692; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6693; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4694; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7695; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5696; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3697; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2698; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1699; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0700; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]701;702; GFX8-GISEL-LABEL: test_vector_reduce_and_v16i8:703; GFX8-GISEL:       ; %bb.0: ; %entry704; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)705; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v8706; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v9707; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v10708; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v11709; GFX8-GISEL-NEXT:    v_and_b32_e32 v4, v4, v12710; GFX8-GISEL-NEXT:    v_and_b32_e32 v5, v5, v13711; GFX8-GISEL-NEXT:    v_and_b32_e32 v6, v6, v14712; GFX8-GISEL-NEXT:    v_and_b32_e32 v7, v7, v15713; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4714; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5715; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6716; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7717; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2718; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3719; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1720; GFX8-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8721; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]722;723; GFX9-SDAG-LABEL: test_vector_reduce_and_v16i8:724; GFX9-SDAG:       ; %bb.0: ; %entry725; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)726; GFX9-SDAG-NEXT:    v_and_b32_e32 v5, v5, v13727; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v9728; GFX9-SDAG-NEXT:    v_and_b32_e32 v7, v7, v15729; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v11730; GFX9-SDAG-NEXT:    v_and_b32_e32 v4, v4, v12731; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v8732; GFX9-SDAG-NEXT:    v_and_b32_e32 v6, v6, v14733; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v10734; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6735; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4736; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7737; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5738; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3739; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2740; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1741; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0742; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]743;744; GFX9-GISEL-LABEL: test_vector_reduce_and_v16i8:745; GFX9-GISEL:       ; %bb.0: ; %entry746; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)747; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v8748; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v9749; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v10750; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v11751; GFX9-GISEL-NEXT:    v_and_b32_e32 v4, v4, v12752; GFX9-GISEL-NEXT:    v_and_b32_e32 v5, v5, v13753; GFX9-GISEL-NEXT:    v_and_b32_e32 v6, v6, v14754; GFX9-GISEL-NEXT:    v_and_b32_e32 v7, v7, v15755; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4756; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5757; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6758; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7759; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2760; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3761; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1762; GFX9-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8763; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]764;765; GFX10-SDAG-LABEL: test_vector_reduce_and_v16i8:766; GFX10-SDAG:       ; %bb.0: ; %entry767; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)768; GFX10-SDAG-NEXT:    v_and_b32_e32 v5, v5, v13769; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v9770; GFX10-SDAG-NEXT:    v_and_b32_e32 v7, v7, v15771; GFX10-SDAG-NEXT:    v_and_b32_e32 v6, v6, v14772; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v10773; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v11774; GFX10-SDAG-NEXT:    v_and_b32_e32 v4, v4, v12775; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v8776; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v5777; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v6778; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v7779; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v4780; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v3781; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v2782; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1783; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, 0xff, v0784; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]785;786; GFX10-GISEL-LABEL: test_vector_reduce_and_v16i8:787; GFX10-GISEL:       ; %bb.0: ; %entry788; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)789; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v8790; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v9791; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v10792; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v11793; GFX10-GISEL-NEXT:    v_and_b32_e32 v4, v4, v12794; GFX10-GISEL-NEXT:    v_and_b32_e32 v5, v5, v13795; GFX10-GISEL-NEXT:    v_and_b32_e32 v6, v6, v14796; GFX10-GISEL-NEXT:    v_and_b32_e32 v7, v7, v15797; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4798; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5799; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6800; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7801; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2802; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3803; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1804; GFX10-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8805; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]806;807; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v16i8:808; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry809; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)810; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.h, v5.l, v13.l811; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v9.l812; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v5.l, v7.l, v15.l813; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v6.l, v14.l814; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v2.l, v2.l, v10.l815; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v2.h, v3.l, v11.l816; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v3.l, v4.l, v12.l817; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v8.l818; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v1.h819; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v2.l, v0.h820; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v2.l, v2.h, v5.l821; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)822; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v3.l823; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v2.l824; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)825; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v0.h826; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l827; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)828; GFX11-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l829; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]830;831; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v16i8:832; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry833; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)834; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v5, v5, v13835; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v9836; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v7, v7, v15837; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v6, v6, v14838; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v10839; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v11840; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v4, v4, v12841; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v8842; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v5843; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v6844; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v7845; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)846; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v4847; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v3848; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)849; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2850; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1851; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)852; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0853; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]854;855; GFX11-GISEL-LABEL: test_vector_reduce_and_v16i8:856; GFX11-GISEL:       ; %bb.0: ; %entry857; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)858; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v8859; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v9860; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v10861; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v11862; GFX11-GISEL-NEXT:    v_and_b32_e32 v4, v4, v12863; GFX11-GISEL-NEXT:    v_and_b32_e32 v5, v5, v13864; GFX11-GISEL-NEXT:    v_and_b32_e32 v6, v6, v14865; GFX11-GISEL-NEXT:    v_and_b32_e32 v7, v7, v15866; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)867; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4868; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5869; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)870; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6871; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7872; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)873; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2874; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3875; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)876; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1877; GFX11-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8878; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]879;880; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v16i8:881; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry882; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x0883; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x0884; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x0885; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x0886; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x0887; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.h, v5.l, v13.l888; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v9.l889; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v5.l, v7.l, v15.l890; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v6.l, v14.l891; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v2.l, v2.l, v10.l892; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v2.h, v3.l, v11.l893; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v3.l, v4.l, v12.l894; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v8.l895; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v1.h896; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.h, v2.l, v0.h897; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v2.l, v2.h, v5.l898; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)899; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v3.l900; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v1.l, v1.l, v2.l901; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)902; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v0.h903; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, v0.l, v1.l904; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)905; GFX12-SDAG-TRUE16-NEXT:    v_and_b16 v0.l, 0xff, v0.l906; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]907;908; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v16i8:909; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry910; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x0911; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x0912; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x0913; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x0914; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x0915; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v5, v5, v13916; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v9917; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v7, v7, v15918; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v6, v6, v14919; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v10920; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v11921; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v4, v4, v12922; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v8923; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v5924; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v6925; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v7926; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)927; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v4928; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v3929; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)930; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v2931; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v1932; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)933; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, 0xff, v0934; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]935;936; GFX12-GISEL-LABEL: test_vector_reduce_and_v16i8:937; GFX12-GISEL:       ; %bb.0: ; %entry938; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x0939; GFX12-GISEL-NEXT:    s_wait_expcnt 0x0940; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x0941; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x0942; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x0943; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v8944; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v9945; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v10946; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v11947; GFX12-GISEL-NEXT:    v_and_b32_e32 v4, v4, v12948; GFX12-GISEL-NEXT:    v_and_b32_e32 v5, v5, v13949; GFX12-GISEL-NEXT:    v_and_b32_e32 v6, v6, v14950; GFX12-GISEL-NEXT:    v_and_b32_e32 v7, v7, v15951; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)952; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v4953; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v5954; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)955; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v6956; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v7957; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)958; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v2959; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v3960; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)961; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1962; GFX12-GISEL-NEXT:    v_bfe_u32 v0, v0, 0, 8963; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]964entry:965  %res = call i8 @llvm.vector.reduce.and.v16i8(<16 x i8> %v)966  ret i8 %res967}968 969define i16 @test_vector_reduce_and_v2i16(<2 x i16> %v) {970; GFX7-SDAG-LABEL: test_vector_reduce_and_v2i16:971; GFX7-SDAG:       ; %bb.0: ; %entry972; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)973; GFX7-SDAG-NEXT:    v_lshrrev_b32_e32 v2, 16, v1974; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v1975; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v2976; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xffff, v0977; GFX7-SDAG-NEXT:    v_lshlrev_b32_e32 v1, 16, v1978; GFX7-SDAG-NEXT:    v_or_b32_e32 v0, v0, v1979; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]980;981; GFX7-GISEL-LABEL: test_vector_reduce_and_v2i16:982; GFX7-GISEL:       ; %bb.0: ; %entry983; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)984; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v2, 16, v1985; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, 0xffff, v0986; GFX7-GISEL-NEXT:    v_or_b32_e32 v0, v2, v0987; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, 0xffff, v1988; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v1989; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]990;991; GFX8-LABEL: test_vector_reduce_and_v2i16:992; GFX8:       ; %bb.0: ; %entry993; GFX8-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)994; GFX8-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1995; GFX8-NEXT:    s_setpc_b64 s[30:31]996;997; GFX9-SDAG-LABEL: test_vector_reduce_and_v2i16:998; GFX9-SDAG:       ; %bb.0: ; %entry999; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1000; GFX9-SDAG-NEXT:    v_alignbit_b32 v1, s0, v0, 161001; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11002; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]1003;1004; GFX9-GISEL-LABEL: test_vector_reduce_and_v2i16:1005; GFX9-GISEL:       ; %bb.0: ; %entry1006; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1007; GFX9-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11008; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]1009;1010; GFX10-SDAG-LABEL: test_vector_reduce_and_v2i16:1011; GFX10-SDAG:       ; %bb.0: ; %entry1012; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1013; GFX10-SDAG-NEXT:    v_alignbit_b32 v1, s4, v0, 161014; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11015; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]1016;1017; GFX10-GISEL-LABEL: test_vector_reduce_and_v2i16:1018; GFX10-GISEL:       ; %bb.0: ; %entry1019; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1020; GFX10-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11021; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]1022;1023; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v2i16:1024; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry1025; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1026; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.l, v0.h1027; GFX11-SDAG-TRUE16-NEXT:    v_mov_b32_e32 v1, s01028; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1029; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.h, v1.l1030; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21031; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1032;1033; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v2i16:1034; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry1035; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1036; GFX11-SDAG-FAKE16-NEXT:    v_alignbit_b32 v1, s0, v0, 161037; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1038; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11039; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1040;1041; GFX11-GISEL-LABEL: test_vector_reduce_and_v2i16:1042; GFX11-GISEL:       ; %bb.0: ; %entry1043; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1044; GFX11-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01045; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1046; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11047; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]1048;1049; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v2i16:1050; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry1051; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x01052; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x01053; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x01054; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x01055; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x01056; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.l, v0.h1057; GFX12-SDAG-TRUE16-NEXT:    v_mov_b32_e32 v1, s01058; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1059; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.h, v1.l1060; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21061; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1062;1063; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v2i16:1064; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry1065; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x01066; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x01067; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x01068; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x01069; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x01070; GFX12-SDAG-FAKE16-NEXT:    v_alignbit_b32 v1, s0, v0, 161071; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1072; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11073; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1074;1075; GFX12-GISEL-LABEL: test_vector_reduce_and_v2i16:1076; GFX12-GISEL:       ; %bb.0: ; %entry1077; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x01078; GFX12-GISEL-NEXT:    s_wait_expcnt 0x01079; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x01080; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x01081; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x01082; GFX12-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01083; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1084; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11085; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]1086entry:1087  %res = call i16 @llvm.vector.reduce.and.v2i16(<2 x i16> %v)1088  ret i16 %res1089}1090 1091define i16 @test_vector_reduce_and_v3i16(<3 x i16> %v) {1092; GFX7-SDAG-LABEL: test_vector_reduce_and_v3i16:1093; GFX7-SDAG:       ; %bb.0: ; %entry1094; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1095; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21096; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11097; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xffff, v01098; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]1099;1100; GFX7-GISEL-LABEL: test_vector_reduce_and_v3i16:1101; GFX7-GISEL:       ; %bb.0: ; %entry1102; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1103; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11104; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21105; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]1106;1107; GFX8-LABEL: test_vector_reduce_and_v3i16:1108; GFX8:       ; %bb.0: ; %entry1109; GFX8-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1110; GFX8-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11111; GFX8-NEXT:    v_and_b32_e32 v0, v0, v11112; GFX8-NEXT:    s_setpc_b64 s[30:31]1113;1114; GFX9-LABEL: test_vector_reduce_and_v3i16:1115; GFX9:       ; %bb.0: ; %entry1116; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1117; GFX9-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11118; GFX9-NEXT:    v_and_b32_e32 v0, v0, v11119; GFX9-NEXT:    s_setpc_b64 s[30:31]1120;1121; GFX10-LABEL: test_vector_reduce_and_v3i16:1122; GFX10:       ; %bb.0: ; %entry1123; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1124; GFX10-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11125; GFX10-NEXT:    v_and_b32_e32 v0, v0, v11126; GFX10-NEXT:    s_setpc_b64 s[30:31]1127;1128; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v3i16:1129; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry1130; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1131; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.h, 01132; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.l, v0.h1133; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1134; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21135; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11136; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1137;1138; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v3i16:1139; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry1140; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1141; GFX11-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v2, 16, v01142; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1143; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v21144; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11145; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1146;1147; GFX11-GISEL-LABEL: test_vector_reduce_and_v3i16:1148; GFX11-GISEL:       ; %bb.0: ; %entry1149; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1150; GFX11-GISEL-NEXT:    v_lshrrev_b32_e32 v2, 16, v01151; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1152; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21153; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11154; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]1155;1156; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v3i16:1157; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry1158; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x01159; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x01160; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x01161; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x01162; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x01163; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.h, 01164; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v2.l, v0.h1165; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1166; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21167; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11168; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1169;1170; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v3i16:1171; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry1172; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x01173; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x01174; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x01175; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x01176; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x01177; GFX12-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v2, 16, v01178; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1179; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v21180; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11181; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1182;1183; GFX12-GISEL-LABEL: test_vector_reduce_and_v3i16:1184; GFX12-GISEL:       ; %bb.0: ; %entry1185; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x01186; GFX12-GISEL-NEXT:    s_wait_expcnt 0x01187; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x01188; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x01189; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x01190; GFX12-GISEL-NEXT:    v_lshrrev_b32_e32 v2, 16, v01191; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1192; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21193; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11194; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]1195entry:1196  %res = call i16 @llvm.vector.reduce.and.v3i16(<3 x i16> %v)1197  ret i16 %res1198}1199 1200define i16 @test_vector_reduce_and_v4i16(<4 x i16> %v) {1201; GFX7-SDAG-LABEL: test_vector_reduce_and_v4i16:1202; GFX7-SDAG:       ; %bb.0: ; %entry1203; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1204; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31205; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21206; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11207; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xffff, v01208; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]1209;1210; GFX7-GISEL-LABEL: test_vector_reduce_and_v4i16:1211; GFX7-GISEL:       ; %bb.0: ; %entry1212; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1213; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v1, 16, v11214; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, 0xffff, v01215; GFX7-GISEL-NEXT:    v_or_b32_e32 v0, v1, v01216; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, 0xffff, v21217; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, 0xffff, v31218; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v2, 16, v21219; GFX7-GISEL-NEXT:    v_or_b32_e32 v1, v1, v21220; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11221; GFX7-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01222; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11223; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]1224;1225; GFX8-SDAG-LABEL: test_vector_reduce_and_v4i16:1226; GFX8-SDAG:       ; %bb.0: ; %entry1227; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1228; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11229; GFX8-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11230; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]1231;1232; GFX8-GISEL-LABEL: test_vector_reduce_and_v4i16:1233; GFX8-GISEL:       ; %bb.0: ; %entry1234; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1235; GFX8-GISEL-NEXT:    v_lshrrev_b32_e32 v2, 16, v11236; GFX8-GISEL-NEXT:    v_lshlrev_b32_e32 v2, 16, v21237; GFX8-GISEL-NEXT:    v_or_b32_sdwa v1, v1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD1238; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11239; GFX8-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11240; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]1241;1242; GFX9-LABEL: test_vector_reduce_and_v4i16:1243; GFX9:       ; %bb.0: ; %entry1244; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1245; GFX9-NEXT:    v_and_b32_e32 v0, v0, v11246; GFX9-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11247; GFX9-NEXT:    s_setpc_b64 s[30:31]1248;1249; GFX10-LABEL: test_vector_reduce_and_v4i16:1250; GFX10:       ; %bb.0: ; %entry1251; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1252; GFX10-NEXT:    v_and_b32_e32 v0, v0, v11253; GFX10-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11254; GFX10-NEXT:    s_setpc_b64 s[30:31]1255;1256; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v4i16:1257; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry1258; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1259; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11260; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.h, 01261; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)1262; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.l, v0.h1263; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11264; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1265;1266; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v4i16:1267; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry1268; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1269; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11270; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1271; GFX11-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v1, 16, v01272; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11273; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1274;1275; GFX11-GISEL-LABEL: test_vector_reduce_and_v4i16:1276; GFX11-GISEL:       ; %bb.0: ; %entry1277; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1278; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11279; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1280; GFX11-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01281; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11282; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]1283;1284; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v4i16:1285; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry1286; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x01287; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x01288; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x01289; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x01290; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x01291; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11292; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.h, 01293; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)1294; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.l, v0.h1295; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11296; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1297;1298; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v4i16:1299; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry1300; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x01301; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x01302; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x01303; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x01304; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x01305; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11306; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1307; GFX12-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v1, 16, v01308; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11309; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1310;1311; GFX12-GISEL-LABEL: test_vector_reduce_and_v4i16:1312; GFX12-GISEL:       ; %bb.0: ; %entry1313; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x01314; GFX12-GISEL-NEXT:    s_wait_expcnt 0x01315; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x01316; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x01317; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x01318; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11319; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1320; GFX12-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01321; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11322; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]1323entry:1324  %res = call i16 @llvm.vector.reduce.and.v4i16(<4 x i16> %v)1325  ret i16 %res1326}1327 1328define i16 @test_vector_reduce_and_v8i16(<8 x i16> %v) {1329; GFX7-SDAG-LABEL: test_vector_reduce_and_v8i16:1330; GFX7-SDAG:       ; %bb.0: ; %entry1331; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1332; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v61333; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v41334; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v71335; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v51336; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31337; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21338; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11339; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xffff, v01340; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]1341;1342; GFX7-GISEL-LABEL: test_vector_reduce_and_v8i16:1343; GFX7-GISEL:       ; %bb.0: ; %entry1344; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1345; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v1, 16, v11346; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, 0xffff, v01347; GFX7-GISEL-NEXT:    v_or_b32_e32 v0, v1, v01348; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v1, 16, v31349; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, 0xffff, v21350; GFX7-GISEL-NEXT:    v_or_b32_e32 v1, v1, v21351; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v2, 16, v51352; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, 0xffff, v41353; GFX7-GISEL-NEXT:    v_or_b32_e32 v2, v2, v31354; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v3, 16, v71355; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, 0xffff, v61356; GFX7-GISEL-NEXT:    v_or_b32_e32 v3, v3, v41357; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21358; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31359; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11360; GFX7-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01361; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11362; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]1363;1364; GFX8-SDAG-LABEL: test_vector_reduce_and_v8i16:1365; GFX8-SDAG:       ; %bb.0: ; %entry1366; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1367; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31368; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21369; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11370; GFX8-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11371; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]1372;1373; GFX8-GISEL-LABEL: test_vector_reduce_and_v8i16:1374; GFX8-GISEL:       ; %bb.0: ; %entry1375; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1376; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21377; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31378; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11379; GFX8-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11380; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]1381;1382; GFX9-SDAG-LABEL: test_vector_reduce_and_v8i16:1383; GFX9-SDAG:       ; %bb.0: ; %entry1384; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1385; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31386; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21387; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11388; GFX9-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11389; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]1390;1391; GFX9-GISEL-LABEL: test_vector_reduce_and_v8i16:1392; GFX9-GISEL:       ; %bb.0: ; %entry1393; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1394; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21395; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31396; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11397; GFX9-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11398; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]1399;1400; GFX10-SDAG-LABEL: test_vector_reduce_and_v8i16:1401; GFX10-SDAG:       ; %bb.0: ; %entry1402; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1403; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31404; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21405; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11406; GFX10-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11407; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]1408;1409; GFX10-GISEL-LABEL: test_vector_reduce_and_v8i16:1410; GFX10-GISEL:       ; %bb.0: ; %entry1411; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1412; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21413; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31414; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11415; GFX10-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11416; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]1417;1418; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v8i16:1419; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry1420; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1421; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v1, v1, v31422; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21423; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)1424; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11425; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.h, 01426; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.l, v0.h1427; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1428; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11429; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1430;1431; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v8i16:1432; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry1433; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1434; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v31435; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v21436; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1437; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11438; GFX11-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v1, 16, v01439; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1440; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11441; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1442;1443; GFX11-GISEL-LABEL: test_vector_reduce_and_v8i16:1444; GFX11-GISEL:       ; %bb.0: ; %entry1445; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1446; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21447; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31448; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1449; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11450; GFX11-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01451; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1452; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11453; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]1454;1455; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v8i16:1456; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry1457; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x01458; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x01459; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x01460; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x01461; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x01462; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v1, v1, v31463; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21464; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)1465; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11466; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.h, 01467; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.l, v0.h1468; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1469; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11470; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1471;1472; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v8i16:1473; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry1474; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x01475; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x01476; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x01477; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x01478; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x01479; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v31480; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v21481; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1482; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11483; GFX12-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v1, 16, v01484; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1485; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11486; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1487;1488; GFX12-GISEL-LABEL: test_vector_reduce_and_v8i16:1489; GFX12-GISEL:       ; %bb.0: ; %entry1490; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x01491; GFX12-GISEL-NEXT:    s_wait_expcnt 0x01492; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x01493; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x01494; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x01495; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21496; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31497; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1498; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11499; GFX12-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01500; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1501; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11502; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]1503entry:1504  %res = call i16 @llvm.vector.reduce.and.v8i16(<8 x i16> %v)1505  ret i16 %res1506}1507 1508define i16 @test_vector_reduce_and_v16i16(<16 x i16> %v) {1509; GFX7-SDAG-LABEL: test_vector_reduce_and_v16i16:1510; GFX7-SDAG:       ; %bb.0: ; %entry1511; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1512; GFX7-SDAG-NEXT:    v_and_b32_e32 v5, v5, v131513; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v91514; GFX7-SDAG-NEXT:    v_and_b32_e32 v7, v7, v151515; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v111516; GFX7-SDAG-NEXT:    v_and_b32_e32 v4, v4, v121517; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v81518; GFX7-SDAG-NEXT:    v_and_b32_e32 v6, v6, v141519; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v101520; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v61521; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v41522; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v71523; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v51524; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31525; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21526; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11527; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, 0xffff, v01528; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]1529;1530; GFX7-GISEL-LABEL: test_vector_reduce_and_v16i16:1531; GFX7-GISEL:       ; %bb.0: ; %entry1532; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1533; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v1, 16, v11534; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, 0xffff, v01535; GFX7-GISEL-NEXT:    v_or_b32_e32 v0, v1, v01536; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v1, 16, v31537; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, 0xffff, v21538; GFX7-GISEL-NEXT:    v_or_b32_e32 v1, v1, v21539; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v2, 16, v51540; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, 0xffff, v41541; GFX7-GISEL-NEXT:    v_or_b32_e32 v2, v2, v31542; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v3, 16, v71543; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, 0xffff, v61544; GFX7-GISEL-NEXT:    v_or_b32_e32 v3, v3, v41545; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v4, 16, v91546; GFX7-GISEL-NEXT:    v_and_b32_e32 v5, 0xffff, v81547; GFX7-GISEL-NEXT:    v_or_b32_e32 v4, v4, v51548; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v5, 16, v111549; GFX7-GISEL-NEXT:    v_and_b32_e32 v6, 0xffff, v101550; GFX7-GISEL-NEXT:    v_or_b32_e32 v5, v5, v61551; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v6, 16, v131552; GFX7-GISEL-NEXT:    v_and_b32_e32 v7, 0xffff, v121553; GFX7-GISEL-NEXT:    v_or_b32_e32 v6, v6, v71554; GFX7-GISEL-NEXT:    v_lshlrev_b32_e32 v7, 16, v151555; GFX7-GISEL-NEXT:    v_and_b32_e32 v8, 0xffff, v141556; GFX7-GISEL-NEXT:    v_or_b32_e32 v7, v7, v81557; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41558; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51559; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61560; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71561; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21562; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31563; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11564; GFX7-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01565; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11566; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]1567;1568; GFX8-SDAG-LABEL: test_vector_reduce_and_v16i16:1569; GFX8-SDAG:       ; %bb.0: ; %entry1570; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1571; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v61572; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v41573; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v71574; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v51575; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31576; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21577; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11578; GFX8-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11579; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]1580;1581; GFX8-GISEL-LABEL: test_vector_reduce_and_v16i16:1582; GFX8-GISEL:       ; %bb.0: ; %entry1583; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1584; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41585; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51586; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61587; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71588; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21589; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31590; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11591; GFX8-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11592; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]1593;1594; GFX9-SDAG-LABEL: test_vector_reduce_and_v16i16:1595; GFX9-SDAG:       ; %bb.0: ; %entry1596; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1597; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v61598; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v41599; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v71600; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v51601; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31602; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21603; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11604; GFX9-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11605; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]1606;1607; GFX9-GISEL-LABEL: test_vector_reduce_and_v16i16:1608; GFX9-GISEL:       ; %bb.0: ; %entry1609; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1610; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41611; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51612; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61613; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71614; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21615; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31616; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11617; GFX9-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11618; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]1619;1620; GFX10-SDAG-LABEL: test_vector_reduce_and_v16i16:1621; GFX10-SDAG:       ; %bb.0: ; %entry1622; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1623; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v61624; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v71625; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v51626; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v41627; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31628; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21629; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11630; GFX10-SDAG-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11631; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]1632;1633; GFX10-GISEL-LABEL: test_vector_reduce_and_v16i16:1634; GFX10-GISEL:       ; %bb.0: ; %entry1635; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1636; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41637; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51638; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61639; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71640; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21641; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31642; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11643; GFX10-GISEL-NEXT:    v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_11644; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]1645;1646; GFX11-SDAG-TRUE16-LABEL: test_vector_reduce_and_v16i16:1647; GFX11-SDAG-TRUE16:       ; %bb.0: ; %entry1648; GFX11-SDAG-TRUE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1649; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v2, v2, v61650; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v3, v3, v71651; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v1, v1, v51652; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v41653; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1654; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v1, v1, v31655; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21656; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)1657; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11658; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.h, 01659; GFX11-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.l, v0.h1660; GFX11-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1661; GFX11-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11662; GFX11-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1663;1664; GFX11-SDAG-FAKE16-LABEL: test_vector_reduce_and_v16i16:1665; GFX11-SDAG-FAKE16:       ; %bb.0: ; %entry1666; GFX11-SDAG-FAKE16-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1667; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v61668; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v71669; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v51670; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v41671; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1672; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v31673; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v21674; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1675; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11676; GFX11-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v1, 16, v01677; GFX11-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1678; GFX11-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11679; GFX11-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1680;1681; GFX11-GISEL-LABEL: test_vector_reduce_and_v16i16:1682; GFX11-GISEL:       ; %bb.0: ; %entry1683; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1684; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41685; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51686; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61687; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71688; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1689; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21690; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31691; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1692; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11693; GFX11-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01694; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1695; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11696; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]1697;1698; GFX12-SDAG-TRUE16-LABEL: test_vector_reduce_and_v16i16:1699; GFX12-SDAG-TRUE16:       ; %bb.0: ; %entry1700; GFX12-SDAG-TRUE16-NEXT:    s_wait_loadcnt_dscnt 0x01701; GFX12-SDAG-TRUE16-NEXT:    s_wait_expcnt 0x01702; GFX12-SDAG-TRUE16-NEXT:    s_wait_samplecnt 0x01703; GFX12-SDAG-TRUE16-NEXT:    s_wait_bvhcnt 0x01704; GFX12-SDAG-TRUE16-NEXT:    s_wait_kmcnt 0x01705; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v2, v2, v61706; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v3, v3, v71707; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v1, v1, v51708; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v41709; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1710; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v1, v1, v31711; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v21712; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)1713; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11714; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.h, 01715; GFX12-SDAG-TRUE16-NEXT:    v_mov_b16_e32 v1.l, v0.h1716; GFX12-SDAG-TRUE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1717; GFX12-SDAG-TRUE16-NEXT:    v_and_b32_e32 v0, v0, v11718; GFX12-SDAG-TRUE16-NEXT:    s_setpc_b64 s[30:31]1719;1720; GFX12-SDAG-FAKE16-LABEL: test_vector_reduce_and_v16i16:1721; GFX12-SDAG-FAKE16:       ; %bb.0: ; %entry1722; GFX12-SDAG-FAKE16-NEXT:    s_wait_loadcnt_dscnt 0x01723; GFX12-SDAG-FAKE16-NEXT:    s_wait_expcnt 0x01724; GFX12-SDAG-FAKE16-NEXT:    s_wait_samplecnt 0x01725; GFX12-SDAG-FAKE16-NEXT:    s_wait_bvhcnt 0x01726; GFX12-SDAG-FAKE16-NEXT:    s_wait_kmcnt 0x01727; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v2, v2, v61728; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v3, v3, v71729; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v51730; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v41731; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1732; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v1, v1, v31733; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v21734; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1735; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11736; GFX12-SDAG-FAKE16-NEXT:    v_lshrrev_b32_e32 v1, 16, v01737; GFX12-SDAG-FAKE16-NEXT:    s_delay_alu instid0(VALU_DEP_1)1738; GFX12-SDAG-FAKE16-NEXT:    v_and_b32_e32 v0, v0, v11739; GFX12-SDAG-FAKE16-NEXT:    s_setpc_b64 s[30:31]1740;1741; GFX12-GISEL-LABEL: test_vector_reduce_and_v16i16:1742; GFX12-GISEL:       ; %bb.0: ; %entry1743; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x01744; GFX12-GISEL-NEXT:    s_wait_expcnt 0x01745; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x01746; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x01747; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x01748; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41749; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51750; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61751; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71752; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1753; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21754; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31755; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1756; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11757; GFX12-GISEL-NEXT:    v_lshrrev_b32_e32 v1, 16, v01758; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1759; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11760; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]1761entry:1762  %res = call i16 @llvm.vector.reduce.and.v16i16(<16 x i16> %v)1763  ret i16 %res1764}1765 1766 1767define i32 @test_vector_reduce_and_v2i32(<2 x i32> %v) {1768; GFX7-LABEL: test_vector_reduce_and_v2i32:1769; GFX7:       ; %bb.0: ; %entry1770; GFX7-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1771; GFX7-NEXT:    v_and_b32_e32 v0, v0, v11772; GFX7-NEXT:    s_setpc_b64 s[30:31]1773;1774; GFX8-LABEL: test_vector_reduce_and_v2i32:1775; GFX8:       ; %bb.0: ; %entry1776; GFX8-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1777; GFX8-NEXT:    v_and_b32_e32 v0, v0, v11778; GFX8-NEXT:    s_setpc_b64 s[30:31]1779;1780; GFX9-LABEL: test_vector_reduce_and_v2i32:1781; GFX9:       ; %bb.0: ; %entry1782; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1783; GFX9-NEXT:    v_and_b32_e32 v0, v0, v11784; GFX9-NEXT:    s_setpc_b64 s[30:31]1785;1786; GFX10-LABEL: test_vector_reduce_and_v2i32:1787; GFX10:       ; %bb.0: ; %entry1788; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1789; GFX10-NEXT:    v_and_b32_e32 v0, v0, v11790; GFX10-NEXT:    s_setpc_b64 s[30:31]1791;1792; GFX11-LABEL: test_vector_reduce_and_v2i32:1793; GFX11:       ; %bb.0: ; %entry1794; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1795; GFX11-NEXT:    v_and_b32_e32 v0, v0, v11796; GFX11-NEXT:    s_setpc_b64 s[30:31]1797;1798; GFX12-LABEL: test_vector_reduce_and_v2i32:1799; GFX12:       ; %bb.0: ; %entry1800; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x01801; GFX12-NEXT:    s_wait_expcnt 0x01802; GFX12-NEXT:    s_wait_samplecnt 0x01803; GFX12-NEXT:    s_wait_bvhcnt 0x01804; GFX12-NEXT:    s_wait_kmcnt 0x01805; GFX12-NEXT:    v_and_b32_e32 v0, v0, v11806; GFX12-NEXT:    s_setpc_b64 s[30:31]1807entry:1808  %res = call i32 @llvm.vector.reduce.and.v2i32(<2 x i32> %v)1809  ret i32 %res1810}1811 1812define i32 @test_vector_reduce_and_v3i32(<3 x i32> %v) {1813; GFX7-LABEL: test_vector_reduce_and_v3i32:1814; GFX7:       ; %bb.0: ; %entry1815; GFX7-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1816; GFX7-NEXT:    v_and_b32_e32 v0, v0, v11817; GFX7-NEXT:    v_and_b32_e32 v0, v0, v21818; GFX7-NEXT:    s_setpc_b64 s[30:31]1819;1820; GFX8-LABEL: test_vector_reduce_and_v3i32:1821; GFX8:       ; %bb.0: ; %entry1822; GFX8-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1823; GFX8-NEXT:    v_and_b32_e32 v0, v0, v11824; GFX8-NEXT:    v_and_b32_e32 v0, v0, v21825; GFX8-NEXT:    s_setpc_b64 s[30:31]1826;1827; GFX9-LABEL: test_vector_reduce_and_v3i32:1828; GFX9:       ; %bb.0: ; %entry1829; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1830; GFX9-NEXT:    v_and_b32_e32 v0, v0, v11831; GFX9-NEXT:    v_and_b32_e32 v0, v0, v21832; GFX9-NEXT:    s_setpc_b64 s[30:31]1833;1834; GFX10-LABEL: test_vector_reduce_and_v3i32:1835; GFX10:       ; %bb.0: ; %entry1836; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1837; GFX10-NEXT:    v_and_b32_e32 v0, v0, v11838; GFX10-NEXT:    v_and_b32_e32 v0, v0, v21839; GFX10-NEXT:    s_setpc_b64 s[30:31]1840;1841; GFX11-LABEL: test_vector_reduce_and_v3i32:1842; GFX11:       ; %bb.0: ; %entry1843; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1844; GFX11-NEXT:    v_and_b32_e32 v0, v0, v11845; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)1846; GFX11-NEXT:    v_and_b32_e32 v0, v0, v21847; GFX11-NEXT:    s_setpc_b64 s[30:31]1848;1849; GFX12-LABEL: test_vector_reduce_and_v3i32:1850; GFX12:       ; %bb.0: ; %entry1851; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x01852; GFX12-NEXT:    s_wait_expcnt 0x01853; GFX12-NEXT:    s_wait_samplecnt 0x01854; GFX12-NEXT:    s_wait_bvhcnt 0x01855; GFX12-NEXT:    s_wait_kmcnt 0x01856; GFX12-NEXT:    v_and_b32_e32 v0, v0, v11857; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_1)1858; GFX12-NEXT:    v_and_b32_e32 v0, v0, v21859; GFX12-NEXT:    s_setpc_b64 s[30:31]1860entry:1861  %res = call i32 @llvm.vector.reduce.and.v3i32(<3 x i32> %v)1862  ret i32 %res1863}1864 1865define i32 @test_vector_reduce_and_v4i32(<4 x i32> %v) {1866; GFX7-SDAG-LABEL: test_vector_reduce_and_v4i32:1867; GFX7-SDAG:       ; %bb.0: ; %entry1868; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1869; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31870; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21871; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11872; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]1873;1874; GFX7-GISEL-LABEL: test_vector_reduce_and_v4i32:1875; GFX7-GISEL:       ; %bb.0: ; %entry1876; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1877; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21878; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31879; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11880; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]1881;1882; GFX8-SDAG-LABEL: test_vector_reduce_and_v4i32:1883; GFX8-SDAG:       ; %bb.0: ; %entry1884; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1885; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31886; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21887; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11888; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]1889;1890; GFX8-GISEL-LABEL: test_vector_reduce_and_v4i32:1891; GFX8-GISEL:       ; %bb.0: ; %entry1892; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1893; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21894; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31895; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11896; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]1897;1898; GFX9-SDAG-LABEL: test_vector_reduce_and_v4i32:1899; GFX9-SDAG:       ; %bb.0: ; %entry1900; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1901; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31902; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21903; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11904; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]1905;1906; GFX9-GISEL-LABEL: test_vector_reduce_and_v4i32:1907; GFX9-GISEL:       ; %bb.0: ; %entry1908; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1909; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21910; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31911; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11912; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]1913;1914; GFX10-SDAG-LABEL: test_vector_reduce_and_v4i32:1915; GFX10-SDAG:       ; %bb.0: ; %entry1916; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1917; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31918; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21919; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11920; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]1921;1922; GFX10-GISEL-LABEL: test_vector_reduce_and_v4i32:1923; GFX10-GISEL:       ; %bb.0: ; %entry1924; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1925; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21926; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31927; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11928; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]1929;1930; GFX11-SDAG-LABEL: test_vector_reduce_and_v4i32:1931; GFX11-SDAG:       ; %bb.0: ; %entry1932; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1933; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31934; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21935; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1)1936; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11937; GFX11-SDAG-NEXT:    s_setpc_b64 s[30:31]1938;1939; GFX11-GISEL-LABEL: test_vector_reduce_and_v4i32:1940; GFX11-GISEL:       ; %bb.0: ; %entry1941; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1942; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21943; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31944; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1945; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11946; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]1947;1948; GFX12-SDAG-LABEL: test_vector_reduce_and_v4i32:1949; GFX12-SDAG:       ; %bb.0: ; %entry1950; GFX12-SDAG-NEXT:    s_wait_loadcnt_dscnt 0x01951; GFX12-SDAG-NEXT:    s_wait_expcnt 0x01952; GFX12-SDAG-NEXT:    s_wait_samplecnt 0x01953; GFX12-SDAG-NEXT:    s_wait_bvhcnt 0x01954; GFX12-SDAG-NEXT:    s_wait_kmcnt 0x01955; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31956; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21957; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1)1958; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11959; GFX12-SDAG-NEXT:    s_setpc_b64 s[30:31]1960;1961; GFX12-GISEL-LABEL: test_vector_reduce_and_v4i32:1962; GFX12-GISEL:       ; %bb.0: ; %entry1963; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x01964; GFX12-GISEL-NEXT:    s_wait_expcnt 0x01965; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x01966; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x01967; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x01968; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21969; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v31970; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)1971; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v11972; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]1973entry:1974  %res = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> %v)1975  ret i32 %res1976}1977 1978define i32 @test_vector_reduce_and_v8i32(<8 x i32> %v) {1979; GFX7-SDAG-LABEL: test_vector_reduce_and_v8i32:1980; GFX7-SDAG:       ; %bb.0: ; %entry1981; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1982; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v61983; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v41984; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v71985; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v51986; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v31987; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v21988; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v11989; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]1990;1991; GFX7-GISEL-LABEL: test_vector_reduce_and_v8i32:1992; GFX7-GISEL:       ; %bb.0: ; %entry1993; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1994; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v41995; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v51996; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v61997; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v71998; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v21999; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32000; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12001; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]2002;2003; GFX8-SDAG-LABEL: test_vector_reduce_and_v8i32:2004; GFX8-SDAG:       ; %bb.0: ; %entry2005; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2006; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62007; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42008; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72009; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52010; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32011; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22012; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12013; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]2014;2015; GFX8-GISEL-LABEL: test_vector_reduce_and_v8i32:2016; GFX8-GISEL:       ; %bb.0: ; %entry2017; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2018; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42019; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52020; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62021; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72022; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22023; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32024; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12025; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]2026;2027; GFX9-SDAG-LABEL: test_vector_reduce_and_v8i32:2028; GFX9-SDAG:       ; %bb.0: ; %entry2029; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2030; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62031; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42032; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72033; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52034; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32035; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22036; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12037; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]2038;2039; GFX9-GISEL-LABEL: test_vector_reduce_and_v8i32:2040; GFX9-GISEL:       ; %bb.0: ; %entry2041; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2042; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42043; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52044; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62045; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72046; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22047; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32048; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12049; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]2050;2051; GFX10-SDAG-LABEL: test_vector_reduce_and_v8i32:2052; GFX10-SDAG:       ; %bb.0: ; %entry2053; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2054; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62055; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72056; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52057; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42058; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32059; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22060; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12061; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]2062;2063; GFX10-GISEL-LABEL: test_vector_reduce_and_v8i32:2064; GFX10-GISEL:       ; %bb.0: ; %entry2065; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2066; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42067; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52068; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62069; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72070; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22071; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32072; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12073; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]2074;2075; GFX11-SDAG-LABEL: test_vector_reduce_and_v8i32:2076; GFX11-SDAG:       ; %bb.0: ; %entry2077; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2078; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62079; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72080; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52081; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42082; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2083; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32084; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22085; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1)2086; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12087; GFX11-SDAG-NEXT:    s_setpc_b64 s[30:31]2088;2089; GFX11-GISEL-LABEL: test_vector_reduce_and_v8i32:2090; GFX11-GISEL:       ; %bb.0: ; %entry2091; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2092; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42093; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52094; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62095; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72096; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2097; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22098; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32099; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)2100; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12101; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]2102;2103; GFX12-SDAG-LABEL: test_vector_reduce_and_v8i32:2104; GFX12-SDAG:       ; %bb.0: ; %entry2105; GFX12-SDAG-NEXT:    s_wait_loadcnt_dscnt 0x02106; GFX12-SDAG-NEXT:    s_wait_expcnt 0x02107; GFX12-SDAG-NEXT:    s_wait_samplecnt 0x02108; GFX12-SDAG-NEXT:    s_wait_bvhcnt 0x02109; GFX12-SDAG-NEXT:    s_wait_kmcnt 0x02110; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62111; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72112; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52113; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42114; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2115; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32116; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22117; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1)2118; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12119; GFX12-SDAG-NEXT:    s_setpc_b64 s[30:31]2120;2121; GFX12-GISEL-LABEL: test_vector_reduce_and_v8i32:2122; GFX12-GISEL:       ; %bb.0: ; %entry2123; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x02124; GFX12-GISEL-NEXT:    s_wait_expcnt 0x02125; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x02126; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x02127; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x02128; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42129; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52130; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62131; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72132; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2133; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22134; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32135; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)2136; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12137; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]2138entry:2139  %res = call i32 @llvm.vector.reduce.and.v8i32(<8 x i32> %v)2140  ret i32 %res2141}2142 2143define i32 @test_vector_reduce_and_v16i32(<16 x i32> %v) {2144; GFX7-SDAG-LABEL: test_vector_reduce_and_v16i32:2145; GFX7-SDAG:       ; %bb.0: ; %entry2146; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2147; GFX7-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132148; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92149; GFX7-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152150; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112151; GFX7-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122152; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82153; GFX7-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142154; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102155; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62156; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42157; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72158; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52159; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32160; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22161; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12162; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]2163;2164; GFX7-GISEL-LABEL: test_vector_reduce_and_v16i32:2165; GFX7-GISEL:       ; %bb.0: ; %entry2166; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2167; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82168; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92169; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102170; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112171; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122172; GFX7-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132173; GFX7-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142174; GFX7-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152175; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42176; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52177; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62178; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72179; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22180; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32181; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12182; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]2183;2184; GFX8-SDAG-LABEL: test_vector_reduce_and_v16i32:2185; GFX8-SDAG:       ; %bb.0: ; %entry2186; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2187; GFX8-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132188; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92189; GFX8-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152190; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112191; GFX8-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122192; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82193; GFX8-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142194; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102195; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62196; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42197; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72198; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52199; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32200; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22201; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12202; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]2203;2204; GFX8-GISEL-LABEL: test_vector_reduce_and_v16i32:2205; GFX8-GISEL:       ; %bb.0: ; %entry2206; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2207; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82208; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92209; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102210; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112211; GFX8-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122212; GFX8-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132213; GFX8-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142214; GFX8-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152215; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42216; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52217; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62218; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72219; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22220; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32221; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12222; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]2223;2224; GFX9-SDAG-LABEL: test_vector_reduce_and_v16i32:2225; GFX9-SDAG:       ; %bb.0: ; %entry2226; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2227; GFX9-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132228; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92229; GFX9-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152230; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112231; GFX9-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122232; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82233; GFX9-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142234; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102235; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62236; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42237; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72238; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52239; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32240; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22241; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12242; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]2243;2244; GFX9-GISEL-LABEL: test_vector_reduce_and_v16i32:2245; GFX9-GISEL:       ; %bb.0: ; %entry2246; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2247; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82248; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92249; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102250; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112251; GFX9-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122252; GFX9-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132253; GFX9-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142254; GFX9-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152255; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42256; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52257; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62258; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72259; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22260; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32261; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12262; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]2263;2264; GFX10-SDAG-LABEL: test_vector_reduce_and_v16i32:2265; GFX10-SDAG:       ; %bb.0: ; %entry2266; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2267; GFX10-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132268; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92269; GFX10-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152270; GFX10-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142271; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102272; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112273; GFX10-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122274; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82275; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52276; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62277; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72278; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42279; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32280; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22281; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12282; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]2283;2284; GFX10-GISEL-LABEL: test_vector_reduce_and_v16i32:2285; GFX10-GISEL:       ; %bb.0: ; %entry2286; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2287; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82288; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92289; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102290; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112291; GFX10-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122292; GFX10-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132293; GFX10-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142294; GFX10-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152295; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42296; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52297; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62298; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72299; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22300; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32301; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12302; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]2303;2304; GFX11-SDAG-LABEL: test_vector_reduce_and_v16i32:2305; GFX11-SDAG:       ; %bb.0: ; %entry2306; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2307; GFX11-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132308; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92309; GFX11-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152310; GFX11-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142311; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102312; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112313; GFX11-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122314; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82315; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52316; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62317; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72318; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)2319; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42320; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32321; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)2322; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22323; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12324; GFX11-SDAG-NEXT:    s_setpc_b64 s[30:31]2325;2326; GFX11-GISEL-LABEL: test_vector_reduce_and_v16i32:2327; GFX11-GISEL:       ; %bb.0: ; %entry2328; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2329; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82330; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92331; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102332; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112333; GFX11-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122334; GFX11-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132335; GFX11-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142336; GFX11-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152337; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2338; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42339; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52340; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2341; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62342; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72343; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2344; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22345; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32346; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)2347; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12348; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]2349;2350; GFX12-SDAG-LABEL: test_vector_reduce_and_v16i32:2351; GFX12-SDAG:       ; %bb.0: ; %entry2352; GFX12-SDAG-NEXT:    s_wait_loadcnt_dscnt 0x02353; GFX12-SDAG-NEXT:    s_wait_expcnt 0x02354; GFX12-SDAG-NEXT:    s_wait_samplecnt 0x02355; GFX12-SDAG-NEXT:    s_wait_bvhcnt 0x02356; GFX12-SDAG-NEXT:    s_wait_kmcnt 0x02357; GFX12-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132358; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92359; GFX12-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152360; GFX12-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142361; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102362; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112363; GFX12-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122364; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82365; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52366; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62367; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72368; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)2369; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42370; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32371; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)2372; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22373; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v12374; GFX12-SDAG-NEXT:    s_setpc_b64 s[30:31]2375;2376; GFX12-GISEL-LABEL: test_vector_reduce_and_v16i32:2377; GFX12-GISEL:       ; %bb.0: ; %entry2378; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x02379; GFX12-GISEL-NEXT:    s_wait_expcnt 0x02380; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x02381; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x02382; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x02383; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82384; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92385; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102386; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112387; GFX12-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122388; GFX12-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132389; GFX12-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142390; GFX12-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152391; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2392; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42393; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52394; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2395; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62396; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72397; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2398; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22399; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32400; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)2401; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v12402; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]2403entry:2404  %res = call i32 @llvm.vector.reduce.and.v16i32(<16 x i32> %v)2405  ret i32 %res2406}2407 2408define i64 @test_vector_reduce_and_v2i64(<2 x i64> %v) {2409; GFX7-SDAG-LABEL: test_vector_reduce_and_v2i64:2410; GFX7-SDAG:       ; %bb.0: ; %entry2411; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2412; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32413; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22414; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]2415;2416; GFX7-GISEL-LABEL: test_vector_reduce_and_v2i64:2417; GFX7-GISEL:       ; %bb.0: ; %entry2418; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2419; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22420; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32421; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]2422;2423; GFX8-SDAG-LABEL: test_vector_reduce_and_v2i64:2424; GFX8-SDAG:       ; %bb.0: ; %entry2425; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2426; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32427; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22428; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]2429;2430; GFX8-GISEL-LABEL: test_vector_reduce_and_v2i64:2431; GFX8-GISEL:       ; %bb.0: ; %entry2432; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2433; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22434; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32435; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]2436;2437; GFX9-SDAG-LABEL: test_vector_reduce_and_v2i64:2438; GFX9-SDAG:       ; %bb.0: ; %entry2439; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2440; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32441; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22442; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]2443;2444; GFX9-GISEL-LABEL: test_vector_reduce_and_v2i64:2445; GFX9-GISEL:       ; %bb.0: ; %entry2446; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2447; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22448; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32449; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]2450;2451; GFX10-LABEL: test_vector_reduce_and_v2i64:2452; GFX10:       ; %bb.0: ; %entry2453; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2454; GFX10-NEXT:    v_and_b32_e32 v0, v0, v22455; GFX10-NEXT:    v_and_b32_e32 v1, v1, v32456; GFX10-NEXT:    s_setpc_b64 s[30:31]2457;2458; GFX11-LABEL: test_vector_reduce_and_v2i64:2459; GFX11:       ; %bb.0: ; %entry2460; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2461; GFX11-NEXT:    v_and_b32_e32 v0, v0, v22462; GFX11-NEXT:    v_and_b32_e32 v1, v1, v32463; GFX11-NEXT:    s_setpc_b64 s[30:31]2464;2465; GFX12-LABEL: test_vector_reduce_and_v2i64:2466; GFX12:       ; %bb.0: ; %entry2467; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02468; GFX12-NEXT:    s_wait_expcnt 0x02469; GFX12-NEXT:    s_wait_samplecnt 0x02470; GFX12-NEXT:    s_wait_bvhcnt 0x02471; GFX12-NEXT:    s_wait_kmcnt 0x02472; GFX12-NEXT:    v_and_b32_e32 v0, v0, v22473; GFX12-NEXT:    v_and_b32_e32 v1, v1, v32474; GFX12-NEXT:    s_setpc_b64 s[30:31]2475entry:2476  %res = call i64 @llvm.vector.reduce.and.v2i64(<2 x i64> %v)2477  ret i64 %res2478}2479 2480define i64 @test_vector_reduce_and_v3i64(<3 x i64> %v) {2481; GFX7-SDAG-LABEL: test_vector_reduce_and_v3i64:2482; GFX7-SDAG:       ; %bb.0: ; %entry2483; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2484; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32485; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22486; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52487; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42488; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]2489;2490; GFX7-GISEL-LABEL: test_vector_reduce_and_v3i64:2491; GFX7-GISEL:       ; %bb.0: ; %entry2492; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2493; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22494; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32495; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42496; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52497; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]2498;2499; GFX8-SDAG-LABEL: test_vector_reduce_and_v3i64:2500; GFX8-SDAG:       ; %bb.0: ; %entry2501; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2502; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32503; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22504; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52505; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42506; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]2507;2508; GFX8-GISEL-LABEL: test_vector_reduce_and_v3i64:2509; GFX8-GISEL:       ; %bb.0: ; %entry2510; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2511; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22512; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32513; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42514; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52515; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]2516;2517; GFX9-SDAG-LABEL: test_vector_reduce_and_v3i64:2518; GFX9-SDAG:       ; %bb.0: ; %entry2519; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2520; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32521; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22522; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52523; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42524; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]2525;2526; GFX9-GISEL-LABEL: test_vector_reduce_and_v3i64:2527; GFX9-GISEL:       ; %bb.0: ; %entry2528; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2529; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22530; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32531; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42532; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52533; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]2534;2535; GFX10-LABEL: test_vector_reduce_and_v3i64:2536; GFX10:       ; %bb.0: ; %entry2537; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2538; GFX10-NEXT:    v_and_b32_e32 v0, v0, v22539; GFX10-NEXT:    v_and_b32_e32 v1, v1, v32540; GFX10-NEXT:    v_and_b32_e32 v0, v0, v42541; GFX10-NEXT:    v_and_b32_e32 v1, v1, v52542; GFX10-NEXT:    s_setpc_b64 s[30:31]2543;2544; GFX11-LABEL: test_vector_reduce_and_v3i64:2545; GFX11:       ; %bb.0: ; %entry2546; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2547; GFX11-NEXT:    v_and_b32_e32 v0, v0, v22548; GFX11-NEXT:    v_and_b32_e32 v1, v1, v32549; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2550; GFX11-NEXT:    v_and_b32_e32 v0, v0, v42551; GFX11-NEXT:    v_and_b32_e32 v1, v1, v52552; GFX11-NEXT:    s_setpc_b64 s[30:31]2553;2554; GFX12-LABEL: test_vector_reduce_and_v3i64:2555; GFX12:       ; %bb.0: ; %entry2556; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02557; GFX12-NEXT:    s_wait_expcnt 0x02558; GFX12-NEXT:    s_wait_samplecnt 0x02559; GFX12-NEXT:    s_wait_bvhcnt 0x02560; GFX12-NEXT:    s_wait_kmcnt 0x02561; GFX12-NEXT:    v_and_b32_e32 v0, v0, v22562; GFX12-NEXT:    v_and_b32_e32 v1, v1, v32563; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2564; GFX12-NEXT:    v_and_b32_e32 v0, v0, v42565; GFX12-NEXT:    v_and_b32_e32 v1, v1, v52566; GFX12-NEXT:    s_setpc_b64 s[30:31]2567entry:2568  %res = call i64 @llvm.vector.reduce.and.v3i64(<3 x i64> %v)2569  ret i64 %res2570}2571 2572define i64 @test_vector_reduce_and_v4i64(<4 x i64> %v) {2573; GFX7-SDAG-LABEL: test_vector_reduce_and_v4i64:2574; GFX7-SDAG:       ; %bb.0: ; %entry2575; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2576; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52577; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42578; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72579; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62580; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32581; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22582; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]2583;2584; GFX7-GISEL-LABEL: test_vector_reduce_and_v4i64:2585; GFX7-GISEL:       ; %bb.0: ; %entry2586; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2587; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42588; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52589; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62590; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72591; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22592; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32593; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]2594;2595; GFX8-SDAG-LABEL: test_vector_reduce_and_v4i64:2596; GFX8-SDAG:       ; %bb.0: ; %entry2597; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2598; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52599; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42600; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72601; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62602; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32603; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22604; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]2605;2606; GFX8-GISEL-LABEL: test_vector_reduce_and_v4i64:2607; GFX8-GISEL:       ; %bb.0: ; %entry2608; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2609; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42610; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52611; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62612; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72613; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22614; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32615; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]2616;2617; GFX9-SDAG-LABEL: test_vector_reduce_and_v4i64:2618; GFX9-SDAG:       ; %bb.0: ; %entry2619; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2620; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52621; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42622; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72623; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62624; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32625; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22626; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]2627;2628; GFX9-GISEL-LABEL: test_vector_reduce_and_v4i64:2629; GFX9-GISEL:       ; %bb.0: ; %entry2630; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2631; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42632; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52633; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62634; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72635; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22636; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32637; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]2638;2639; GFX10-SDAG-LABEL: test_vector_reduce_and_v4i64:2640; GFX10-SDAG:       ; %bb.0: ; %entry2641; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2642; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52643; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42644; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62645; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72646; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22647; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32648; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]2649;2650; GFX10-GISEL-LABEL: test_vector_reduce_and_v4i64:2651; GFX10-GISEL:       ; %bb.0: ; %entry2652; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2653; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42654; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52655; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62656; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72657; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22658; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32659; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]2660;2661; GFX11-SDAG-LABEL: test_vector_reduce_and_v4i64:2662; GFX11-SDAG:       ; %bb.0: ; %entry2663; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2664; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52665; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42666; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62667; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72668; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2669; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22670; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32671; GFX11-SDAG-NEXT:    s_setpc_b64 s[30:31]2672;2673; GFX11-GISEL-LABEL: test_vector_reduce_and_v4i64:2674; GFX11-GISEL:       ; %bb.0: ; %entry2675; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2676; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42677; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52678; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62679; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72680; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2681; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22682; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32683; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]2684;2685; GFX12-SDAG-LABEL: test_vector_reduce_and_v4i64:2686; GFX12-SDAG:       ; %bb.0: ; %entry2687; GFX12-SDAG-NEXT:    s_wait_loadcnt_dscnt 0x02688; GFX12-SDAG-NEXT:    s_wait_expcnt 0x02689; GFX12-SDAG-NEXT:    s_wait_samplecnt 0x02690; GFX12-SDAG-NEXT:    s_wait_bvhcnt 0x02691; GFX12-SDAG-NEXT:    s_wait_kmcnt 0x02692; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52693; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42694; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62695; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72696; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2697; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22698; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32699; GFX12-SDAG-NEXT:    s_setpc_b64 s[30:31]2700;2701; GFX12-GISEL-LABEL: test_vector_reduce_and_v4i64:2702; GFX12-GISEL:       ; %bb.0: ; %entry2703; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x02704; GFX12-GISEL-NEXT:    s_wait_expcnt 0x02705; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x02706; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x02707; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x02708; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42709; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52710; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62711; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72712; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2713; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22714; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32715; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]2716entry:2717  %res = call i64 @llvm.vector.reduce.and.v4i64(<4 x i64> %v)2718  ret i64 %res2719}2720 2721define i64 @test_vector_reduce_and_v8i64(<8 x i64> %v) {2722; GFX7-SDAG-LABEL: test_vector_reduce_and_v8i64:2723; GFX7-SDAG:       ; %bb.0: ; %entry2724; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2725; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112726; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102727; GFX7-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152728; GFX7-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142729; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92730; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82731; GFX7-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132732; GFX7-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122733; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52734; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42735; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72736; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62737; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32738; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22739; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]2740;2741; GFX7-GISEL-LABEL: test_vector_reduce_and_v8i64:2742; GFX7-GISEL:       ; %bb.0: ; %entry2743; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2744; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82745; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92746; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102747; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112748; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122749; GFX7-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132750; GFX7-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142751; GFX7-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152752; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42753; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52754; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62755; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72756; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22757; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32758; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]2759;2760; GFX8-SDAG-LABEL: test_vector_reduce_and_v8i64:2761; GFX8-SDAG:       ; %bb.0: ; %entry2762; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2763; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112764; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102765; GFX8-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152766; GFX8-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142767; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92768; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82769; GFX8-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132770; GFX8-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122771; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52772; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42773; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72774; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62775; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32776; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22777; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]2778;2779; GFX8-GISEL-LABEL: test_vector_reduce_and_v8i64:2780; GFX8-GISEL:       ; %bb.0: ; %entry2781; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2782; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82783; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92784; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102785; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112786; GFX8-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122787; GFX8-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132788; GFX8-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142789; GFX8-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152790; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42791; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52792; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62793; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72794; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22795; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32796; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]2797;2798; GFX9-SDAG-LABEL: test_vector_reduce_and_v8i64:2799; GFX9-SDAG:       ; %bb.0: ; %entry2800; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2801; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112802; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102803; GFX9-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152804; GFX9-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142805; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92806; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82807; GFX9-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132808; GFX9-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122809; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52810; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42811; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72812; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62813; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32814; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22815; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]2816;2817; GFX9-GISEL-LABEL: test_vector_reduce_and_v8i64:2818; GFX9-GISEL:       ; %bb.0: ; %entry2819; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2820; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82821; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92822; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102823; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112824; GFX9-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122825; GFX9-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132826; GFX9-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142827; GFX9-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152828; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42829; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52830; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62831; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72832; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22833; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32834; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]2835;2836; GFX10-SDAG-LABEL: test_vector_reduce_and_v8i64:2837; GFX10-SDAG:       ; %bb.0: ; %entry2838; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2839; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112840; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102841; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92842; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82843; GFX10-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132844; GFX10-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122845; GFX10-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142846; GFX10-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152847; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52848; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42849; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62850; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72851; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22852; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32853; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]2854;2855; GFX10-GISEL-LABEL: test_vector_reduce_and_v8i64:2856; GFX10-GISEL:       ; %bb.0: ; %entry2857; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2858; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82859; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92860; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102861; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112862; GFX10-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122863; GFX10-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132864; GFX10-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142865; GFX10-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152866; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42867; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52868; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62869; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72870; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22871; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32872; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]2873;2874; GFX11-SDAG-LABEL: test_vector_reduce_and_v8i64:2875; GFX11-SDAG:       ; %bb.0: ; %entry2876; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2877; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112878; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102879; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92880; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82881; GFX11-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132882; GFX11-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122883; GFX11-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142884; GFX11-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152885; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2886; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52887; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42888; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2889; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62890; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72891; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2892; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22893; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32894; GFX11-SDAG-NEXT:    s_setpc_b64 s[30:31]2895;2896; GFX11-GISEL-LABEL: test_vector_reduce_and_v8i64:2897; GFX11-GISEL:       ; %bb.0: ; %entry2898; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2899; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82900; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92901; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102902; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112903; GFX11-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122904; GFX11-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132905; GFX11-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142906; GFX11-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152907; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2908; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42909; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52910; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2911; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62912; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72913; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2914; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22915; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32916; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]2917;2918; GFX12-SDAG-LABEL: test_vector_reduce_and_v8i64:2919; GFX12-SDAG:       ; %bb.0: ; %entry2920; GFX12-SDAG-NEXT:    s_wait_loadcnt_dscnt 0x02921; GFX12-SDAG-NEXT:    s_wait_expcnt 0x02922; GFX12-SDAG-NEXT:    s_wait_samplecnt 0x02923; GFX12-SDAG-NEXT:    s_wait_bvhcnt 0x02924; GFX12-SDAG-NEXT:    s_wait_kmcnt 0x02925; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v112926; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102927; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v92928; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82929; GFX12-SDAG-NEXT:    v_and_b32_e32 v5, v5, v132930; GFX12-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122931; GFX12-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142932; GFX12-SDAG-NEXT:    v_and_b32_e32 v7, v7, v152933; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2934; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v52935; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42936; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2937; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62938; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v72939; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2940; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v22941; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v32942; GFX12-SDAG-NEXT:    s_setpc_b64 s[30:31]2943;2944; GFX12-GISEL-LABEL: test_vector_reduce_and_v8i64:2945; GFX12-GISEL:       ; %bb.0: ; %entry2946; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x02947; GFX12-GISEL-NEXT:    s_wait_expcnt 0x02948; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x02949; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x02950; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x02951; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v82952; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v92953; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v102954; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v112955; GFX12-GISEL-NEXT:    v_and_b32_e32 v4, v4, v122956; GFX12-GISEL-NEXT:    v_and_b32_e32 v5, v5, v132957; GFX12-GISEL-NEXT:    v_and_b32_e32 v6, v6, v142958; GFX12-GISEL-NEXT:    v_and_b32_e32 v7, v7, v152959; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2960; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v42961; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v52962; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)2963; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v62964; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v72965; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)2966; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v22967; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v32968; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]2969entry:2970  %res = call i64 @llvm.vector.reduce.and.v8i64(<8 x i64> %v)2971  ret i64 %res2972}2973 2974define i64 @test_vector_reduce_and_v16i64(<16 x i64> %v) {2975; GFX7-SDAG-LABEL: test_vector_reduce_and_v16i64:2976; GFX7-SDAG:       ; %bb.0: ; %entry2977; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2978; GFX7-SDAG-NEXT:    v_and_b32_e32 v4, v4, v202979; GFX7-SDAG-NEXT:    buffer_load_dword v20, off, s[0:3], s322980; GFX7-SDAG-NEXT:    v_and_b32_e32 v12, v12, v282981; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v162982; GFX7-SDAG-NEXT:    v_and_b32_e32 v8, v8, v242983; GFX7-SDAG-NEXT:    v_and_b32_e32 v6, v6, v222984; GFX7-SDAG-NEXT:    v_and_b32_e32 v14, v14, v302985; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v182986; GFX7-SDAG-NEXT:    v_and_b32_e32 v10, v10, v262987; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v102988; GFX7-SDAG-NEXT:    v_and_b32_e32 v6, v6, v142989; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v82990; GFX7-SDAG-NEXT:    v_and_b32_e32 v4, v4, v122991; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v42992; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v2, v62993; GFX7-SDAG-NEXT:    v_and_b32_e32 v5, v5, v212994; GFX7-SDAG-NEXT:    v_and_b32_e32 v13, v13, v292995; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v172996; GFX7-SDAG-NEXT:    v_and_b32_e32 v9, v9, v252997; GFX7-SDAG-NEXT:    v_and_b32_e32 v7, v7, v232998; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v192999; GFX7-SDAG-NEXT:    v_and_b32_e32 v11, v11, v273000; GFX7-SDAG-NEXT:    v_and_b32_e32 v0, v0, v23001; GFX7-SDAG-NEXT:    v_and_b32_e32 v3, v3, v113002; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v93003; GFX7-SDAG-NEXT:    v_and_b32_e32 v5, v5, v133004; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v53005; GFX7-SDAG-NEXT:    s_waitcnt vmcnt(0)3006; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v15, v203007; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v7, v23008; GFX7-SDAG-NEXT:    v_and_b32_e32 v2, v3, v23009; GFX7-SDAG-NEXT:    v_and_b32_e32 v1, v1, v23010; GFX7-SDAG-NEXT:    s_setpc_b64 s[30:31]3011;3012; GFX7-GISEL-LABEL: test_vector_reduce_and_v16i64:3013; GFX7-GISEL:       ; %bb.0: ; %entry3014; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3015; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v163016; GFX7-GISEL-NEXT:    buffer_load_dword v16, off, s[0:3], s323017; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v183018; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, v4, v203019; GFX7-GISEL-NEXT:    v_and_b32_e32 v6, v6, v223020; GFX7-GISEL-NEXT:    v_and_b32_e32 v8, v8, v243021; GFX7-GISEL-NEXT:    v_and_b32_e32 v10, v10, v263022; GFX7-GISEL-NEXT:    v_and_b32_e32 v12, v12, v283023; GFX7-GISEL-NEXT:    v_and_b32_e32 v14, v14, v303024; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v83025; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v103026; GFX7-GISEL-NEXT:    v_and_b32_e32 v4, v4, v123027; GFX7-GISEL-NEXT:    v_and_b32_e32 v6, v6, v143028; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v43029; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v2, v63030; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v173031; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v193032; GFX7-GISEL-NEXT:    v_and_b32_e32 v5, v5, v213033; GFX7-GISEL-NEXT:    v_and_b32_e32 v7, v7, v233034; GFX7-GISEL-NEXT:    v_and_b32_e32 v9, v9, v253035; GFX7-GISEL-NEXT:    v_and_b32_e32 v11, v11, v273036; GFX7-GISEL-NEXT:    v_and_b32_e32 v13, v13, v293037; GFX7-GISEL-NEXT:    v_and_b32_e32 v0, v0, v23038; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v93039; GFX7-GISEL-NEXT:    v_and_b32_e32 v3, v3, v113040; GFX7-GISEL-NEXT:    v_and_b32_e32 v5, v5, v133041; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v53042; GFX7-GISEL-NEXT:    s_waitcnt vmcnt(0)3043; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v15, v163044; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v7, v23045; GFX7-GISEL-NEXT:    v_and_b32_e32 v2, v3, v23046; GFX7-GISEL-NEXT:    v_and_b32_e32 v1, v1, v23047; GFX7-GISEL-NEXT:    s_setpc_b64 s[30:31]3048;3049; GFX8-SDAG-LABEL: test_vector_reduce_and_v16i64:3050; GFX8-SDAG:       ; %bb.0: ; %entry3051; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3052; GFX8-SDAG-NEXT:    v_and_b32_e32 v4, v4, v203053; GFX8-SDAG-NEXT:    buffer_load_dword v20, off, s[0:3], s323054; GFX8-SDAG-NEXT:    v_and_b32_e32 v12, v12, v283055; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v163056; GFX8-SDAG-NEXT:    v_and_b32_e32 v8, v8, v243057; GFX8-SDAG-NEXT:    v_and_b32_e32 v6, v6, v223058; GFX8-SDAG-NEXT:    v_and_b32_e32 v14, v14, v303059; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v183060; GFX8-SDAG-NEXT:    v_and_b32_e32 v10, v10, v263061; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v103062; GFX8-SDAG-NEXT:    v_and_b32_e32 v6, v6, v143063; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v83064; GFX8-SDAG-NEXT:    v_and_b32_e32 v4, v4, v123065; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v43066; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v2, v63067; GFX8-SDAG-NEXT:    v_and_b32_e32 v5, v5, v213068; GFX8-SDAG-NEXT:    v_and_b32_e32 v13, v13, v293069; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v173070; GFX8-SDAG-NEXT:    v_and_b32_e32 v9, v9, v253071; GFX8-SDAG-NEXT:    v_and_b32_e32 v7, v7, v233072; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v193073; GFX8-SDAG-NEXT:    v_and_b32_e32 v11, v11, v273074; GFX8-SDAG-NEXT:    v_and_b32_e32 v0, v0, v23075; GFX8-SDAG-NEXT:    v_and_b32_e32 v3, v3, v113076; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v93077; GFX8-SDAG-NEXT:    v_and_b32_e32 v5, v5, v133078; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v53079; GFX8-SDAG-NEXT:    s_waitcnt vmcnt(0)3080; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v15, v203081; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v7, v23082; GFX8-SDAG-NEXT:    v_and_b32_e32 v2, v3, v23083; GFX8-SDAG-NEXT:    v_and_b32_e32 v1, v1, v23084; GFX8-SDAG-NEXT:    s_setpc_b64 s[30:31]3085;3086; GFX8-GISEL-LABEL: test_vector_reduce_and_v16i64:3087; GFX8-GISEL:       ; %bb.0: ; %entry3088; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3089; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v163090; GFX8-GISEL-NEXT:    buffer_load_dword v16, off, s[0:3], s323091; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v183092; GFX8-GISEL-NEXT:    v_and_b32_e32 v4, v4, v203093; GFX8-GISEL-NEXT:    v_and_b32_e32 v6, v6, v223094; GFX8-GISEL-NEXT:    v_and_b32_e32 v8, v8, v243095; GFX8-GISEL-NEXT:    v_and_b32_e32 v10, v10, v263096; GFX8-GISEL-NEXT:    v_and_b32_e32 v12, v12, v283097; GFX8-GISEL-NEXT:    v_and_b32_e32 v14, v14, v303098; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v83099; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v103100; GFX8-GISEL-NEXT:    v_and_b32_e32 v4, v4, v123101; GFX8-GISEL-NEXT:    v_and_b32_e32 v6, v6, v143102; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v43103; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v2, v63104; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v173105; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v193106; GFX8-GISEL-NEXT:    v_and_b32_e32 v5, v5, v213107; GFX8-GISEL-NEXT:    v_and_b32_e32 v7, v7, v233108; GFX8-GISEL-NEXT:    v_and_b32_e32 v9, v9, v253109; GFX8-GISEL-NEXT:    v_and_b32_e32 v11, v11, v273110; GFX8-GISEL-NEXT:    v_and_b32_e32 v13, v13, v293111; GFX8-GISEL-NEXT:    v_and_b32_e32 v0, v0, v23112; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v93113; GFX8-GISEL-NEXT:    v_and_b32_e32 v3, v3, v113114; GFX8-GISEL-NEXT:    v_and_b32_e32 v5, v5, v133115; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v53116; GFX8-GISEL-NEXT:    s_waitcnt vmcnt(0)3117; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v15, v163118; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v7, v23119; GFX8-GISEL-NEXT:    v_and_b32_e32 v2, v3, v23120; GFX8-GISEL-NEXT:    v_and_b32_e32 v1, v1, v23121; GFX8-GISEL-NEXT:    s_setpc_b64 s[30:31]3122;3123; GFX9-SDAG-LABEL: test_vector_reduce_and_v16i64:3124; GFX9-SDAG:       ; %bb.0: ; %entry3125; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3126; GFX9-SDAG-NEXT:    scratch_load_dword v31, off, s323127; GFX9-SDAG-NEXT:    v_and_b32_e32 v4, v4, v203128; GFX9-SDAG-NEXT:    v_and_b32_e32 v12, v12, v283129; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v163130; GFX9-SDAG-NEXT:    v_and_b32_e32 v8, v8, v243131; GFX9-SDAG-NEXT:    v_and_b32_e32 v6, v6, v223132; GFX9-SDAG-NEXT:    v_and_b32_e32 v14, v14, v303133; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v183134; GFX9-SDAG-NEXT:    v_and_b32_e32 v10, v10, v263135; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v103136; GFX9-SDAG-NEXT:    v_and_b32_e32 v6, v6, v143137; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v83138; GFX9-SDAG-NEXT:    v_and_b32_e32 v4, v4, v123139; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v43140; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v2, v63141; GFX9-SDAG-NEXT:    v_and_b32_e32 v5, v5, v213142; GFX9-SDAG-NEXT:    v_and_b32_e32 v13, v13, v293143; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v173144; GFX9-SDAG-NEXT:    v_and_b32_e32 v9, v9, v253145; GFX9-SDAG-NEXT:    v_and_b32_e32 v7, v7, v233146; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v193147; GFX9-SDAG-NEXT:    v_and_b32_e32 v11, v11, v273148; GFX9-SDAG-NEXT:    v_and_b32_e32 v0, v0, v23149; GFX9-SDAG-NEXT:    v_and_b32_e32 v3, v3, v113150; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v93151; GFX9-SDAG-NEXT:    v_and_b32_e32 v5, v5, v133152; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v53153; GFX9-SDAG-NEXT:    s_waitcnt vmcnt(0)3154; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v15, v313155; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v7, v23156; GFX9-SDAG-NEXT:    v_and_b32_e32 v2, v3, v23157; GFX9-SDAG-NEXT:    v_and_b32_e32 v1, v1, v23158; GFX9-SDAG-NEXT:    s_setpc_b64 s[30:31]3159;3160; GFX9-GISEL-LABEL: test_vector_reduce_and_v16i64:3161; GFX9-GISEL:       ; %bb.0: ; %entry3162; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3163; GFX9-GISEL-NEXT:    scratch_load_dword v31, off, s323164; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v163165; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v183166; GFX9-GISEL-NEXT:    v_and_b32_e32 v4, v4, v203167; GFX9-GISEL-NEXT:    v_and_b32_e32 v6, v6, v223168; GFX9-GISEL-NEXT:    v_and_b32_e32 v8, v8, v243169; GFX9-GISEL-NEXT:    v_and_b32_e32 v10, v10, v263170; GFX9-GISEL-NEXT:    v_and_b32_e32 v12, v12, v283171; GFX9-GISEL-NEXT:    v_and_b32_e32 v14, v14, v303172; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v83173; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v103174; GFX9-GISEL-NEXT:    v_and_b32_e32 v4, v4, v123175; GFX9-GISEL-NEXT:    v_and_b32_e32 v6, v6, v143176; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v43177; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v2, v63178; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v173179; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v193180; GFX9-GISEL-NEXT:    v_and_b32_e32 v5, v5, v213181; GFX9-GISEL-NEXT:    v_and_b32_e32 v7, v7, v233182; GFX9-GISEL-NEXT:    v_and_b32_e32 v9, v9, v253183; GFX9-GISEL-NEXT:    v_and_b32_e32 v11, v11, v273184; GFX9-GISEL-NEXT:    v_and_b32_e32 v13, v13, v293185; GFX9-GISEL-NEXT:    v_and_b32_e32 v0, v0, v23186; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v93187; GFX9-GISEL-NEXT:    v_and_b32_e32 v3, v3, v113188; GFX9-GISEL-NEXT:    v_and_b32_e32 v5, v5, v133189; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v53190; GFX9-GISEL-NEXT:    s_waitcnt vmcnt(0)3191; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v15, v313192; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v7, v23193; GFX9-GISEL-NEXT:    v_and_b32_e32 v2, v3, v23194; GFX9-GISEL-NEXT:    v_and_b32_e32 v1, v1, v23195; GFX9-GISEL-NEXT:    s_setpc_b64 s[30:31]3196;3197; GFX10-SDAG-LABEL: test_vector_reduce_and_v16i64:3198; GFX10-SDAG:       ; %bb.0: ; %entry3199; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3200; GFX10-SDAG-NEXT:    buffer_load_dword v31, off, s[0:3], s323201; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v183202; GFX10-SDAG-NEXT:    v_and_b32_e32 v10, v10, v263203; GFX10-SDAG-NEXT:    v_and_b32_e32 v5, v5, v213204; GFX10-SDAG-NEXT:    v_and_b32_e32 v4, v4, v203205; GFX10-SDAG-NEXT:    v_and_b32_e32 v13, v13, v293206; GFX10-SDAG-NEXT:    v_and_b32_e32 v12, v12, v283207; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v173208; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v163209; GFX10-SDAG-NEXT:    v_and_b32_e32 v9, v9, v253210; GFX10-SDAG-NEXT:    v_and_b32_e32 v8, v8, v243211; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v193212; GFX10-SDAG-NEXT:    v_and_b32_e32 v11, v11, v273213; GFX10-SDAG-NEXT:    v_and_b32_e32 v7, v7, v233214; GFX10-SDAG-NEXT:    v_and_b32_e32 v6, v6, v223215; GFX10-SDAG-NEXT:    v_and_b32_e32 v14, v14, v303216; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v103217; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v113218; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v93219; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v83220; GFX10-SDAG-NEXT:    v_and_b32_e32 v5, v5, v133221; GFX10-SDAG-NEXT:    v_and_b32_e32 v4, v4, v123222; GFX10-SDAG-NEXT:    v_and_b32_e32 v6, v6, v143223; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v53224; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v43225; GFX10-SDAG-NEXT:    v_and_b32_e32 v2, v2, v63226; GFX10-SDAG-NEXT:    v_and_b32_e32 v0, v0, v23227; GFX10-SDAG-NEXT:    s_waitcnt vmcnt(0)3228; GFX10-SDAG-NEXT:    v_and_b32_e32 v10, v15, v313229; GFX10-SDAG-NEXT:    v_and_b32_e32 v7, v7, v103230; GFX10-SDAG-NEXT:    v_and_b32_e32 v3, v3, v73231; GFX10-SDAG-NEXT:    v_and_b32_e32 v1, v1, v33232; GFX10-SDAG-NEXT:    s_setpc_b64 s[30:31]3233;3234; GFX10-GISEL-LABEL: test_vector_reduce_and_v16i64:3235; GFX10-GISEL:       ; %bb.0: ; %entry3236; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3237; GFX10-GISEL-NEXT:    buffer_load_dword v31, off, s[0:3], s323238; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v163239; GFX10-GISEL-NEXT:    v_and_b32_e32 v8, v8, v243240; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v173241; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v183242; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v193243; GFX10-GISEL-NEXT:    v_and_b32_e32 v4, v4, v203244; GFX10-GISEL-NEXT:    v_and_b32_e32 v5, v5, v213245; GFX10-GISEL-NEXT:    v_and_b32_e32 v6, v6, v223246; GFX10-GISEL-NEXT:    v_and_b32_e32 v7, v7, v233247; GFX10-GISEL-NEXT:    v_and_b32_e32 v9, v9, v253248; GFX10-GISEL-NEXT:    v_and_b32_e32 v10, v10, v263249; GFX10-GISEL-NEXT:    v_and_b32_e32 v11, v11, v273250; GFX10-GISEL-NEXT:    v_and_b32_e32 v12, v12, v283251; GFX10-GISEL-NEXT:    v_and_b32_e32 v13, v13, v293252; GFX10-GISEL-NEXT:    v_and_b32_e32 v14, v14, v303253; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v83254; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v93255; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v103256; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v113257; GFX10-GISEL-NEXT:    v_and_b32_e32 v4, v4, v123258; GFX10-GISEL-NEXT:    v_and_b32_e32 v5, v5, v133259; GFX10-GISEL-NEXT:    v_and_b32_e32 v6, v6, v143260; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v43261; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v53262; GFX10-GISEL-NEXT:    v_and_b32_e32 v2, v2, v63263; GFX10-GISEL-NEXT:    v_and_b32_e32 v0, v0, v23264; GFX10-GISEL-NEXT:    s_waitcnt vmcnt(0)3265; GFX10-GISEL-NEXT:    v_and_b32_e32 v8, v15, v313266; GFX10-GISEL-NEXT:    v_and_b32_e32 v7, v7, v83267; GFX10-GISEL-NEXT:    v_and_b32_e32 v3, v3, v73268; GFX10-GISEL-NEXT:    v_and_b32_e32 v1, v1, v33269; GFX10-GISEL-NEXT:    s_setpc_b64 s[30:31]3270;3271; GFX11-SDAG-LABEL: test_vector_reduce_and_v16i64:3272; GFX11-SDAG:       ; %bb.0: ; %entry3273; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3274; GFX11-SDAG-NEXT:    scratch_load_b32 v31, off, s323275; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v183276; GFX11-SDAG-NEXT:    v_and_b32_e32 v10, v10, v263277; GFX11-SDAG-NEXT:    v_and_b32_e32 v5, v5, v213278; GFX11-SDAG-NEXT:    v_and_b32_e32 v4, v4, v203279; GFX11-SDAG-NEXT:    v_and_b32_e32 v13, v13, v293280; GFX11-SDAG-NEXT:    v_and_b32_e32 v12, v12, v283281; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v173282; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v163283; GFX11-SDAG-NEXT:    v_and_b32_e32 v9, v9, v253284; GFX11-SDAG-NEXT:    v_and_b32_e32 v8, v8, v243285; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v193286; GFX11-SDAG-NEXT:    v_and_b32_e32 v11, v11, v273287; GFX11-SDAG-NEXT:    v_and_b32_e32 v7, v7, v233288; GFX11-SDAG-NEXT:    v_and_b32_e32 v6, v6, v223289; GFX11-SDAG-NEXT:    v_and_b32_e32 v14, v14, v303290; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v103291; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v113292; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v93293; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v83294; GFX11-SDAG-NEXT:    v_and_b32_e32 v5, v5, v133295; GFX11-SDAG-NEXT:    v_and_b32_e32 v4, v4, v123296; GFX11-SDAG-NEXT:    v_and_b32_e32 v6, v6, v143297; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)3298; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v53299; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v43300; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)3301; GFX11-SDAG-NEXT:    v_and_b32_e32 v2, v2, v63302; GFX11-SDAG-NEXT:    v_and_b32_e32 v0, v0, v23303; GFX11-SDAG-NEXT:    s_waitcnt vmcnt(0)3304; GFX11-SDAG-NEXT:    v_and_b32_e32 v10, v15, v313305; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)3306; GFX11-SDAG-NEXT:    v_and_b32_e32 v7, v7, v103307; GFX11-SDAG-NEXT:    v_and_b32_e32 v3, v3, v73308; GFX11-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1)3309; GFX11-SDAG-NEXT:    v_and_b32_e32 v1, v1, v33310; GFX11-SDAG-NEXT:    s_setpc_b64 s[30:31]3311;3312; GFX11-GISEL-LABEL: test_vector_reduce_and_v16i64:3313; GFX11-GISEL:       ; %bb.0: ; %entry3314; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3315; GFX11-GISEL-NEXT:    scratch_load_b32 v31, off, s323316; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v163317; GFX11-GISEL-NEXT:    v_and_b32_e32 v8, v8, v243318; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v173319; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v183320; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v193321; GFX11-GISEL-NEXT:    v_and_b32_e32 v4, v4, v203322; GFX11-GISEL-NEXT:    v_and_b32_e32 v5, v5, v213323; GFX11-GISEL-NEXT:    v_and_b32_e32 v6, v6, v223324; GFX11-GISEL-NEXT:    v_and_b32_e32 v7, v7, v233325; GFX11-GISEL-NEXT:    v_and_b32_e32 v9, v9, v253326; GFX11-GISEL-NEXT:    v_and_b32_e32 v10, v10, v263327; GFX11-GISEL-NEXT:    v_and_b32_e32 v11, v11, v273328; GFX11-GISEL-NEXT:    v_and_b32_e32 v12, v12, v283329; GFX11-GISEL-NEXT:    v_and_b32_e32 v13, v13, v293330; GFX11-GISEL-NEXT:    v_and_b32_e32 v14, v14, v303331; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v83332; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v93333; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v103334; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v113335; GFX11-GISEL-NEXT:    v_and_b32_e32 v4, v4, v123336; GFX11-GISEL-NEXT:    v_and_b32_e32 v5, v5, v133337; GFX11-GISEL-NEXT:    v_and_b32_e32 v6, v6, v143338; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)3339; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v43340; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v53341; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)3342; GFX11-GISEL-NEXT:    v_and_b32_e32 v2, v2, v63343; GFX11-GISEL-NEXT:    v_and_b32_e32 v0, v0, v23344; GFX11-GISEL-NEXT:    s_waitcnt vmcnt(0)3345; GFX11-GISEL-NEXT:    v_and_b32_e32 v8, v15, v313346; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)3347; GFX11-GISEL-NEXT:    v_and_b32_e32 v7, v7, v83348; GFX11-GISEL-NEXT:    v_and_b32_e32 v3, v3, v73349; GFX11-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)3350; GFX11-GISEL-NEXT:    v_and_b32_e32 v1, v1, v33351; GFX11-GISEL-NEXT:    s_setpc_b64 s[30:31]3352;3353; GFX12-SDAG-LABEL: test_vector_reduce_and_v16i64:3354; GFX12-SDAG:       ; %bb.0: ; %entry3355; GFX12-SDAG-NEXT:    s_wait_loadcnt_dscnt 0x03356; GFX12-SDAG-NEXT:    s_wait_expcnt 0x03357; GFX12-SDAG-NEXT:    s_wait_samplecnt 0x03358; GFX12-SDAG-NEXT:    s_wait_bvhcnt 0x03359; GFX12-SDAG-NEXT:    s_wait_kmcnt 0x03360; GFX12-SDAG-NEXT:    scratch_load_b32 v31, off, s323361; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v183362; GFX12-SDAG-NEXT:    v_and_b32_e32 v10, v10, v263363; GFX12-SDAG-NEXT:    v_and_b32_e32 v5, v5, v213364; GFX12-SDAG-NEXT:    v_and_b32_e32 v4, v4, v203365; GFX12-SDAG-NEXT:    v_and_b32_e32 v13, v13, v293366; GFX12-SDAG-NEXT:    v_and_b32_e32 v12, v12, v283367; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v173368; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v163369; GFX12-SDAG-NEXT:    v_and_b32_e32 v9, v9, v253370; GFX12-SDAG-NEXT:    v_and_b32_e32 v8, v8, v243371; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v193372; GFX12-SDAG-NEXT:    v_and_b32_e32 v11, v11, v273373; GFX12-SDAG-NEXT:    v_and_b32_e32 v7, v7, v233374; GFX12-SDAG-NEXT:    v_and_b32_e32 v6, v6, v223375; GFX12-SDAG-NEXT:    v_and_b32_e32 v14, v14, v303376; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v103377; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v113378; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v93379; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v83380; GFX12-SDAG-NEXT:    v_and_b32_e32 v5, v5, v133381; GFX12-SDAG-NEXT:    v_and_b32_e32 v4, v4, v123382; GFX12-SDAG-NEXT:    v_and_b32_e32 v6, v6, v143383; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)3384; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v53385; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v43386; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)3387; GFX12-SDAG-NEXT:    v_and_b32_e32 v2, v2, v63388; GFX12-SDAG-NEXT:    v_and_b32_e32 v0, v0, v23389; GFX12-SDAG-NEXT:    s_wait_loadcnt 0x03390; GFX12-SDAG-NEXT:    v_and_b32_e32 v10, v15, v313391; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)3392; GFX12-SDAG-NEXT:    v_and_b32_e32 v7, v7, v103393; GFX12-SDAG-NEXT:    v_and_b32_e32 v3, v3, v73394; GFX12-SDAG-NEXT:    s_delay_alu instid0(VALU_DEP_1)3395; GFX12-SDAG-NEXT:    v_and_b32_e32 v1, v1, v33396; GFX12-SDAG-NEXT:    s_setpc_b64 s[30:31]3397;3398; GFX12-GISEL-LABEL: test_vector_reduce_and_v16i64:3399; GFX12-GISEL:       ; %bb.0: ; %entry3400; GFX12-GISEL-NEXT:    s_wait_loadcnt_dscnt 0x03401; GFX12-GISEL-NEXT:    s_wait_expcnt 0x03402; GFX12-GISEL-NEXT:    s_wait_samplecnt 0x03403; GFX12-GISEL-NEXT:    s_wait_bvhcnt 0x03404; GFX12-GISEL-NEXT:    s_wait_kmcnt 0x03405; GFX12-GISEL-NEXT:    scratch_load_b32 v31, off, s323406; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v163407; GFX12-GISEL-NEXT:    v_and_b32_e32 v8, v8, v243408; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v173409; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v183410; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v193411; GFX12-GISEL-NEXT:    v_and_b32_e32 v4, v4, v203412; GFX12-GISEL-NEXT:    v_and_b32_e32 v5, v5, v213413; GFX12-GISEL-NEXT:    v_and_b32_e32 v6, v6, v223414; GFX12-GISEL-NEXT:    v_and_b32_e32 v7, v7, v233415; GFX12-GISEL-NEXT:    v_and_b32_e32 v9, v9, v253416; GFX12-GISEL-NEXT:    v_and_b32_e32 v10, v10, v263417; GFX12-GISEL-NEXT:    v_and_b32_e32 v11, v11, v273418; GFX12-GISEL-NEXT:    v_and_b32_e32 v12, v12, v283419; GFX12-GISEL-NEXT:    v_and_b32_e32 v13, v13, v293420; GFX12-GISEL-NEXT:    v_and_b32_e32 v14, v14, v303421; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v83422; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v93423; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v103424; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v113425; GFX12-GISEL-NEXT:    v_and_b32_e32 v4, v4, v123426; GFX12-GISEL-NEXT:    v_and_b32_e32 v5, v5, v133427; GFX12-GISEL-NEXT:    v_and_b32_e32 v6, v6, v143428; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)3429; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v43430; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v53431; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)3432; GFX12-GISEL-NEXT:    v_and_b32_e32 v2, v2, v63433; GFX12-GISEL-NEXT:    v_and_b32_e32 v0, v0, v23434; GFX12-GISEL-NEXT:    s_wait_loadcnt 0x03435; GFX12-GISEL-NEXT:    v_and_b32_e32 v8, v15, v313436; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)3437; GFX12-GISEL-NEXT:    v_and_b32_e32 v7, v7, v83438; GFX12-GISEL-NEXT:    v_and_b32_e32 v3, v3, v73439; GFX12-GISEL-NEXT:    s_delay_alu instid0(VALU_DEP_1)3440; GFX12-GISEL-NEXT:    v_and_b32_e32 v1, v1, v33441; GFX12-GISEL-NEXT:    s_setpc_b64 s[30:31]3442entry:3443  %res = call i64 @llvm.vector.reduce.and.v16i64(<16 x i64> %v)3444  ret i64 %res3445}3446 3447declare i8 @llvm.vector.reduce.and.v2i8(<2 x i8>)3448declare i8 @llvm.vector.reduce.and.v3i8(<3 x i8>)3449declare i8 @llvm.vector.reduce.and.v4i8(<4 x i8>)3450declare i8 @llvm.vector.reduce.and.v8i8(<8 x i8>)3451declare i8 @llvm.vector.reduce.and.v16i8(<16 x i8>)3452 3453declare i16 @llvm.vector.reduce.and.v2i16(<2 x i16>)3454declare i16 @llvm.vector.reduce.and.v3i16(<3 x i16>)3455declare i16 @llvm.vector.reduce.and.v4i16(<4 x i16>)3456declare i16 @llvm.vector.reduce.and.v8i16(<8 x i16>)3457declare i16 @llvm.vector.reduce.and.v16i16(<16 x i16>)3458 3459declare i32 @llvm.vector.reduce.and.v2i32(<2 x i32>)3460declare i32 @llvm.vector.reduce.and.v3i32(<3 x i32>)3461declare i32 @llvm.vector.reduce.and.v4i32(<4 x i32>)3462declare i32 @llvm.vector.reduce.and.v8i32(<8 x i32>)3463declare i32 @llvm.vector.reduce.and.v16i32(<16 x i32>)3464 3465declare i64 @llvm.vector.reduce.and.v2i64(<2 x i64>)3466declare i64 @llvm.vector.reduce.and.v3i64(<3 x i64>)3467declare i64 @llvm.vector.reduce.and.v4i64(<4 x i64>)3468declare i64 @llvm.vector.reduce.and.v8i64(<8 x i64>)3469declare i64 @llvm.vector.reduce.and.v16i64(<16 x i64>)3470;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:3471; GFX11-GISEL-FAKE16: {{.*}}3472; GFX12-GISEL-FAKE16: {{.*}}3473