[PATCH] D148516: [TableGen] Emit separate computeRequiredFeatures() function

Pavel Kosov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 05:42:46 PDT 2023


kpdev42 created this revision.
kpdev42 added a reviewer: courbet.
kpdev42 added a project: LLVM.
Herald added a subscriber: mstojanovic.
Herald added a project: All.
kpdev42 requested review of this revision.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148516

Files:
  llvm/utils/TableGen/InstrInfoEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148516.514171.patch
Type: text/x-patch
Size: 4759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230417/ce813563/attachment.bin>


More information about the llvm-commits mailing list