[clang] [CIR][X86] Add support for `kshiftl`/`kshiftr` builtins (PR #168591)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 18 11:57:15 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions c,cpp -- clang/test/CIR/CodeGen/X86/avx512bw-builtins.c clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
index 3fb0b7b40..4604c2567 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
@@ -72,9 +72,8 @@ static mlir::Value getMaskVecValue(CIRGenFunction &cgf, const CallExpr *e,
                                    mlir::Value mask, unsigned numElts) {
 
   CIRGenBuilderTy &builder = cgf.getBuilder();
-  auto maskTy =
-      cir::VectorType::get(builder.getBoolTy(),
-                           cast<cir::IntType>(mask.getType()).getWidth());
+  auto maskTy = cir::VectorType::get(
+      builder.getBoolTy(), cast<cir::IntType>(mask.getType()).getWidth());
   mlir::Value maskVec = builder.createBitcast(mask, maskTy);
 
   // If we have less than 8 elements, then the starting mask was an i8 and
@@ -84,8 +83,8 @@ static mlir::Value getMaskVecValue(CIRGenFunction &cgf, const CallExpr *e,
     for (auto i : llvm::seq<unsigned>(0, numElts))
       indices.push_back(i);
 
-    maskVec = builder.createVecShuffle(cgf.getLoc(e->getExprLoc()),
-                                                maskVec, maskVec, indices);
+    maskVec = builder.createVecShuffle(cgf.getLoc(e->getExprLoc()), maskVec,
+                                       maskVec, indices);
   }
   return maskVec;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/168591


More information about the cfe-commits mailing list