[clang] [Clang][x86]: allow PCLMULQDQ intrinsics to be used in constexpr (PR #169214)

via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 23 04:24:55 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 cpp,c -- clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AST/ExprConstant.cpp clang/test/CodeGen/X86/pclmul-builtins.c clang/test/CodeGen/X86/vpclmulqdq-builtins.c --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/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index ef740c04c..83a61f496 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -2746,13 +2746,13 @@ static bool interp__builtin_ia32_addsub(InterpState &S, CodePtr OpPC,
 }
 
 static bool interp__builtin_ia32_pclmulqdq(InterpState &S, CodePtr OpPC,
-                                            const CallExpr *Call) {
+                                           const CallExpr *Call) {
   // PCLMULQDQ: carry-less multiplication of selected 64-bit halves
   // imm8 bit 0: selects lower (0) or upper (1) 64 bits of first operand
   // imm8 bit 4: selects lower (0) or upper (1) 64 bits of second operand
   assert(Call->getArg(0)->getType()->isVectorType() &&
          Call->getArg(1)->getType()->isVectorType());
-  
+
   // Extract imm8 argument
   APSInt Imm8 = popToAPSInt(S, Call->getArg(2));
   unsigned Imm8Val = static_cast<unsigned>(Imm8.getZExtValue());
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index ea4a7c320..fbd3701c7 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -13522,8 +13522,8 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
       APSInt A = SelectUpperA ? A1 : A0;
       APSInt B = SelectUpperB ? B1 : B0;
 
-      // Perform carry-less multiplication (polynomial multiplication in GF(2^64))
-      // This multiplies two 64-bit values to produce a 128-bit result
+      // Perform carry-less multiplication (polynomial multiplication in
+      // GF(2^64)) This multiplies two 64-bit values to produce a 128-bit result
       APInt AVal = A.getValue().zextOrTrunc(64);
       APInt BVal = B.getValue().zextOrTrunc(64);
       APInt Result(128, 0);

``````````

</details>


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


More information about the cfe-commits mailing list