[llvm-branch-commits] [clang] b243ca1 - Revert "[Clang] Reduce the size of Decl and classes derived from it (#87361)"

2024-04-14 Thread via llvm-branch-commits

Author: Nikolas Klauser
Date: 2024-04-14T12:23:21+02:00
New Revision: b243ca1d3616d1dd61b81e3a112707e27cd4c865

URL: 
https://github.com/llvm/llvm-project/commit/b243ca1d3616d1dd61b81e3a112707e27cd4c865
DIFF: 
https://github.com/llvm/llvm-project/commit/b243ca1d3616d1dd61b81e3a112707e27cd4c865.diff

LOG: Revert "[Clang] Reduce the size of Decl and classes derived from it 
(#87361)"

This reverts commit c6f9c84e498ee05a812511ae969773ff166fd25e.

Added: 


Modified: 
clang/include/clang/AST/DeclBase.h
clang/lib/AST/DeclBase.cpp
clang/lib/Serialization/ASTReaderDecl.cpp

Removed: 




diff  --git a/clang/include/clang/AST/DeclBase.h 
b/clang/include/clang/AST/DeclBase.h
index 4bee18767dd11b..858450926455c6 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -268,37 +268,17 @@ class alignas(8) Decl {
   ///   }
   ///   void A::f(); // SemanticDC == namespace 'A'
   ///// LexicalDC == global namespace
+  llvm::PointerUnion DeclCtx;
 
-  // Compress the InvalidDecl and HasAttrs bits into DeclCtx to keep Decl below
-  // 32 bytes in size
-  llvm::PointerIntPair<
-  llvm::PointerIntPair, 1,
-   bool>,
-  1, bool>
-  DeclCtxWithInvalidDeclAndHasAttrs;
-
-  bool isInSemaDC() const {
-return DeclCtxWithInvalidDeclAndHasAttrs.getPointer()
-.getPointer()
-.is();
-  }
-
-  bool isOutOfSemaDC() const {
-return DeclCtxWithInvalidDeclAndHasAttrs.getPointer()
-.getPointer()
-.is();
-  }
+  bool isInSemaDC() const { return DeclCtx.is(); }
+  bool isOutOfSemaDC() const { return DeclCtx.is(); }
 
   MultipleDC *getMultipleDC() const {
-return DeclCtxWithInvalidDeclAndHasAttrs.getPointer()
-.getPointer()
-.get();
+return DeclCtx.get();
   }
 
   DeclContext *getSemanticDC() const {
-return DeclCtxWithInvalidDeclAndHasAttrs.getPointer()
-.getPointer()
-.get();
+return DeclCtx.get();
   }
 
   /// Loc - The location of this decl.
@@ -308,6 +288,14 @@ class alignas(8) Decl {
   LLVM_PREFERRED_TYPE(Kind)
   unsigned DeclKind : 7;
 
+  /// InvalidDecl - This indicates a semantic error occurred.
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned InvalidDecl :  1;
+
+  /// HasAttrs - This indicates whether the decl has attributes or not.
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasAttrs : 1;
+
   /// Implicit - Whether this declaration was implicitly generated by
   /// the implementation rather than explicitly written by the user.
   LLVM_PREFERRED_TYPE(bool)
@@ -405,22 +393,21 @@ class alignas(8) Decl {
 protected:
   Decl(Kind DK, DeclContext *DC, SourceLocation L)
   : NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
-DeclCtxWithInvalidDeclAndHasAttrs({DC, false}, false), Loc(L),
-DeclKind(DK), Implicit(false), Used(false), Referenced(false),
+DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(false), HasAttrs(false),
+Implicit(false), Used(false), Referenced(false),
 TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
 CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) {
-if (StatisticsEnabled)
-  add(DK);
+if (StatisticsEnabled) add(DK);
   }
 
   Decl(Kind DK, EmptyShell Empty)
-  : DeclKind(DK), Implicit(false), Used(false), Referenced(false),
-TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
+  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false),
+Used(false), Referenced(false), TopLevelDeclInObjCContainer(false),
+Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
 CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) {
-if (StatisticsEnabled)
-  add(DK);
+if (StatisticsEnabled) add(DK);
   }
 
   virtual ~Decl();
@@ -533,9 +520,7 @@ class alignas(8) Decl {
 return AccessSpecifier(Access);
   }
 
-  bool hasAttrs() const {
-return DeclCtxWithInvalidDeclAndHasAttrs.getPointer().getInt();
-  }
+  bool hasAttrs() const { return HasAttrs; }
 
   void setAttrs(const AttrVec& Attrs) {
 return setAttrsImpl(Attrs, getASTContext());
@@ -564,17 +549,13 @@ class alignas(8) Decl {
   }
 
   template  void dropAttrs() {
-if (!hasAttrs())
-  return;
+if (!HasAttrs) return;
 
 AttrVec &Vec = getAttrs();
 llvm::erase_if(Vec, [](Attr *A) { return isa(A); });
 
-if (Vec.empty()) {
-  auto InnerPtr = DeclCtxWithInvalidDeclAndHasAttrs.getPointer();
-  InnerPtr.setInt(false);
-  DeclCtxWithInvalidDeclAndHasAttrs.setPointer(InnerPtr);
-}
+if (Vec.empty())
+  HasAttrs = false;
   }
 
   template  void dropAttr() { dropAttrs(); }
@@ -609,10 +590,7 @@ class alignas(8) Decl {
   /// setInvalidDecl - Indicates the Decl

[llvm-branch-commits] [compiler-rt] f12c81f - Revert "CompilerRT: Normalize COMPILER_RT_DEFAULT_TARGET_TRIPLE (#88407)"

2024-04-14 Thread via llvm-branch-commits

Author: YunQiang Su
Date: 2024-04-15T00:10:22+08:00
New Revision: f12c81f2be59da892f7c54fb58cd9b0571bb438c

URL: 
https://github.com/llvm/llvm-project/commit/f12c81f2be59da892f7c54fb58cd9b0571bb438c
DIFF: 
https://github.com/llvm/llvm-project/commit/f12c81f2be59da892f7c54fb58cd9b0571bb438c.diff

LOG: Revert "CompilerRT: Normalize COMPILER_RT_DEFAULT_TARGET_TRIPLE (#88407)"

This reverts commit 00162162dd853795c532afa5dec4dc4e798d4a4b.

Added: 


Modified: 
compiler-rt/cmake/Modules/CompilerRTUtils.cmake

Removed: 




diff  --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake 
b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 75f111efeb102f..e8e5f612d5b03c 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -362,22 +362,10 @@ macro(construct_compiler_rt_default_triple)
   message(FATAL_ERROR "CMAKE_C_COMPILER_TARGET must also be set when 
COMPILER_RT_DEFAULT_TARGET_ONLY is ON")
 endif()
 message(STATUS "cmake c compiler target: ${CMAKE_C_COMPILER_TARGET}")
-if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
-  execute_process(COMMAND ${CMAKE_C_COMPILER} 
--target=${CMAKE_C_COMPILER_TARGET} -print-effective-triple
-  OUTPUT_VARIABLE COMPILER_RT_DEFAULT_TARGET_TRIPLE
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-else()
-  set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${CMAKE_C_COMPILER_TARGET})
-endif()
+set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${CMAKE_C_COMPILER_TARGET})
   else()
-if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
-  execute_process(COMMAND ${CMAKE_C_COMPILER} 
--target=${LLVM_TARGET_TRIPLE} -print-effective-triple
-  OUTPUT_VARIABLE COMPILER_RT_DEFAULT_TARGET_TRIPLE
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-else()
-  set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${LLVM_TARGET_TRIPLE} CACHE STRING
-"Default triple for which compiler-rt runtimes will be built.")
-endif()
+set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${LLVM_TARGET_TRIPLE} CACHE STRING
+  "Default triple for which compiler-rt runtimes will be built.")
   endif()
 
   string(REPLACE "-" ";" LLVM_TARGET_TRIPLE_LIST 
${COMPILER_RT_DEFAULT_TARGET_TRIPLE})



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Add local symbol hint to split fragment name (PR #88627)

2024-04-14 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/88627


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Add local symbol hint to split fragment name (PR #88627)

2024-04-14 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/88627


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Use offset deduplication for cold fragments (PR #87853)

2024-04-14 Thread Maksim Panchenko via llvm-branch-commits

https://github.com/maksfb approved this pull request.


https://github.com/llvm/llvm-project/pull/87853
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] release/18.x: [RISCV] Support rv{32, 64}e in the compiler builtins (#88252) (PR #88525)

2024-04-14 Thread Kito Cheng via llvm-branch-commits

https://github.com/kito-cheng approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/88525
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits