https://github.com/Priyanshu3820 updated 
https://github.com/llvm/llvm-project/pull/179538

>From 1d96ff048b6ca142134f64d6cbd716263995eb55 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Tue, 3 Feb 2026 19:46:09 +0000
Subject: [PATCH 01/12] Add support for vpshl/vpsh builtinsr

---
 clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp    |  13 +-
 .../X86/avx512vbmi2-builtins.c                | 425 ++++++++++++++++++
 2 files changed, 434 insertions(+), 4 deletions(-)
 create mode 100644 clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c

diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp 
b/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
index 80022998448ad..4e190ab4de3fb 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
@@ -2032,6 +2032,10 @@ CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, 
const CallExpr *expr) {
   case X86::BI__builtin_ia32_pternlogd256_maskz:
   case X86::BI__builtin_ia32_pternlogq128_maskz:
   case X86::BI__builtin_ia32_pternlogq256_maskz:
+    cgm.errorNYI(expr->getSourceRange(),
+                 std::string("unimplemented X86 builtin call: ") +
+                     getContext().BuiltinInfo.getName(builtinID));
+    return mlir::Value{};
   case X86::BI__builtin_ia32_vpshldd128:
   case X86::BI__builtin_ia32_vpshldd256:
   case X86::BI__builtin_ia32_vpshldd512:
@@ -2041,6 +2045,8 @@ CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, 
const CallExpr *expr) {
   case X86::BI__builtin_ia32_vpshldw128:
   case X86::BI__builtin_ia32_vpshldw256:
   case X86::BI__builtin_ia32_vpshldw512:
+    return emitX86FunnelShift(builder, getLoc(expr->getExprLoc()), ops[0],
+                              ops[1], ops[2], false);
   case X86::BI__builtin_ia32_vpshrdd128:
   case X86::BI__builtin_ia32_vpshrdd256:
   case X86::BI__builtin_ia32_vpshrdd512:
@@ -2050,10 +2056,9 @@ CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, 
const CallExpr *expr) {
   case X86::BI__builtin_ia32_vpshrdw128:
   case X86::BI__builtin_ia32_vpshrdw256:
   case X86::BI__builtin_ia32_vpshrdw512:
-    cgm.errorNYI(expr->getSourceRange(),
-                 std::string("unimplemented X86 builtin call: ") +
-                     getContext().BuiltinInfo.getName(builtinID));
-    return mlir::Value{};
+    // Ops 0 and 1 are swapped.
+    return emitX86FunnelShift(builder, getLoc(expr->getExprLoc()), ops[1],
+                              ops[0], ops[2], true);
   case X86::BI__builtin_ia32_reduce_fadd_pd512:
   case X86::BI__builtin_ia32_reduce_fadd_ps512:
   case X86::BI__builtin_ia32_reduce_fadd_ph512:
diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
new file mode 100644
index 0000000000000..db82023822429
--- /dev/null
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -0,0 +1,425 @@
+// RUN: %clang_cc1 -ffreestanding -triple x86_64-unknown-linux-gnu -fclangir 
-target-feature +avx512vbmi2 -emit-cir %s -o %t.cir
+// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
+// RUN: %clang_cc1 -ffreestanding -triple x86_64-unknown-linux-gnu -fclangir 
-target-feature +avx512vbmi2 -emit-llvm %s -o %t.ll
+// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=x86_64-unknown-linux -target-feature +avx512vbmi2 -emit-llvm -o %t.ll 
-Wall -Werror -Wsign-conversion
+// RUN: FileCheck --check-prefixes=OGCG --input-file=%t.ll %s
+
+
+#include <immintrin.h>
+
+__m512i test_mm512_mask_shldi_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shldi_epi64
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_mask_shldi_epi64
+  // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_mask_shldi_epi64
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_mask_shldi_epi64(s, u, a, b, 47);
+}
+
+__m512i test_mm512_maskz_shldi_epi64(__mmask8 u, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shldi_epi64
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shldi_epi64
+  // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_maskz_shldi_epi64
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_maskz_shldi_epi64(u, a, b, 63);
+}
+
+__m512i test_mm512_shldi_epi64(__m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shldi_epi64
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_shldi_epi64
+  // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
+  // OGCG-LABEL: @test_mm512_shldi_epi64
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
+  return _mm512_shldi_epi64(a, b, 31);
+}
+
+__m512i test_mm512_mask_shldi_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shldi_epi32
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_mask_shldi_epi32
+  // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_mask_shldi_epi32
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_mask_shldi_epi32(s, u, a, b, 7);
+}
+
+__m512i test_mm512_maskz_shldi_epi32(__mmask16 u, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shldi_epi32
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_maskz_shldi_epi32
+  // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_maskz_shldi_epi32
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_maskz_shldi_epi32(u, a, b, 15);
+}
+
+__m512i test_mm512_shldi_epi32(__m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shldi_epi32
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_shldi_epi32
+  // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
+  // OGCG-LABEL: @test_mm512_shldi_epi32
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
+  return _mm512_shldi_epi32(a, b, 31);
+}
+
+__m512i test_mm512_mask_shldi_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shldi_epi16
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_mask_shldi_epi16
+  // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_mask_shldi_epi16
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_mask_shldi_epi16(s, u, a, b, 3);
+}
+
+__m512i test_mm512_maskz_shldi_epi16(__mmask32 u, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shldi_epi16
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_maskz_shldi_epi16
+  // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_maskz_shldi_epi16
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_maskz_shldi_epi16(u, a, b, 15);
+}
+
+__m512i test_mm512_shldi_epi16(__m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shldi_epi16
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_shldi_epi16
+  // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
+  // OGCG-LABEL: @test_mm512_shldi_epi16
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
+  return _mm512_shldi_epi16(a, b, 31);
+}
+
+__m512i test_mm512_mask_shldv_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shldv_epi64
+  // CIR: cir.call @_mm512_mask_shldv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u8i, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_mask_shldv_epi64
+  // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_mask_shldv_epi64
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_mask_shldv_epi64(s, u, a, b);
+}
+
+__m512i test_mm512_maskz_shldv_epi64(__mmask8 u, __m512i s, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_maskz_shldv_epi64
+  // CIR: cir.call @_mm512_maskz_shldv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u8i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shldv_epi64
+  // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_maskz_shldv_epi64
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_maskz_shldv_epi64(u, s, a, b);
+}
+
+__m512i test_mm512_shldv_epi64(__m512i s, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shldv_epi64
+  // CIR: cir.call @_mm512_shldv_epi64
+  // LLVM-LABEL: @test_mm512_shldv_epi64
+  // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // OGCG-LABEL: @test_mm512_shldv_epi64
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  return _mm512_shldv_epi64(s, a, b);
+}
+
+__m512i test_mm512_shldv_epi32(__m512i s, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shldv_epi32
+  // CIR: cir.call @_mm512_shldv_epi32
+  // LLVM-LABEL: @test_mm512_shldv_epi32
+  // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_shldv_epi32
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  return _mm512_shldv_epi32(s, a, b);
+}
+
+__m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shldv_epi16
+  // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_mask_shldv_epi16
+  // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_mask_shldv_epi16
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_mask_shldv_epi16(s, u, a, b);
+}
+
+__m512i test_mm512_maskz_shldv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shldv_epi16
+  // CIR: cir.call @_mm512_maskz_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shldv_epi16
+  // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_maskz_shldv_epi16
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_maskz_shldv_epi16(u, s, a, b);
+}
+
+__m512i test_mm512_shldv_epi16(__m512i s, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shldv_epi16
+  // CIR: cir.call @_mm512_shldv_epi16
+  // LLVM-LABEL: @test_mm512_shldv_epi16
+  // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_shldv_epi16
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  return _mm512_shldv_epi16(s, a, b);
+}
+
+__m512i test_mm512_mask_shrdi_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shrdi_epi64
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_mask_shrdi_epi64
+  // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_mask_shrdi_epi64
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_mask_shrdi_epi64(s, u, a, b, 47);
+}
+
+__m512i test_mm512_maskz_shrdi_epi64(__mmask8 u, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shrdi_epi64
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shrdi_epi64
+  // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_maskz_shrdi_epi64
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_maskz_shrdi_epi64(u, a, b, 63);
+}
+
+__m512i test_mm512_shrdi_epi64(__m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shrdi_epi64
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_shrdi_epi64
+  // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
+  // OGCG-LABEL: @test_mm512_shrdi_epi64
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
+  return _mm512_shrdi_epi64(a, b, 31);
+}
+
+__m512i test_mm512_mask_shrdi_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shrdi_epi32
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_mask_shrdi_epi32
+  // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_mask_shrdi_epi32
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_mask_shrdi_epi32(s, u, a, b, 7);
+}
+
+__m512i test_mm512_maskz_shrdi_epi32(__mmask16 u, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shrdi_epi32
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_maskz_shrdi_epi32
+  // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_maskz_shrdi_epi32
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_maskz_shrdi_epi32(u, a, b, 15);
+}
+
+__m512i test_mm512_shrdi_epi32(__m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shrdi_epi32
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_shrdi_epi32
+  // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
+  // OGCG-LABEL: @test_mm512_shrdi_epi32
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
+  return _mm512_shrdi_epi32(a, b, 31);
+}
+
+__m512i test_mm512_mask_shrdi_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shrdi_epi16
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_mask_shrdi_epi16
+  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_mask_shrdi_epi16
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_mask_shrdi_epi16(s, u, a, b, 3);
+}
+
+__m512i test_mm512_maskz_shrdi_epi16(__mmask32 u, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shrdi_epi16
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_maskz_shrdi_epi16
+  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_maskz_shrdi_epi16
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_maskz_shrdi_epi16(u, a, b, 15);
+}
+
+__m512i test_mm512_shrdi_epi16(__m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shrdi_epi16
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_shrdi_epi16
+  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
+  // OGCG-LABEL: @test_mm512_shrdi_epi16
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
+  return _mm512_shrdi_epi16(a, b, 31);
+}
+
+__m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shldv_epi32
+  // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_mask_shldv_epi32
+  // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_mask_shldv_epi32
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_mask_shldv_epi32(s, u, a, b);
+}
+
+__m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shldv_epi32
+  // CIR: cir.call @_mm512_maskz_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shldv_epi32
+  // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_maskz_shldv_epi32
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_maskz_shldv_epi32(u, s, a, b);
+}
+
+__m512i test_mm512_mask_shrdv_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shrdv_epi64
+  // CIR: cir.call @_mm512_mask_shrdv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u8i, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_mask_shrdv_epi64
+  // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_mask_shrdv_epi64
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_mask_shrdv_epi64(s, u, a, b);
+}
+
+__m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_maskz_shrdv_epi64
+  // CIR: cir.call @_mm512_maskz_shrdv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u8i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shrdv_epi64
+  // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG-LABEL: @test_mm512_maskz_shrdv_epi64
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  return _mm512_maskz_shrdv_epi64(u, s, a, b);
+}
+
+__m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shrdv_epi32
+  // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
+  // LLVM-LABEL: @test_mm512_mask_shrdv_epi32
+  // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_mask_shrdv_epi32
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_mask_shrdv_epi32(s, u, a, b);
+}
+
+__m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shrdv_epi32
+  // CIR: cir.call @_mm512_maskz_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shrdv_epi32
+  // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_maskz_shrdv_epi32
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  return _mm512_maskz_shrdv_epi32(u, s, a, b);
+}
+
+__m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shrdv_epi32
+  // CIR: cir.call @_mm512_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_shrdv_epi32
+  // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG-LABEL: @test_mm512_shrdv_epi32
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  return _mm512_shrdv_epi32(s, a, b);
+}
+
+__m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
+  // CIR-LABEL: @test_mm512_mask_shrdv_epi16
+  // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
+  // LLVM-LABEL: @test_mm512_mask_shrdv_epi16
+  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_mask_shrdv_epi16
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_mask_shrdv_epi16(s, u, a, b);
+}
+
+__m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
+  // CIR-LABEL: @test_mm512_maskz_shrdv_epi16
+  // CIR: cir.call @_mm512_maskz_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_maskz_shrdv_epi16
+  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_maskz_shrdv_epi16
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  return _mm512_maskz_shrdv_epi16(u, s, a, b);
+}
+
+__m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
+  // CIR-LABEL: @test_mm512_shrdv_epi16
+  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
+  // LLVM-LABEL: @test_mm512_shrdv_epi16
+  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG-LABEL: @test_mm512_shrdv_epi16
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  return _mm512_shrdv_epi16(s, a, b);
+}

