[all-commits] [llvm/llvm-project] adb130: [llvm][TypeSize] Consider TypeSize of '0' to be fi...

Sander de Smalen via All-commits all-commits at lists.llvm.org
Mon Nov 27 06:05:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: adb130ccad67a18eb15506822e9cfcb1cb00cb45
      https://github.com/llvm/llvm-project/commit/adb130ccad67a18eb15506822e9cfcb1cb00cb45
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2023-11-27 (Mon, 27 Nov 2023)

  Changed paths:
    M llvm/include/llvm/Support/TypeSize.h
    M llvm/unittests/Support/TypeSizeTest.cpp

  Log Message:
  -----------
  [llvm][TypeSize] Consider TypeSize of '0' to be fixed/scalable-agnostic. (#72994)

This patch allows adding any quantity to a zero-initialized TypeSize,
such
that e.g.:

  TypeSize::Scalable(0) + TypeSize::Fixed(4) == TypeSize::Fixed(4)
  TypeSize::Fixed(0) + TypeSize::Scalable(4) == TypeSize::Scalable(4)

This makes it easier to implement add-reductions using TypeSize where
the 'scalable' flag is not yet known before starting the reduction.

(this PR follows on from #72979)




More information about the All-commits mailing list