[clang] [Clang][X86] Replace unnecessary `vfmadd*` builtins with `element_wise_fma` (PR #152545)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 8 04:51:22 PDT 2025


================
@@ -32,15 +32,15 @@ int qq(void) {
 
 // Test that fma and fma4 are both separately and combined valid for an fma intrinsic.
 __m128 __attribute__((target("fma"))) fma_1(__m128 a, __m128 b, __m128 c) {
-  return __builtin_ia32_vfmaddps(a, b, c);
+  return __builtin_elementwise_fma(a, b, c);
----------------
moorabbit wrote:

`__builtin_ia32_vfmaddsubps256` doesn't compile.
```
llvm-project/clang/test/CodeGen/target-builtin-noerror.c:35:40: error: passing '__m128' (vector of 4 'float' values) to parameter of incompatible type '__attribute__((__vector_size__(8 * sizeof(float)))) float' (vector of 8 'float' values)
   35 |   return __builtin_ia32_vfmaddsubps256(a, b, c);
      |                                        ^
```
I think you meant `__builtin_ia32_vfmaddsubps`? 

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


More information about the cfe-commits mailing list