>From c15f5ea53c49d1c6010b508f2c2f961f1e6a1509 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Tue, 3 Feb 2026 20:06:26 +0000
Subject: [PATCH 02/12] Trigger CI re-run


>From 08feea6f0fecec0d5a21a1e08bf11a3322d86d04 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Tue, 3 Feb 2026 20:45:07 +0000
Subject: [PATCH 03/12] Update test

---
 .../X86/avx512vbmi2-builtins.c                | 118 +++++++++---------
 1 file changed, 59 insertions(+), 59 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index db82023822429..bd911e423ce83 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -16,8 +16,8 @@ __m512i test_mm512_mask_shldi_epi64(__m512i s, __mmask8 u, 
__m512i a, __m512i b)
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_mask_shldi_epi64
-  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64> splat (i64 47))
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask_shldi_epi64(s, u, a, b, 47);
 }
 
@@ -29,8 +29,8 @@ __m512i test_mm512_maskz_shldi_epi64(__mmask8 u, __m512i a, 
__m512i b) {
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_maskz_shldi_epi64
-  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64> splat (i64 63))
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_maskz_shldi_epi64(u, a, b, 63);
 }
 
@@ -40,7 +40,7 @@ __m512i test_mm512_shldi_epi64(__m512i a, __m512i b) {
   // LLVM-LABEL: @test_mm512_shldi_epi64
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
   // OGCG-LABEL: @test_mm512_shldi_epi64
-  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64> splat (i64 31))
   return _mm512_shldi_epi64(a, b, 31);
 }
 
