[all-commits] [llvm/llvm-project] 562779: MathExtras: avoid unnecessarily widening types (#9...

Ramkumar Ramachandra via All-commits all-commits at lists.llvm.org
Sat Jun 29 04:17:09 PDT 2024


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

  Changed paths:
    M llvm/include/llvm/Support/MathExtras.h
    M llvm/unittests/Support/MathExtrasTest.cpp

  Log Message:
  -----------
  MathExtras: avoid unnecessarily widening types (#95426)

Several multi-argument functions unnecessarily widen types beyond the
argument types. Template'ize the functions, and use std::common_type_t
to avoid this, hence optimizing the functions. A requirement of this
patch is to change the overflow behavior of alignTo to only overflow
when the result isn't representable in the return type.



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