[all-commits] [llvm/llvm-project] e1a0e8: [GlobalISel] Copy the implementation of SubtargetF...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Aug 23 15:58:54 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e1a0e8258f788a86b248b4cc6bde8a96444a4720
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-08-23 (Wed, 23 Aug 2023)

  Changed paths:
    A llvm/include/llvm/ADT/Bitset.h
    M llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
    M llvm/test/TableGen/GlobalISelEmitter.td
    M llvm/utils/TableGen/GlobalISelMatchTableExecutorEmitter.cpp

  Log Message:
  [GlobalISel] Copy the implementation of SubtargetFeature and use it for PredicateBitset.

PredicateBitset currently uses std::bitset, but std::bitset doesn't
have a constexpr constructor or any constexpr methods until C++23.
Each target that supports GlobalIsel has as an array of PredicateBitset
objects that currently use a global constructor.

SubtargetFeature used by the MC layer for feature bits, has its own
implementation of std::bitset that has constexpr constructor and methods
that provides all the capabilities that PredicateBitset needs.

This patch copies the implementation from SubtargetFeature, makes
it a template class, and puts it in ADT. I'll migrate SubtargetFeature
in a separate patch. Adapting all existing users to it being a template
was distracting from the goal of this patch.

This reduces the binary size of llc built with gcc 8.5.0 on my local
build by ~15k.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D158576

More information about the All-commits mailing list