@@ -52,8 +52,8 @@ __m512i test_mm512_mask_shldi_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_mask_shldi_epi32
-  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32> splat (i32 7))
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask_shldi_epi32(s, u, a, b, 7);
 }
 
@@ -65,8 +65,8 @@ __m512i test_mm512_maskz_shldi_epi32(__mmask16 u, __m512i a, 
__m512i b) {
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_maskz_shldi_epi32
-  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32> splat (i32 15))
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_maskz_shldi_epi32(u, a, b, 15);
 }
 
@@ -76,7 +76,7 @@ __m512i test_mm512_shldi_epi32(__m512i a, __m512i b) {
   // LLVM-LABEL: @test_mm512_shldi_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
   // OGCG-LABEL: @test_mm512_shldi_epi32
-  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32> splat (i32 31))
   return _mm512_shldi_epi32(a, b, 31);
 }
 
@@ -88,8 +88,8 @@ __m512i test_mm512_mask_shldi_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_mask_shldi_epi16
-  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16> splat (i16 3))
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_mask_shldi_epi16(s, u, a, b, 3);
 }
 
@@ -101,8 +101,8 @@ __m512i test_mm512_maskz_shldi_epi16(__mmask32 u, __m512i 
a, __m512i b) {
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_maskz_shldi_epi16
-  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16> splat (i16 15))
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_maskz_shldi_epi16(u, a, b, 15);
 }
 
