[clang] [Headers][X86] avx ifma - move constexpr to the end of the function attribute lists. NFC. (PR #166523)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 5 01:32:51 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-x86
Author: Simon Pilgrim (RKSimon)
<details>
<summary>Changes</summary>
Makes it easier to compare constexpr/non-constexpr attribute defines
Allows clang-format to pack the attributes more efficiently
---
Full diff: https://github.com/llvm/llvm-project/pull/166523.diff
3 Files Affected:
- (modified) clang/lib/Headers/avx512ifmaintrin.h (+2-3)
- (modified) clang/lib/Headers/avx512ifmavlintrin.h (+6-7)
- (modified) clang/lib/Headers/avxifmaintrin.h (+4-4)
``````````diff
diff --git a/clang/lib/Headers/avx512ifmaintrin.h b/clang/lib/Headers/avx512ifmaintrin.h
index 625a8ff66dc60..f73b607df797f 100644
--- a/clang/lib/Headers/avx512ifmaintrin.h
+++ b/clang/lib/Headers/avx512ifmaintrin.h
@@ -17,9 +17,8 @@
/* Define the default attributes for the functions in this file. */
#if defined(__cplusplus) && (__cplusplus >= 201103L)
#define __DEFAULT_FN_ATTRS \
- constexpr \
- __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), \
- __min_vector_width__(512)))
+ __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), \
+ __min_vector_width__(512))) constexpr
#else
#define __DEFAULT_FN_ATTRS \
__attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), \
diff --git a/clang/lib/Headers/avx512ifmavlintrin.h b/clang/lib/Headers/avx512ifmavlintrin.h
index b377c17166ffb..51d5210e5aa5d 100644
--- a/clang/lib/Headers/avx512ifmavlintrin.h
+++ b/clang/lib/Headers/avx512ifmavlintrin.h
@@ -18,13 +18,13 @@
/* Define the default attributes for the functions in this file. */
#if defined(__cplusplus) && (__cplusplus >= 201103L)
#define __DEFAULT_FN_ATTRS128 \
- constexpr __attribute__((__always_inline__, __nodebug__, \
- __target__("avx512ifma,avx512vl"), \
- __min_vector_width__(128)))
+ __attribute__((__always_inline__, __nodebug__, \
+ __target__("avx512ifma,avx512vl"), \
+ __min_vector_width__(128))) constexpr
#define __DEFAULT_FN_ATTRS256 \
- constexpr __attribute__((__always_inline__, __nodebug__, \
- __target__("avx512ifma,avx512vl"), \
- __min_vector_width__(256)))
+ __attribute__((__always_inline__, __nodebug__, \
+ __target__("avx512ifma,avx512vl"), \
+ __min_vector_width__(256))) constexpr
#else
#define __DEFAULT_FN_ATTRS128 \
__attribute__((__always_inline__, __nodebug__, \
@@ -34,7 +34,6 @@
__attribute__((__always_inline__, __nodebug__, \
__target__("avx512ifma,avx512vl"), \
__min_vector_width__(256)))
-
#endif
#if !(defined(__AVXIFMA__) || defined(__AVX512IFMA__))
diff --git a/clang/lib/Headers/avxifmaintrin.h b/clang/lib/Headers/avxifmaintrin.h
index e452d5f0920e9..30df01caed6cf 100644
--- a/clang/lib/Headers/avxifmaintrin.h
+++ b/clang/lib/Headers/avxifmaintrin.h
@@ -17,11 +17,11 @@
/* Define the default attributes for the functions in this file. */
#if defined(__cplusplus) && (__cplusplus >= 201103L)
#define __DEFAULT_FN_ATTRS128 \
- constexpr __attribute__((__always_inline__, __nodebug__, \
- __target__("avxifma"), __min_vector_width__(128)))
+ __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \
+ __min_vector_width__(128))) constexpr
#define __DEFAULT_FN_ATTRS256 \
- constexpr __attribute__((__always_inline__, __nodebug__, \
- __target__("avxifma"), __min_vector_width__(256)))
+ __attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \
+ __min_vector_width__(256))) constexpr
#else
#define __DEFAULT_FN_ATTRS128 \
__attribute__((__always_inline__, __nodebug__, __target__("avxifma"), \
``````````
</details>
https://github.com/llvm/llvm-project/pull/166523
More information about the cfe-commits
mailing list