[PATCH] D158576: [GlobalISel] Copy the implementation of SubtargetFeature and use it for PredicateBitset.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 19:38:04 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: arsenm, dsanders, MaskRay, qcolombet, paquette, aemerson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158576

Files:
  llvm/include/llvm/ADT/Bitset.h
  llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
  llvm/utils/TableGen/GlobalISelMatchTableExecutorEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158576.552577.patch
Type: text/x-patch
Size: 7592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230823/1acb2e77/attachment.bin>


More information about the llvm-commits mailing list