@@ -112,7 +112,7 @@ __m512i test_mm512_shldi_epi16(__m512i a, __m512i b) {
   // LLVM-LABEL: @test_mm512_shldi_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
   // OGCG-LABEL: @test_mm512_shldi_epi16
-  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16> splat (i16 31))
   return _mm512_shldi_epi16(a, b, 31);
 }
 
@@ -124,8 +124,8 @@ __m512i test_mm512_mask_shldv_epi64(__m512i s, __mmask8 u, 
__m512i a, __m512i b)
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_mask_shldv_epi64
-  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64>
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask_shldv_epi64(s, u, a, b);
 }
 
@@ -136,8 +136,8 @@ __m512i test_mm512_maskz_shldv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_maskz_shldv_epi64
-  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64>
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_maskz_shldv_epi64(u, s, a, b);
 }
 
@@ -147,7 +147,7 @@ __m512i test_mm512_shldv_epi64(__m512i s, __m512i a, 
__m512i b) {
   // LLVM-LABEL: @test_mm512_shldv_epi64
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // OGCG-LABEL: @test_mm512_shldv_epi64
-  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64>
   return _mm512_shldv_epi64(s, a, b);
 }
 
@@ -157,7 +157,7 @@ __m512i test_mm512_shldv_epi32(__m512i s, __m512i a, 
__m512i b) {
   // LLVM-LABEL: @test_mm512_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shldv_epi32
-  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32>
   return _mm512_shldv_epi32(s, a, b);
 }
 
@@ -169,8 +169,8 @@ __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_mask_shldv_epi16
-  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_mask_shldv_epi16(s, u, a, b);
 }
 
@@ -181,8 +181,8 @@ __m512i test_mm512_maskz_shldv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_maskz_shldv_epi16
-  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_maskz_shldv_epi16(u, s, a, b);
 }
 
@@ -192,7 +192,7 @@ __m512i test_mm512_shldv_epi16(__m512i s, __m512i a, 
__m512i b) {
   // LLVM-LABEL: @test_mm512_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shldv_epi16
-  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
   return _mm512_shldv_epi16(s, a, b);
 }
 
@@ -204,8 +204,8 @@ __m512i test_mm512_mask_shrdi_epi64(__m512i s, __mmask8 u, 
__m512i a, __m512i b)
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_mask_shrdi_epi64
-  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 47))
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64> splat (i64 47))
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask_shrdi_epi64(s, u, a, b, 47);
 }
 
@@ -217,8 +217,8 @@ __m512i test_mm512_maskz_shrdi_epi64(__mmask8 u, __m512i a, 
__m512i b) {
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_maskz_shrdi_epi64
-  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 63))
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64> splat (i64 63))
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_maskz_shrdi_epi64(u, a, b, 63);
 }
 
@@ -228,7 +228,7 @@ __m512i test_mm512_shrdi_epi64(__m512i a, __m512i b) {
   // LLVM-LABEL: @test_mm512_shrdi_epi64
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
   // OGCG-LABEL: @test_mm512_shrdi_epi64
-  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64> splat (i64 31))
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64> splat (i64 31))
   return _mm512_shrdi_epi64(a, b, 31);
 }
 
@@ -240,8 +240,8 @@ __m512i test_mm512_mask_shrdi_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_mask_shrdi_epi32
-  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 7))
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32> splat (i32 7))
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask_shrdi_epi32(s, u, a, b, 7);
 }
 
@@ -253,8 +253,8 @@ __m512i test_mm512_maskz_shrdi_epi32(__mmask16 u, __m512i 
a, __m512i b) {
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_maskz_shrdi_epi32
-  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 15))
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32> splat (i32 15))
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_maskz_shrdi_epi32(u, a, b, 15);
 }
 
@@ -264,7 +264,7 @@ __m512i test_mm512_shrdi_epi32(__m512i a, __m512i b) {
   // LLVM-LABEL: @test_mm512_shrdi_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
   // OGCG-LABEL: @test_mm512_shrdi_epi32
-  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32> splat (i32 31))
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32> splat (i32 31))
   return _mm512_shrdi_epi32(a, b, 31);
 }
 
@@ -276,8 +276,8 @@ __m512i test_mm512_mask_shrdi_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_mask_shrdi_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 3))
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16> splat (i16 3))
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_mask_shrdi_epi16(s, u, a, b, 3);
 }
 
