; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 ; RUN: opt < %s -passes=instcombine -mtriple=x86_64-unknown-unknown -S | FileCheck %s ; ; vXi64 ; define <2 x i64> @shuffle_vpermv3_v2i64(<2 x i64> %x0, <2 x i64> %x1) { ; CHECK-LABEL: define <2 x i64> @shuffle_vpermv3_v2i64( ; CHECK-SAME: <2 x i64> [[X0:%.*]], <2 x i64> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <2 x i64> [[X0]], <2 x i64> [[X1]], <2 x i32> ; CHECK-NEXT: ret <2 x i64> [[R]] ; %r = call <2 x i64> @llvm.x86.avx512.vpermi2var.q.128(<2 x i64> %x0, <2 x i64> , <2 x i64> %x1) ret <2 x i64> %r } define <2 x i64> @shuffle_vpermv3_v2i64_unary(<2 x i64> %x0) { ; CHECK-LABEL: define <2 x i64> @shuffle_vpermv3_v2i64_unary( ; CHECK-SAME: <2 x i64> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <2 x i64> [[X0]], <2 x i64> poison, <2 x i32> zeroinitializer ; CHECK-NEXT: ret <2 x i64> [[R]] ; %r = call <2 x i64> @llvm.x86.avx512.vpermi2var.q.128(<2 x i64> %x0, <2 x i64> , <2 x i64> %x0) ret <2 x i64> %r } define <2 x i64> @shuffle_vpermv3_v2i64_demandedbits(<2 x i64> %x0, <2 x i64> %x1, <2 x i64> %m) { ; CHECK-LABEL: define <2 x i64> @shuffle_vpermv3_v2i64_demandedbits( ; CHECK-SAME: <2 x i64> [[X0:%.*]], <2 x i64> [[X1:%.*]], <2 x i64> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <2 x i64> @llvm.x86.avx512.vpermi2var.q.128(<2 x i64> [[X0]], <2 x i64> [[M]], <2 x i64> [[X1]]) ; CHECK-NEXT: ret <2 x i64> [[R]] ; %t = or <2 x i64> %m, %r = call <2 x i64> @llvm.x86.avx512.vpermi2var.q.128(<2 x i64> %x0, <2 x i64> %t, <2 x i64> %x1) ret <2 x i64> %r } define <2 x i64> @shuffle_vpermv3_v2i64_demandedbits_negative(<2 x i64> %x0, <2 x i64> %x1, <2 x i64> %m) { ; CHECK-LABEL: define <2 x i64> @shuffle_vpermv3_v2i64_demandedbits_negative( ; CHECK-SAME: <2 x i64> [[X0:%.*]], <2 x i64> [[X1:%.*]], <2 x i64> [[M:%.*]]) { ; CHECK-NEXT: [[T:%.*]] = or <2 x i64> [[M]], ; CHECK-NEXT: [[R:%.*]] = call <2 x i64> @llvm.x86.avx512.vpermi2var.q.128(<2 x i64> [[X0]], <2 x i64> [[T]], <2 x i64> [[X1]]) ; CHECK-NEXT: ret <2 x i64> [[R]] ; %t = or <2 x i64> %m, %r = call <2 x i64> @llvm.x86.avx512.vpermi2var.q.128(<2 x i64> %x0, <2 x i64> %t, <2 x i64> %x1) ret <2 x i64> %r } define <4 x i64> @shuffle_vpermv3_v4i64(<4 x i64> %x0, <4 x i64> %x1) { ; CHECK-LABEL: define <4 x i64> @shuffle_vpermv3_v4i64( ; CHECK-SAME: <4 x i64> [[X0:%.*]], <4 x i64> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i64> [[X0]], <4 x i64> [[X1]], <4 x i32> ; CHECK-NEXT: ret <4 x i64> [[R]] ; %r = call <4 x i64> @llvm.x86.avx512.vpermi2var.q.256(<4 x i64> %x0, <4 x i64> , <4 x i64> %x1) ret <4 x i64> %r } define <4 x i64> @shuffle_vpermv3_v4i64_unary(<4 x i64> %x0) { ; CHECK-LABEL: define <4 x i64> @shuffle_vpermv3_v4i64_unary( ; CHECK-SAME: <4 x i64> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i64> [[X0]], <4 x i64> poison, <4 x i32> ; CHECK-NEXT: ret <4 x i64> [[R]] ; %r = call <4 x i64> @llvm.x86.avx512.vpermi2var.q.256(<4 x i64> %x0, <4 x i64> , <4 x i64> %x0) ret <4 x i64> %r } define <4 x i64> @shuffle_vpermv3_v4i64_demandedbits(<4 x i64> %x0, <4 x i64> %x1, <4 x i64> %m) { ; CHECK-LABEL: define <4 x i64> @shuffle_vpermv3_v4i64_demandedbits( ; CHECK-SAME: <4 x i64> [[X0:%.*]], <4 x i64> [[X1:%.*]], <4 x i64> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <4 x i64> @llvm.x86.avx512.vpermi2var.q.256(<4 x i64> [[X0]], <4 x i64> [[M]], <4 x i64> [[X1]]) ; CHECK-NEXT: ret <4 x i64> [[R]] ; %t = or <4 x i64> %m, %r = call <4 x i64> @llvm.x86.avx512.vpermi2var.q.256(<4 x i64> %x0, <4 x i64> %t, <4 x i64> %x1) ret <4 x i64> %r } define <8 x i64> @shuffle_vpermv3_v8i64(<8 x i64> %x0, <8 x i64> %x1) { ; CHECK-LABEL: define <8 x i64> @shuffle_vpermv3_v8i64( ; CHECK-SAME: <8 x i64> [[X0:%.*]], <8 x i64> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <8 x i64> [[X0]], <8 x i64> [[X1]], <8 x i32> ; CHECK-NEXT: ret <8 x i64> [[R]] ; %r = call <8 x i64> @llvm.x86.avx512.vpermi2var.q.512(<8 x i64> %x0, <8 x i64> , <8 x i64> %x1) ret <8 x i64> %r } define <8 x i64> @shuffle_vpermv3_v8i64_unary(<8 x i64> %x0) { ; CHECK-LABEL: define <8 x i64> @shuffle_vpermv3_v8i64_unary( ; CHECK-SAME: <8 x i64> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <8 x i64> [[X0]], <8 x i64> poison, <8 x i32> ; CHECK-NEXT: ret <8 x i64> [[R]] ; %r = call <8 x i64> @llvm.x86.avx512.vpermi2var.q.512(<8 x i64> %x0, <8 x i64> , <8 x i64> %x0) ret <8 x i64> %r } define <8 x i64> @shuffle_vpermv3_v8i64_demandedbits(<8 x i64> %x0, <8 x i64> %x1, <8 x i64> %m) { ; CHECK-LABEL: define <8 x i64> @shuffle_vpermv3_v8i64_demandedbits( ; CHECK-SAME: <8 x i64> [[X0:%.*]], <8 x i64> [[X1:%.*]], <8 x i64> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <8 x i64> @llvm.x86.avx512.vpermi2var.q.512(<8 x i64> [[X0]], <8 x i64> [[M]], <8 x i64> [[X1]]) ; CHECK-NEXT: ret <8 x i64> [[R]] ; %t = or <8 x i64> %m, %r = call <8 x i64> @llvm.x86.avx512.vpermi2var.q.512(<8 x i64> %x0, <8 x i64> %t, <8 x i64> %x1) ret <8 x i64> %r } ; ; vXi32 ; define <4 x i32> @shuffle_vpermv3_v4i32(<4 x i32> %x0, <4 x i32> %x1) { ; CHECK-LABEL: define <4 x i32> @shuffle_vpermv3_v4i32( ; CHECK-SAME: <4 x i32> [[X0:%.*]], <4 x i32> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i32> [[X0]], <4 x i32> [[X1]], <4 x i32> ; CHECK-NEXT: ret <4 x i32> [[R]] ; %r = call <4 x i32> @llvm.x86.avx512.vpermi2var.d.128(<4 x i32> %x0, <4 x i32> , <4 x i32> %x1) ret <4 x i32> %r } define <4 x i32> @shuffle_vpermv3_v4i32_unary(<4 x i32> %x0) { ; CHECK-LABEL: define <4 x i32> @shuffle_vpermv3_v4i32_unary( ; CHECK-SAME: <4 x i32> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i32> [[X0]], <4 x i32> poison, <4 x i32> ; CHECK-NEXT: ret <4 x i32> [[R]] ; %r = call <4 x i32> @llvm.x86.avx512.vpermi2var.d.128(<4 x i32> %x0, <4 x i32> , <4 x i32> %x0) ret <4 x i32> %r } define <4 x i32> @shuffle_vpermv3_v4i32_demandedbits(<4 x i32> %x0, <4 x i32> %x1, <4 x i32> %m) { ; CHECK-LABEL: define <4 x i32> @shuffle_vpermv3_v4i32_demandedbits( ; CHECK-SAME: <4 x i32> [[X0:%.*]], <4 x i32> [[X1:%.*]], <4 x i32> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <4 x i32> @llvm.x86.avx512.vpermi2var.d.128(<4 x i32> [[X0]], <4 x i32> [[M]], <4 x i32> [[X1]]) ; CHECK-NEXT: ret <4 x i32> [[R]] ; %t = or <4 x i32> %m, %r = call <4 x i32> @llvm.x86.avx512.vpermi2var.d.128(<4 x i32> %x0, <4 x i32> %t, <4 x i32> %x1) ret <4 x i32> %r } define <8 x i32> @shuffle_vpermv3_v8i32(<8 x i32> %x0, <8 x i32> %x1) { ; CHECK-LABEL: define <8 x i32> @shuffle_vpermv3_v8i32( ; CHECK-SAME: <8 x i32> [[X0:%.*]], <8 x i32> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <8 x i32> [[X0]], <8 x i32> [[X1]], <8 x i32> ; CHECK-NEXT: ret <8 x i32> [[R]] ; %r = call <8 x i32> @llvm.x86.avx512.vpermi2var.d.256(<8 x i32> %x0, <8 x i32> , <8 x i32> %x1) ret <8 x i32> %r } define <8 x i32> @shuffle_vpermv3_v8i32_unary(<8 x i32> %x0) { ; CHECK-LABEL: define <8 x i32> @shuffle_vpermv3_v8i32_unary( ; CHECK-SAME: <8 x i32> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <8 x i32> [[X0]], <8 x i32> poison, <8 x i32> ; CHECK-NEXT: ret <8 x i32> [[R]] ; %r = call <8 x i32> @llvm.x86.avx512.vpermi2var.d.256(<8 x i32> %x0, <8 x i32> , <8 x i32> %x0) ret <8 x i32> %r } define <8 x i32> @shuffle_vpermv3_v8i32_demandedbits(<8 x i32> %x0, <8 x i32> %x1, <8 x i32> %m) { ; CHECK-LABEL: define <8 x i32> @shuffle_vpermv3_v8i32_demandedbits( ; CHECK-SAME: <8 x i32> [[X0:%.*]], <8 x i32> [[X1:%.*]], <8 x i32> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <8 x i32> @llvm.x86.avx512.vpermi2var.d.256(<8 x i32> [[X0]], <8 x i32> [[M]], <8 x i32> [[X1]]) ; CHECK-NEXT: ret <8 x i32> [[R]] ; %t = or <8 x i32> %m, %r = call <8 x i32> @llvm.x86.avx512.vpermi2var.d.256(<8 x i32> %x0, <8 x i32> %t, <8 x i32> %x1) ret <8 x i32> %r } define <16 x i32> @shuffle_vpermv3_v16i32(<16 x i32> %x0, <16 x i32> %x1) { ; CHECK-LABEL: define <16 x i32> @shuffle_vpermv3_v16i32( ; CHECK-SAME: <16 x i32> [[X0:%.*]], <16 x i32> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <16 x i32> [[X0]], <16 x i32> [[X1]], <16 x i32> ; CHECK-NEXT: ret <16 x i32> [[R]] ; %r = call <16 x i32> @llvm.x86.avx512.vpermi2var.d.512(<16 x i32> %x0, <16 x i32> , <16 x i32> %x1) ret <16 x i32> %r } define <16 x i32> @shuffle_vpermv3_v16i32_unary(<16 x i32> %x0) { ; CHECK-LABEL: define <16 x i32> @shuffle_vpermv3_v16i32_unary( ; CHECK-SAME: <16 x i32> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <16 x i32> [[X0]], <16 x i32> poison, <16 x i32> ; CHECK-NEXT: ret <16 x i32> [[R]] ; %r = call <16 x i32> @llvm.x86.avx512.vpermi2var.d.512(<16 x i32> %x0, <16 x i32> , <16 x i32> %x0) ret <16 x i32> %r } define <16 x i32> @shuffle_vpermv3_v16i32_demandedbits(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %m) { ; CHECK-LABEL: define <16 x i32> @shuffle_vpermv3_v16i32_demandedbits( ; CHECK-SAME: <16 x i32> [[X0:%.*]], <16 x i32> [[X1:%.*]], <16 x i32> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <16 x i32> @llvm.x86.avx512.vpermi2var.d.512(<16 x i32> [[X0]], <16 x i32> [[M]], <16 x i32> [[X1]]) ; CHECK-NEXT: ret <16 x i32> [[R]] ; %t = or <16 x i32> %m, %r = call <16 x i32> @llvm.x86.avx512.vpermi2var.d.512(<16 x i32> %x0, <16 x i32> %t, <16 x i32> %x1) ret <16 x i32> %r } ; ; vXi16 ; define <8 x i16> @shuffle_vpermv3_v8i16(<8 x i16> %x0, <8 x i16> %x1) { ; CHECK-LABEL: define <8 x i16> @shuffle_vpermv3_v8i16( ; CHECK-SAME: <8 x i16> [[X0:%.*]], <8 x i16> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <8 x i16> [[X0]], <8 x i16> [[X1]], <8 x i32> ; CHECK-NEXT: ret <8 x i16> [[R]] ; %r = call <8 x i16> @llvm.x86.avx512.vpermi2var.hi.128(<8 x i16> %x0, <8 x i16> , <8 x i16> %x1) ret <8 x i16> %r } define <8 x i16> @shuffle_vpermv3_v8i16_unary(<8 x i16> %x0) { ; CHECK-LABEL: define <8 x i16> @shuffle_vpermv3_v8i16_unary( ; CHECK-SAME: <8 x i16> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <8 x i16> [[X0]], <8 x i16> poison, <8 x i32> ; CHECK-NEXT: ret <8 x i16> [[R]] ; %r = call <8 x i16> @llvm.x86.avx512.vpermi2var.hi.128(<8 x i16> %x0, <8 x i16> , <8 x i16> %x0) ret <8 x i16> %r } define <8 x i16> @shuffle_vpermv3_v8i16_demandedbits(<8 x i16> %x0, <8 x i16> %x1, <8 x i16> %m) { ; CHECK-LABEL: define <8 x i16> @shuffle_vpermv3_v8i16_demandedbits( ; CHECK-SAME: <8 x i16> [[X0:%.*]], <8 x i16> [[X1:%.*]], <8 x i16> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <8 x i16> @llvm.x86.avx512.vpermi2var.hi.128(<8 x i16> [[X0]], <8 x i16> [[M]], <8 x i16> [[X1]]) ; CHECK-NEXT: ret <8 x i16> [[R]] ; %t = or <8 x i16> %m, %r = call <8 x i16> @llvm.x86.avx512.vpermi2var.hi.128(<8 x i16> %x0, <8 x i16> %t, <8 x i16> %x1) ret <8 x i16> %r } define <16 x i16> @shuffle_vpermv3_v16i16(<16 x i16> %x0, <16 x i16> %x1) { ; CHECK-LABEL: define <16 x i16> @shuffle_vpermv3_v16i16( ; CHECK-SAME: <16 x i16> [[X0:%.*]], <16 x i16> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <16 x i16> [[X0]], <16 x i16> [[X1]], <16 x i32> ; CHECK-NEXT: ret <16 x i16> [[R]] ; %r = call <16 x i16> @llvm.x86.avx512.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> , <16 x i16> %x1) ret <16 x i16> %r } define <16 x i16> @shuffle_vpermv3_v16i16_unary(<16 x i16> %x0) { ; CHECK-LABEL: define <16 x i16> @shuffle_vpermv3_v16i16_unary( ; CHECK-SAME: <16 x i16> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <16 x i16> [[X0]], <16 x i16> poison, <16 x i32> ; CHECK-NEXT: ret <16 x i16> [[R]] ; %r = call <16 x i16> @llvm.x86.avx512.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> , <16 x i16> %x0) ret <16 x i16> %r } define <16 x i16> @shuffle_vpermv3_v16i16_demandedbits(<16 x i16> %x0, <16 x i16> %x1, <16 x i16> %m) { ; CHECK-LABEL: define <16 x i16> @shuffle_vpermv3_v16i16_demandedbits( ; CHECK-SAME: <16 x i16> [[X0:%.*]], <16 x i16> [[X1:%.*]], <16 x i16> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <16 x i16> @llvm.x86.avx512.vpermi2var.hi.256(<16 x i16> [[X0]], <16 x i16> [[M]], <16 x i16> [[X1]]) ; CHECK-NEXT: ret <16 x i16> [[R]] ; %t = or <16 x i16> %m, %r = call <16 x i16> @llvm.x86.avx512.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> %t, <16 x i16> %x1) ret <16 x i16> %r } define <32 x i16> @shuffle_vpermv3_v32i16(<32 x i16> %x0, <32 x i16> %x1) { ; CHECK-LABEL: define <32 x i16> @shuffle_vpermv3_v32i16( ; CHECK-SAME: <32 x i16> [[X0:%.*]], <32 x i16> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <32 x i16> [[X0]], <32 x i16> [[X1]], <32 x i32> ; CHECK-NEXT: ret <32 x i16> [[R]] ; %r = call <32 x i16> @llvm.x86.avx512.vpermi2var.hi.512(<32 x i16> %x0, <32 x i16> , <32 x i16> %x1) ret <32 x i16> %r } define <32 x i16> @shuffle_vpermv3_v32i16_unary(<32 x i16> %x0) { ; CHECK-LABEL: define <32 x i16> @shuffle_vpermv3_v32i16_unary( ; CHECK-SAME: <32 x i16> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <32 x i16> [[X0]], <32 x i16> poison, <32 x i32> ; CHECK-NEXT: ret <32 x i16> [[R]] ; %r = call <32 x i16> @llvm.x86.avx512.vpermi2var.hi.512(<32 x i16> %x0, <32 x i16> , <32 x i16> %x0) ret <32 x i16> %r } define <32 x i16> @shuffle_vpermv3_v32i16_demandedbits(<32 x i16> %x0, <32 x i16> %x1, <32 x i16> %m) { ; CHECK-LABEL: define <32 x i16> @shuffle_vpermv3_v32i16_demandedbits( ; CHECK-SAME: <32 x i16> [[X0:%.*]], <32 x i16> [[X1:%.*]], <32 x i16> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <32 x i16> @llvm.x86.avx512.vpermi2var.hi.512(<32 x i16> [[X0]], <32 x i16> [[M]], <32 x i16> [[X1]]) ; CHECK-NEXT: ret <32 x i16> [[R]] ; %t = or <32 x i16> %m, %r = call <32 x i16> @llvm.x86.avx512.vpermi2var.hi.512(<32 x i16> %x0, <32 x i16> %t, <32 x i16> %x1) ret <32 x i16> %r } ; ; vXi8 ; define <16 x i8> @shuffle_vpermv3_v16i8(<16 x i8> %x0, <16 x i8> %x1) { ; CHECK-LABEL: define <16 x i8> @shuffle_vpermv3_v16i8( ; CHECK-SAME: <16 x i8> [[X0:%.*]], <16 x i8> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <16 x i8> [[X0]], <16 x i8> [[X1]], <16 x i32> ; CHECK-NEXT: ret <16 x i8> [[R]] ; %r = call <16 x i8> @llvm.x86.avx512.vpermi2var.qi.128(<16 x i8> %x0, <16 x i8> , <16 x i8> %x1) ret <16 x i8> %r } define <16 x i8> @shuffle_vpermv3_v16i8_unary(<16 x i8> %x0) { ; CHECK-LABEL: define <16 x i8> @shuffle_vpermv3_v16i8_unary( ; CHECK-SAME: <16 x i8> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <16 x i8> [[X0]], <16 x i8> poison, <16 x i32> ; CHECK-NEXT: ret <16 x i8> [[R]] ; %r = call <16 x i8> @llvm.x86.avx512.vpermi2var.qi.128(<16 x i8> %x0, <16 x i8> , <16 x i8> %x0) ret <16 x i8> %r } define <16 x i8> @shuffle_vpermv3_v16i8_demandedbits(<16 x i8> %x0, <16 x i8> %x1, <16 x i8> %m) { ; CHECK-LABEL: define <16 x i8> @shuffle_vpermv3_v16i8_demandedbits( ; CHECK-SAME: <16 x i8> [[X0:%.*]], <16 x i8> [[X1:%.*]], <16 x i8> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <16 x i8> @llvm.x86.avx512.vpermi2var.qi.128(<16 x i8> [[X0]], <16 x i8> [[M]], <16 x i8> [[X1]]) ; CHECK-NEXT: ret <16 x i8> [[R]] ; %t = or <16 x i8> %m, %r = call <16 x i8> @llvm.x86.avx512.vpermi2var.qi.128(<16 x i8> %x0, <16 x i8> %t, <16 x i8> %x1) ret <16 x i8> %r } define <32 x i8> @shuffle_vpermv3_v32i8(<32 x i8> %x0, <32 x i8> %x1) { ; CHECK-LABEL: define <32 x i8> @shuffle_vpermv3_v32i8( ; CHECK-SAME: <32 x i8> [[X0:%.*]], <32 x i8> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <32 x i8> [[X0]], <32 x i8> [[X1]], <32 x i32> ; CHECK-NEXT: ret <32 x i8> [[R]] ; %r = call <32 x i8> @llvm.x86.avx512.vpermi2var.qi.256(<32 x i8> %x0, <32 x i8> , <32 x i8> %x1) ret <32 x i8> %r } define <32 x i8> @shuffle_vpermv3_v32i8_unary(<32 x i8> %x0) { ; CHECK-LABEL: define <32 x i8> @shuffle_vpermv3_v32i8_unary( ; CHECK-SAME: <32 x i8> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <32 x i8> [[X0]], <32 x i8> poison, <32 x i32> ; CHECK-NEXT: ret <32 x i8> [[R]] ; %r = call <32 x i8> @llvm.x86.avx512.vpermi2var.qi.256(<32 x i8> %x0, <32 x i8> , <32 x i8> %x0) ret <32 x i8> %r } define <32 x i8> @shuffle_vpermv3_v32i8_demandedbits(<32 x i8> %x0, <32 x i8> %x1, <32 x i8> %m) { ; CHECK-LABEL: define <32 x i8> @shuffle_vpermv3_v32i8_demandedbits( ; CHECK-SAME: <32 x i8> [[X0:%.*]], <32 x i8> [[X1:%.*]], <32 x i8> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <32 x i8> @llvm.x86.avx512.vpermi2var.qi.256(<32 x i8> [[X0]], <32 x i8> [[M]], <32 x i8> [[X1]]) ; CHECK-NEXT: ret <32 x i8> [[R]] ; %t = or <32 x i8> %m, %r = call <32 x i8> @llvm.x86.avx512.vpermi2var.qi.256(<32 x i8> %x0, <32 x i8> %t, <32 x i8> %x1) ret <32 x i8> %r } define <64 x i8> @shuffle_vpermv3_v64i8(<64 x i8> %x0, <64 x i8> %x1) { ; CHECK-LABEL: define <64 x i8> @shuffle_vpermv3_v64i8( ; CHECK-SAME: <64 x i8> [[X0:%.*]], <64 x i8> [[X1:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <64 x i8> [[X0]], <64 x i8> [[X1]], <64 x i32> ; CHECK-NEXT: ret <64 x i8> [[R]] ; %r = call <64 x i8> @llvm.x86.avx512.vpermi2var.qi.512(<64 x i8> %x0, <64 x i8> , <64 x i8> %x1) ret <64 x i8> %r } define <64 x i8> @shuffle_vpermv3_v64i8_unary(<64 x i8> %x0) { ; CHECK-LABEL: define <64 x i8> @shuffle_vpermv3_v64i8_unary( ; CHECK-SAME: <64 x i8> [[X0:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = shufflevector <64 x i8> [[X0]], <64 x i8> poison, <64 x i32> ; CHECK-NEXT: ret <64 x i8> [[R]] ; %r = call <64 x i8> @llvm.x86.avx512.vpermi2var.qi.512(<64 x i8> %x0, <64 x i8> , <64 x i8> %x0) ret <64 x i8> %r } define <64 x i8> @shuffle_vpermv3_v64i8_demandedbits(<64 x i8> %x0, <64 x i8> %x1, <64 x i8> %m) { ; CHECK-LABEL: define <64 x i8> @shuffle_vpermv3_v64i8_demandedbits( ; CHECK-SAME: <64 x i8> [[X0:%.*]], <64 x i8> [[X1:%.*]], <64 x i8> [[M:%.*]]) { ; CHECK-NEXT: [[R:%.*]] = call <64 x i8> @llvm.x86.avx512.vpermi2var.qi.512(<64 x i8> [[X0]], <64 x i8> [[M]], <64 x i8> [[X1]]) ; CHECK-NEXT: ret <64 x i8> [[R]] ; %t = or <64 x i8> %m, %r = call <64 x i8> @llvm.x86.avx512.vpermi2var.qi.512(<64 x i8> %x0, <64 x i8> %t, <64 x i8> %x1) ret <64 x i8> %r }