[all-commits] [llvm/llvm-project] 671ea0: [TableGen] Emit separate computeRequiredFeatures()...

Pavel Kosov via All-commits all-commits at lists.llvm.org
Wed Jun 7 08:24:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 671ea052fbc1a147b4433633cf72caef8e7857a4
      https://github.com/llvm/llvm-project/commit/671ea052fbc1a147b4433633cf72caef8e7857a4
  Author: Pavel Kosov <kpdev42 at gmail.com>
  Date:   2023-06-07 (Wed, 07 Jun 2023)

  Changed paths:
    M llvm/utils/TableGen/InstrInfoEmitter.cpp

  Log Message:
  -----------
  [TableGen] Emit separate computeRequiredFeatures() function

A function is already emitted in *GenInstrInfo.inc that takes Opcode
number and a set of supported Features and reports fatal error if some
of the required features are missing.

The information about features required by the particular opcode can be
reused by llvm-exegesis, so move its computation info a separate
computeRequiredFeatures() function. Then verifyInstructionPredicates()
can just compare the sets of available and required features computed by
the other functions.

This commit moves the definition of FeatureBitsets[] as well as CEFBS_*
enumerator values (that are indices into FeatureBitsets[] array) inside
the computeRequiredFeatures() function because these are implementation
details of that function. The inclusion of potentially huge
computeRequiredFeatures() function is now controlled by a dedicated
macro that is set for simplicity by TableGen-erated code itself if
`defined(ENABLE_INSTR_PREDICATE_VERIFIER) && !defined(NDEBUG)`.

~~

Huawei RRI, OS Lab

Reviewed By: courbet

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




More information about the All-commits mailing list