[all-commits] [llvm/llvm-project] 4a9aef: DynamicAPInt: optimize size of structure (#97831)

Ramkumar Ramachandra via All-commits all-commits at lists.llvm.org
Sat Jul 6 05:16:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a9aef683df895934c26591404692d41a687b005
      https://github.com/llvm/llvm-project/commit/4a9aef683df895934c26591404692d41a687b005
  Author: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
  Date:   2024-07-06 (Sat, 06 Jul 2024)

  Changed paths:
    M llvm/include/llvm/ADT/APInt.h
    M llvm/include/llvm/ADT/DynamicAPInt.h
    M llvm/include/llvm/ADT/SlowDynamicAPInt.h
    M llvm/lib/Support/DynamicAPInt.cpp

  Log Message:
  -----------
  DynamicAPInt: optimize size of structure (#97831)

Reuse the APInt::BitWidth to eliminate DynamicAPInt::HoldsLarge, cutting
the size of DynamicAPInt by four bytes. This is implemented by making
DynamicAPInt a friend of SlowDynamicAPInt and APInt, so it can directly
access SlowDynamicAPInt::Val and APInt::BitWidth.

We get a speedup of 4% with this patch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list