Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jul 2023 18:27:04 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2da197f30da5 - stable/13 - Merge commit db492316399a from llvm-project (by Dimitry Andric):
Message-ID:  <202307231827.36NIR4EG058685@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=2da197f30da59015be64f98a2901c4e0a16819f6

commit 2da197f30da59015be64f98a2901c4e0a16819f6
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-04-20 19:22:59 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-07-23 17:38:09 +0000

    Merge commit db492316399a from llvm-project (by Dimitry Andric):
    
      [clang][BFloat] Avoid redefining bfloat16_t in arm_neon.h
    
      As of https://reviews.llvm.org/D79708, clang-tblgen generates `arm_neon.h`,
      `arm_sve.h` and `arm_bf16.h`, and all those generated files will contain a
      typedef of `bfloat16_t`. However, `arm_neon.h` and `arm_sve.h` include
      `arm_bf16.h` immediately before their own typedef:
    
          #include <arm_bf16.h>
          typedef __bf16 bfloat16_t;
    
      With a recent version of clang (I used 16.0.1) this results in warnings:
    
          /usr/lib/clang/16/include/arm_neon.h:38:16: error: redefinition of typedef 'bfloat16_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
    
      Since `arm_bf16.h` is very likely supposed to be the one true place where
      `bfloat16_t` is defined, I propose to delete the duplicate typedefs from the
      generated `arm_neon.h` and `arm_sve.h`.
    
      Reviewed By: sdesmalen, simonbutcher
    
      Differential Revision: https://reviews.llvm.org/D148822
    
    PR:             271047
    MFC after:      1 month
    
    (cherry picked from commit 1ac57eed95099f4d9da2ecab6000ad66d05c1018)
---
 contrib/llvm-project/clang/utils/TableGen/NeonEmitter.cpp | 1 -
 contrib/llvm-project/clang/utils/TableGen/SveEmitter.cpp  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/contrib/llvm-project/clang/utils/TableGen/NeonEmitter.cpp b/contrib/llvm-project/clang/utils/TableGen/NeonEmitter.cpp
index 8f46b08b1366..08f2344f5d0a 100644
--- a/contrib/llvm-project/clang/utils/TableGen/NeonEmitter.cpp
+++ b/contrib/llvm-project/clang/utils/TableGen/NeonEmitter.cpp
@@ -2353,7 +2353,6 @@ void NeonEmitter::run(raw_ostream &OS) {
   OS << "#include <stdint.h>\n\n";
 
   OS << "#include <arm_bf16.h>\n";
-  OS << "typedef __bf16 bfloat16_t;\n";
 
   // Emit NEON-specific scalar typedefs.
   OS << "typedef float float32_t;\n";
diff --git a/contrib/llvm-project/clang/utils/TableGen/SveEmitter.cpp b/contrib/llvm-project/clang/utils/TableGen/SveEmitter.cpp
index a577c10e3c64..bca61e703020 100644
--- a/contrib/llvm-project/clang/utils/TableGen/SveEmitter.cpp
+++ b/contrib/llvm-project/clang/utils/TableGen/SveEmitter.cpp
@@ -1103,7 +1103,6 @@ void SVEEmitter::createHeader(raw_ostream &OS) {
   OS << "typedef __SVBFloat16_t svbfloat16_t;\n";
 
   OS << "#include <arm_bf16.h>\n";
-  OS << "typedef __bf16 bfloat16_t;\n";
 
   OS << "typedef __SVFloat32_t svfloat32_t;\n";
   OS << "typedef __SVFloat64_t svfloat64_t;\n";



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307231827.36NIR4EG058685>