[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

Wei Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 13 10:59:10 PDT 2021


weiwang added a comment.

Finally dealt with the other issues I need to take care. Let's resume the discussion.

I printed out the decls that are duplicated. The list of very long, but the top ones all seem from glibc headers. For example (the number after 'c:' is the duplication count),

  static inline __uint16_t __bswap_16(__uint16_t __bsx) {
      return ((__uint16_t)((((__bsx) >> 8) & 255) | (((__bsx) & 255) << 8)));
  }
  c:8581627
  static inline __uint16_t __bswap_16(__uint16_t __bsx)
  c:8581627
  static inline __uint32_t __bswap_32(__uint32_t __bsx) {
      return ((((__bsx) & 4278190080U) >> 24) | (((__bsx) & 16711680U) >> 8) | (((__bsx) & 65280U) << 8) | (((__bsx) & 255U) << 24));
  }
  c:8581627
  static inline __uint32_t __bswap_32(__uint32_t __bsx)
  c:8581627
  static inline __uint64_t __bswap_64(__uint64_t __bsx) {
      return ((((__bsx) & 18374686479671623680ULL) >> 56) | (((__bsx) & 71776119061217280ULL) >> 40) | (((__bsx) & 280375465082880ULL) >> 24) |   (((__bsx) & 1095216660480ULL) >> 8) | (((__bsx) & 4278190080ULL) << 8) | (((__bsx) & 16711680ULL) << 24) | (((__bsx) & 65280ULL) << 40) |       (((__bsx) & 255ULL) << 56));
  }
  c:8581627
  static inline __uint64_t __bswap_64(__uint64_t __bsx)
  c:8581627
  static inline __uint16_t __uint16_identity(__uint16_t __x) {
      return __x;
  }
  c:8581627
  static inline __uint32_t __uint32_identity(__uint32_t __x) {
      return __x;
  }
  c:8581627
  static inline __uint64_t __uint64_identity(__uint64_t __x) {
      return __x;
  }
  c:8581627
  inline int iscanonical(float __val) {
      return ((void)(typeof (__val))(__val) , 1);
  }
  c:8581627
  inline int iscanonical(double __val) {
      return ((void)(typeof (__val))(__val) , 1);
  }
  c:8581627
  inline int iscanonical(long double __val) {
      return __iscanonicall(__val);
  }
  c:8581627
  inline int issignaling(float __val) {
      return __issignalingf(__val);
  }
  c:8581627
  inline int issignaling(double __val) {
      return __issignaling(__val);
  }
  c:8581627
  inline int issignaling(long double __val) {
      return __issignalingl(__val);
  }
  c:8581627
  static int __call(float __x, float __y) throw() {
      return __iseqsigf(__x, __y);
  }
  c:8581627
  static int __call(double __x, double __y) throw() {
      return __iseqsig(__x, __y);
  }
  c:8581627
  static int __call(long double __x, long double __y) throw() {
      return __iseqsigl(__x, __y);
  }
  c:8581627

I think the source codebase is a mix of conventional headers and modules, I don't know if that makes any difference.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101793/new/

https://reviews.llvm.org/D101793



More information about the cfe-commits mailing list