@@ -289,8 +289,8 @@ __m512i test_mm512_maskz_shrdi_epi16(__mmask32 u, __m512i 
a, __m512i b) {
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_maskz_shrdi_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 15))
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16> splat (i16 15))
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_maskz_shrdi_epi16(u, a, b, 15);
 }
 
@@ -300,7 +300,7 @@ __m512i test_mm512_shrdi_epi16(__m512i a, __m512i b) {
   // LLVM-LABEL: @test_mm512_shrdi_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
   // OGCG-LABEL: @test_mm512_shrdi_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16> splat (i16 31))
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16> splat (i16 31))
   return _mm512_shrdi_epi16(a, b, 31);
 }
 
@@ -312,8 +312,8 @@ __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_mask_shldv_epi32
-  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask_shldv_epi32(s, u, a, b);
 }
 
@@ -324,8 +324,8 @@ __m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_maskz_shldv_epi32
-  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_maskz_shldv_epi32(u, s, a, b);
 }
 
@@ -337,8 +337,8 @@ __m512i test_mm512_mask_shrdv_epi64(__m512i s, __mmask8 u, 
__m512i a, __m512i b)
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_mask_shrdv_epi64
-  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64>
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask_shrdv_epi64(s, u, a, b);
 }
 
@@ -349,8 +349,8 @@ __m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
   // OGCG-LABEL: @test_mm512_maskz_shrdv_epi64
-  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
-  // OGCG: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
+  // OGCG: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> %{{.*}}, <8 x i64> 
%{{.*}}, <8 x i64>
+  // OGCG: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_maskz_shrdv_epi64(u, s, a, b);
 }
 
@@ -362,8 +362,8 @@ __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_mask_shrdv_epi32
-  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask_shrdv_epi32(s, u, a, b);
 }
 
@@ -374,8 +374,8 @@ __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_maskz_shrdv_epi32
-  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
-  // OGCG: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32>
+  // OGCG: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_maskz_shrdv_epi32(u, s, a, b);
 }
 
@@ -385,7 +385,7 @@ __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, 
__m512i b) {
   // LLVM-LABEL: @test_mm512_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shrdv_epi32
-  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
+  // OGCG: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> %{{.*}}, <16 x i32> 
%{{.*}}, <16 x i32>
   return _mm512_shrdv_epi32(s, a, b);
 }
 
@@ -397,8 +397,8 @@ __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_mask_shrdv_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_mask_shrdv_epi16(s, u, a, b);
 }
 
@@ -409,8 +409,8 @@ __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_maskz_shrdv_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
-  // OGCG: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
+  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_maskz_shrdv_epi16(u, s, a, b);
 }
 
@@ -420,6 +420,6 @@ __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, 
__m512i b) {
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
+  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
   return _mm512_shrdv_epi16(s, a, b);
 }

>From 0ec229e71aeb16842eab68dbd2ba4d28c00bfaf9 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 04:22:56 +0000
Subject: [PATCH 04/12] Implement fshl/fshr in CIRGen

---
 clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp 
b/clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
index 580ada8901cbb..c7d6cd8ae240e 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
@@ -1246,8 +1246,23 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl 
&gd, unsigned builtinID,
   case Builtin::BI__builtin_elementwise_canonicalize:
   case Builtin::BI__builtin_elementwise_copysign:
   case Builtin::BI__builtin_elementwise_fma:
-  case Builtin::BI__builtin_elementwise_fshl:
-  case Builtin::BI__builtin_elementwise_fshr:
+    return errorBuiltinNYI(*this, e, builtinID);
+  case Builtin::BI__builtin_elementwise_fshl: {
+    mlir::Location loc = getLoc(e->getExprLoc());
+    mlir::Value a = emitScalarExpr(e->getArg(0));
+    mlir::Value b = emitScalarExpr(e->getArg(1));
+    mlir::Value c = emitScalarExpr(e->getArg(2));
+    return RValue::get(builder.emitIntrinsicCallOp(loc, "fshl", a.getType(),
+                                                   mlir::ValueRange{a, b, c}));
+  }
+  case Builtin::BI__builtin_elementwise_fshr: {
+    mlir::Location loc = getLoc(e->getExprLoc());
+    mlir::Value a = emitScalarExpr(e->getArg(0));
+    mlir::Value b = emitScalarExpr(e->getArg(1));
+    mlir::Value c = emitScalarExpr(e->getArg(2));
+    return RValue::get(builder.emitIntrinsicCallOp(loc, "fshr", a.getType(),
+                                                   mlir::ValueRange{a, b, c}));
+  }
   case Builtin::BI__builtin_elementwise_add_sat:
   case Builtin::BI__builtin_elementwise_sub_sat:
   case Builtin::BI__builtin_elementwise_max:

>From 38550e015d98f72c4fd9d4c8e149665528c34c2d Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 06:21:22 +0000
Subject: [PATCH 05/12] Update test

---
 .../X86/avx512vbmi2-builtins.c                | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index bd911e423ce83..ac84acfe01f6b 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -163,7 +163,7 @@ __m512i test_mm512_shldv_epi32(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi16
-  // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<32 x !s16i>, !u32i, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
@@ -176,7 +176,7 @@ __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shldv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi16
-  // CIR: cir.call @_mm512_maskz_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_maskz_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -306,7 +306,7 @@ __m512i test_mm512_shrdi_epi16(__m512i a, __m512i b) {
 
 __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi32
-  // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<16 x !s32i>, !u16i, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
@@ -319,7 +319,7 @@ __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi32
-  // CIR: cir.call @_mm512_maskz_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_maskz_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -356,7 +356,7 @@ __m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
 
 __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi32
-  // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<16 x !s32i>, !u16i, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
@@ -369,7 +369,7 @@ __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shrdv_epi32
-  // CIR: cir.call @_mm512_maskz_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_maskz_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_maskz_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -381,7 +381,7 @@ __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi32
-  // CIR: cir.call @_mm512_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>) -> 
!cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shrdv_epi32
@@ -391,7 +391,7 @@ __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi16
-  // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<32 x !s16i>, !u32i, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
@@ -404,7 +404,7 @@ __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shrdv_epi16
-  // CIR: cir.call @_mm512_maskz_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_maskz_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_maskz_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -416,7 +416,7 @@ __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
-  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>) -> 
!cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16

>From b3e8b0a4dfce3f7244d6c4f790f3cb401968af16 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 06:37:47 +0000
Subject: [PATCH 06/12] Update tes

---
 .../X86/avx512vbmi2-builtins.c                | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index ac84acfe01f6b..bd911e423ce83 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -163,7 +163,7 @@ __m512i test_mm512_shldv_epi32(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi16
-  // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<32 x !s16i>, !u32i, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
@@ -176,7 +176,7 @@ __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shldv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi16
-  // CIR: cir.call @_mm512_maskz_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_maskz_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -306,7 +306,7 @@ __m512i test_mm512_shrdi_epi16(__m512i a, __m512i b) {
 
 __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi32
-  // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<16 x !s32i>, !u16i, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
+  // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
@@ -319,7 +319,7 @@ __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi32
-  // CIR: cir.call @_mm512_maskz_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
+  // CIR: cir.call @_mm512_maskz_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -356,7 +356,7 @@ __m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
 
 __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi32
-  // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<16 x !s32i>, !u16i, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
+  // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
@@ -369,7 +369,7 @@ __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shrdv_epi32
-  // CIR: cir.call @_mm512_maskz_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, 
!cir.vector<16 x !s32i>) -> !cir.vector<16 x !s32i>
+  // CIR: cir.call @_mm512_maskz_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_maskz_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -381,7 +381,7 @@ __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi32
-  // CIR: cir.call @_mm512_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.call @_mm512_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shrdv_epi32
@@ -391,7 +391,7 @@ __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi16
-  // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<32 x !s16i>, !u32i, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
@@ -404,7 +404,7 @@ __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shrdv_epi16
-  // CIR: cir.call @_mm512_maskz_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, 
!cir.vector<32 x !s16i>) -> !cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_maskz_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_maskz_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -416,7 +416,7 @@ __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
-  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16

>From 633ae652cfaeedcda9caf7cd6af158aabba3cbb0 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 12:29:29 +0000
Subject: [PATCH 07/12] Update run lines

---
 clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index bd911e423ce83..920fea0b9593d 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -ffreestanding -triple x86_64-unknown-linux-gnu -fclangir 
-target-feature +avx512vbmi2 -emit-cir %s -o %t.cir
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding -triple 
x86_64-unknown-linux-gnu -fclangir -target-feature +avx512vbmi2 -emit-cir %s -o 
%t.cir
 // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-// RUN: %clang_cc1 -ffreestanding -triple x86_64-unknown-linux-gnu -fclangir 
-target-feature +avx512vbmi2 -emit-llvm %s -o %t.ll
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding -triple 
x86_64-unknown-linux-gnu -fclangir -target-feature +avx512vbmi2 -emit-llvm %s 
-o %t.ll
 // RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=x86_64-unknown-linux -target-feature +avx512vbmi2 -emit-llvm -o %t.ll 
-Wall -Werror -Wsign-conversion
 // RUN: FileCheck --check-prefixes=OGCG --input-file=%t.ll %s

>From 0d9d1562ea774a63785d7a2215ecf0cbb0fcc0cc Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 12:45:42 +0000
Subject: [PATCH 08/12] Update test

---
 clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index 920fea0b9593d..970ed64a2cbc1 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -416,7 +416,7 @@ __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
-  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
+// CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>) -> 
!cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16

>From cd69c77369019d32fdea7412a5da78f01bf85587 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 13:28:56 +0000
Subject: [PATCH 09/12] Fix formatting

---
 clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index 970ed64a2cbc1..a175a56105178 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -416,7 +416,7 @@ __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
-// CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>) -> 
!cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16

>From 5aef77226991d6a630479f0b5f6ae89da651f306 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 14:28:14 +0000
Subject: [PATCH 10/12] Update test

---
 .../CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c     | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index a175a56105178..bbcac3096f837 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -119,7 +119,6 @@ __m512i test_mm512_shldi_epi16(__m512i a, __m512i b) {
 __m512i test_mm512_mask_shldv_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi64
   // CIR: cir.call @_mm512_mask_shldv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u8i, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
-  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi64
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
@@ -164,7 +163,6 @@ __m512i test_mm512_shldv_epi32(__m512i s, __m512i a, 
__m512i b) {
 __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi16
   // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
-  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -307,7 +305,6 @@ __m512i test_mm512_shrdi_epi16(__m512i a, __m512i b) {
 __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi32
   // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
-  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -332,7 +329,6 @@ __m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
 __m512i test_mm512_mask_shrdv_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi64
   // CIR: cir.call @_mm512_mask_shrdv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u8i, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
-  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi64
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
@@ -357,7 +353,6 @@ __m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
 __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi32
   // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
-  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -381,7 +376,7 @@ __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi32
-  // CIR: cir.call @_mm512_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.call @_mm512_shrdv_epi32
   // LLVM-LABEL: @test_mm512_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shrdv_epi32
@@ -392,7 +387,6 @@ __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, 
__m512i b) {
 __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi16
   // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
-  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -416,7 +410,7 @@ __m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
-  // CIR: cir.call @_mm512_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}) : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.call @_mm512_shrdv_epi16
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16

>From fc18edbc34c10bcb993ce1e95c427daab9d98c53 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 15:50:36 +0000
Subject: [PATCH 11/12] Update test

---
 .../CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c   | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index bbcac3096f837..0da8c2c2e4f26 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -396,18 +396,6 @@ __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 
u, __m512i a, __m512i b
   return _mm512_mask_shrdv_epi16(s, u, a, b);
 }
 
-__m512i test_mm512_maskz_shrdv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
-  // CIR-LABEL: @test_mm512_maskz_shrdv_epi16
-  // CIR: cir.call @_mm512_maskz_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
-  // LLVM-LABEL: @test_mm512_maskz_shrdv_epi16
-  // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
-  // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
-  // OGCG-LABEL: @test_mm512_maskz_shrdv_epi16
-  // OGCG: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> %{{.*}}, <32 x i16> 
%{{.*}}, <32 x i16>
-  // OGCG: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
-  return _mm512_maskz_shrdv_epi16(u, s, a, b);
-}
-
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
   // CIR: cir.call @_mm512_shrdv_epi16

>From 30349bf8366476ba92eadae237c8b1402feb95e4 Mon Sep 17 00:00:00 2001
From: Priyanshu Kumar <[email protected]>
Date: Wed, 4 Feb 2026 16:13:12 +0000
Subject: [PATCH 12/12] Update test

---
 .../X86/avx512vbmi2-builtins.c                | 43 ++++++++++++-------
 1 file changed, 27 insertions(+), 16 deletions(-)

diff --git a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c 
b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
index 0da8c2c2e4f26..ae0cdf09f3f77 100644
--- a/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
+++ b/clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi2-builtins.c
@@ -118,7 +118,8 @@ __m512i test_mm512_shldi_epi16(__m512i a, __m512i b) {
 
 __m512i test_mm512_mask_shldv_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi64
-  // CIR: cir.call @_mm512_mask_shldv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u8i, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi64
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
@@ -130,7 +131,8 @@ __m512i test_mm512_mask_shldv_epi64(__m512i s, __mmask8 u, 
__m512i a, __m512i b)
 
 __m512i test_mm512_maskz_shldv_epi64(__mmask8 u, __m512i s, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi64
-  // CIR: cir.call @_mm512_maskz_shldv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u8i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi64
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
@@ -142,7 +144,7 @@ __m512i test_mm512_maskz_shldv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
 
 __m512i test_mm512_shldv_epi64(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shldv_epi64
-  // CIR: cir.call @_mm512_shldv_epi64
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_shldv_epi64
   // LLVM: call <8 x i64> @llvm.fshl.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // OGCG-LABEL: @test_mm512_shldv_epi64
@@ -152,7 +154,7 @@ __m512i test_mm512_shldv_epi64(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_shldv_epi32(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shldv_epi32
-  // CIR: cir.call @_mm512_shldv_epi32
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shldv_epi32
@@ -162,7 +164,8 @@ __m512i test_mm512_shldv_epi32(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi16
-  // CIR: cir.call @_mm512_mask_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -174,7 +177,8 @@ __m512i test_mm512_mask_shldv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shldv_epi16(__mmask32 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi16
-  // CIR: cir.call @_mm512_maskz_shldv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u32i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -186,7 +190,7 @@ __m512i test_mm512_maskz_shldv_epi16(__mmask32 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shldv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shldv_epi16
-  // CIR: cir.call @_mm512_shldv_epi16
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_shldv_epi16
   // LLVM: call <32 x i16> @llvm.fshl.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shldv_epi16
@@ -304,7 +308,8 @@ __m512i test_mm512_shrdi_epi16(__m512i a, __m512i b) {
 
 __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shldv_epi32
-  // CIR: cir.call @_mm512_mask_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -316,7 +321,8 @@ __m512i test_mm512_mask_shldv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shldv_epi32
-  // CIR: cir.call @_mm512_maskz_shldv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshl" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_maskz_shldv_epi32
   // LLVM: call <16 x i32> @llvm.fshl.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -328,7 +334,8 @@ __m512i test_mm512_maskz_shldv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_mask_shrdv_epi64(__m512i s, __mmask8 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi64
-  // CIR: cir.call @_mm512_mask_shrdv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u8i, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi64
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
@@ -340,7 +347,8 @@ __m512i test_mm512_mask_shrdv_epi64(__m512i s, __mmask8 u, 
__m512i a, __m512i b)
 
 __m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_maskz_shrdv_epi64
-  // CIR: cir.call @_mm512_maskz_shrdv_epi64(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u8i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 
x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, !cir.vector<8 x !u64i>) -> 
!cir.vector<8 x !s64i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<8 x 
!cir.int<s, 1>>, !cir.vector<8 x !s64i>
   // LLVM-LABEL: @test_mm512_maskz_shrdv_epi64
   // LLVM: call <8 x i64> @llvm.fshr.v8i64(<8 x i64> {{.*}}, <8 x i64> {{.*}}, 
<8 x i64>
   // LLVM: select <8 x i1> {{.*}}, <8 x i64> {{.*}}, <8 x i64>
@@ -352,7 +360,8 @@ __m512i test_mm512_maskz_shrdv_epi64(__mmask8 u, __m512i s, 
__m512i a, __m512i b
 
 __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi32
-  // CIR: cir.call @_mm512_mask_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u16i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -364,7 +373,8 @@ __m512i test_mm512_mask_shrdv_epi32(__m512i s, __mmask16 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i s, __m512i a, 
__m512i b) {
   // CIR-LABEL: @test_mm512_maskz_shrdv_epi32
-  // CIR: cir.call @_mm512_maskz_shrdv_epi32(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!u16i, !cir.vector<8 x !s64i>, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<16 x 
!cir.int<s, 1>>, !cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_maskz_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // LLVM: select <16 x i1> {{.*}}, <16 x i32> {{.*}}, <16 x i32>
@@ -376,7 +386,7 @@ __m512i test_mm512_maskz_shrdv_epi32(__mmask16 u, __m512i 
s, __m512i a, __m512i
 
 __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi32
-  // CIR: cir.call @_mm512_shrdv_epi32
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<16 x !s32i>, !cir.vector<16 x !s32i>, !cir.vector<16 x !u32i>) -> 
!cir.vector<16 x !s32i>
   // LLVM-LABEL: @test_mm512_shrdv_epi32
   // LLVM: call <16 x i32> @llvm.fshr.v16i32(<16 x i32> {{.*}}, <16 x i32> 
{{.*}}, <16 x i32>
   // OGCG-LABEL: @test_mm512_shrdv_epi32
@@ -386,7 +396,8 @@ __m512i test_mm512_shrdv_epi32(__m512i s, __m512i a, 
__m512i b) {
 
 __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, __m512i a, __m512i 
b) {
   // CIR-LABEL: @test_mm512_mask_shrdv_epi16
-  // CIR: cir.call @_mm512_mask_shrdv_epi16(%{{.*}}, %{{.*}}, %{{.*}}, 
%{{.*}}) : (!cir.vector<8 x !s64i>, !u32i, !cir.vector<8 x !s64i>, 
!cir.vector<8 x !s64i>) -> !cir.vector<8 x !s64i>
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
+  // CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<32 x 
!cir.int<s, 1>>, !cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_mask_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // LLVM: select <32 x i1> {{.*}}, <32 x i16> {{.*}}, <32 x i16>
@@ -398,7 +409,7 @@ __m512i test_mm512_mask_shrdv_epi16(__m512i s, __mmask32 u, 
__m512i a, __m512i b
 
 __m512i test_mm512_shrdv_epi16(__m512i s, __m512i a, __m512i b) {
   // CIR-LABEL: @test_mm512_shrdv_epi16
-  // CIR: cir.call @_mm512_shrdv_epi16
+  // CIR: cir.call_llvm_intrinsic "fshr" %{{.*}}, %{{.*}}, %{{.*}} : 
(!cir.vector<32 x !s16i>, !cir.vector<32 x !s16i>, !cir.vector<32 x !u16i>) -> 
!cir.vector<32 x !s16i>
   // LLVM-LABEL: @test_mm512_shrdv_epi16
   // LLVM: call <32 x i16> @llvm.fshr.v32i16(<32 x i16> {{.*}}, <32 x i16> 
{{.*}}, <32 x i16>
   // OGCG-LABEL: @test_mm512_shrdv_epi16

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to