llvm-project/llvm/utils/TableGen
David Green 3e0bf1c7a9 [CodeGen] Move instruction predicate verification to emitInstruction
D25618 added a method to verify the instruction predicates for an
emitted instruction, through verifyInstructionPredicates added into
<Target>MCCodeEmitter::encodeInstruction. This is a very useful idea,
but the implementation inside MCCodeEmitter made it only fire for object
files, not assembly which most of the llvm test suite uses.

This patch moves the code into the <Target>_MC::verifyInstructionPredicates
method, inside the InstrInfo.  The allows it to be called from other
places, such as in this patch where it is called from the
<Target>AsmPrinter::emitInstruction methods which should trigger for
both assembly and object files. It can also be called from other places
such as verifyInstruction, but that is not done here (it tends to catch
errors earlier, but in reality just shows all the mir tests that have
incorrect feature predicates). The interface was also simplified
slightly, moving computeAvailableFeatures into the function so that it
does not need to be called externally.

The ARM, AMDGPU (but not R600), AVR, Mips and X86 backends all currently
show errors in the test-suite, so have been disabled with FIXME
comments.

Recommitted with some fixes for the leftover MCII variables in release
builds.

Differential Revision: https://reviews.llvm.org/D129506
2022-07-14 09:33:28 +01:00
..
GlobalISel [llvm] Don't use Optional::hasValue (NFC) 2022-06-26 18:31:51 -07:00
AsmMatcherEmitter.cpp [TableGen] const char *const x => const char x[] 2022-06-10 19:13:59 -07:00
AsmWriterEmitter.cpp [AArch64] Add target feature "all" 2022-06-30 10:37:58 -07:00
AsmWriterInst.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
AsmWriterInst.h
Attributes.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
CMakeLists.txt [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend. 2022-06-14 17:31:58 -07:00
CTagsEmitter.cpp
CallingConvEmitter.cpp [TableGen] Add generation of argument register lists 2022-05-19 15:18:25 -07:00
CodeEmitterGen.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
CodeGenDAGPatterns.cpp GlobalISel: Allow forming atomic/volatile G_ZEXTLOAD 2022-07-08 11:55:08 -04:00
CodeGenDAGPatterns.h [GlobalISel][SelectionDAG] Implement the HasNoUse builtin predicate 2022-07-08 09:47:33 +05:30
CodeGenHwModes.cpp
CodeGenHwModes.h
CodeGenInstruction.cpp [TableGen] Remove the use of global Record state 2022-05-11 11:55:33 -07:00
CodeGenInstruction.h [Codegen][tablgen][NFC] Allow meta instruction to be target dependent 2022-03-18 13:09:01 +08:00
CodeGenIntrinsics.h Rename GCCBuiltin into ClangBuiltin 2022-06-22 19:49:20 +01:00
CodeGenMapTable.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CodeGenRegisters.cpp [TableGen] Fix CodeGenRegisterClass::hasType for simple-type arguments 2022-07-07 09:37:15 -07:00
CodeGenRegisters.h [TableGen] Fix CodeGenRegisterClass::hasType for simple-type arguments 2022-07-07 09:37:15 -07:00
CodeGenSchedule.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CodeGenSchedule.h Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CodeGenTarget.cpp Rename GCCBuiltin into ClangBuiltin 2022-06-22 19:49:20 +01:00
CodeGenTarget.h Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CompressInstEmitter.cpp Cleanup llvm/utils/TableGen headers 2022-01-31 11:16:28 +01:00
DAGISelEmitter.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DAGISelMatcher.cpp
DAGISelMatcher.h
DAGISelMatcherEmitter.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DAGISelMatcherGen.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DAGISelMatcherOpt.cpp [llvm] Use true/false instead of 1/0 (NFC) 2022-01-07 00:39:14 -08:00
DFAEmitter.cpp Fix warnings about variables that are set but only used in debug mode 2022-04-06 10:01:46 +03:00
DFAEmitter.h
DFAPacketizerEmitter.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DXILEmitter.cpp [TableGen][DirectX] generate DXIL operation table with TableGen. 2022-06-16 23:25:57 -07:00
DecoderEmitter.cpp [AArch64] Add target feature "all" 2022-06-30 10:37:58 -07:00
DirectiveEmitter.cpp [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 10:22:05 -07:00
DisassemblerEmitter.cpp [NFC] Rename `FixedLenDecoderEmitter` as `DecoderEmitter` 2022-05-03 03:37:13 +08:00
ExegesisEmitter.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
FastISelEmitter.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
GICombinerEmitter.cpp [llvm] Don't use Optional::hasValue (NFC) 2022-06-20 10:38:12 -07:00
GlobalISelEmitter.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
InfoByHwMode.cpp Cleanup llvm/utils/TableGen headers 2022-01-31 11:16:28 +01:00
InfoByHwMode.h Cleanup llvm/utils/TableGen headers 2022-01-31 11:16:28 +01:00
InstrDocsEmitter.cpp
InstrInfoEmitter.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
IntrinsicEmitter.cpp Rename GCCBuiltin into ClangBuiltin 2022-06-22 19:49:20 +01:00
OptEmitter.cpp
OptEmitter.h
OptParserEmitter.cpp [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00
OptRSTEmitter.cpp [clang-tblgen] Automatically document options values 2022-04-20 22:00:06 +02:00
PredicateExpander.cpp utils: Remove some no-op raw_string_ostream flush calls, NFC 2021-12-10 11:26:08 -08:00
PredicateExpander.h Cleanup llvm/utils/TableGen headers 2022-01-31 11:16:28 +01:00
PseudoLoweringEmitter.cpp [TableGen] Remove the use of global Record state 2022-05-11 11:55:33 -07:00
RegisterBankEmitter.cpp [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 08:32:54 -07:00
RegisterInfoEmitter.cpp [TableGen] const char *const x => const char x[] 2022-06-10 19:13:59 -07:00
SDNodeProperties.cpp [NFC][SDNode] Use `StringSwitch` instead of `if` 2022-01-18 08:12:26 +08:00
SDNodeProperties.h
SearchableTableEmitter.cpp [TableGen] Remove the use of global Record state 2022-05-11 11:55:33 -07:00
SequenceToOffsetTable.h [TableGen] emitStringLiteralDef: Pad trailing '\0' at the end of char array. 2022-05-24 06:25:10 +09:00
SubtargetEmitter.cpp [NFC] Remove unused parameters for SubtargetEmitter::ParseFeaturesFunction 2022-03-19 19:14:22 +08:00
SubtargetFeatureInfo.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
SubtargetFeatureInfo.h
TableGen.cpp [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend. 2022-06-14 17:31:58 -07:00
TableGenBackends.h [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend. 2022-06-14 17:31:58 -07:00
Types.cpp
Types.h
VarLenCodeEmitterGen.cpp [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf 2022-05-19 11:23:13 +01:00
VarLenCodeEmitterGen.h [TableGen] Add support for variable length instruction in decoder generator 2022-05-03 03:37:13 +08:00
WebAssemblyDisassemblerEmitter.cpp [WebAssembly][NFC] Convert StackBased instruction field to 'bit' from string 2022-05-17 11:02:30 +01:00
WebAssemblyDisassemblerEmitter.h Cleanup llvm/utils/TableGen headers 2022-01-31 11:16:28 +01:00
X86DisassemblerShared.h
X86DisassemblerTables.cpp [X86] Fix handling of maskmovdqu in x32 differently 2022-04-12 18:32:14 +01:00
X86DisassemblerTables.h Cleanup llvm/utils/TableGen headers 2022-01-31 11:16:28 +01:00
X86EVEX2VEXTablesEmitter.cpp [X86][tablgen] Extract common functions in X86EVEX2VEXTablesEmitter.cpp and X86FoldTablesEmitter.cpp to avoid duplicated code. NFC 2022-03-27 08:47:18 +08:00
X86FoldTablesEmitter.cpp [X86][tablgen] Add one entry manually into the memory folding table 2022-04-06 22:06:15 +08:00
X86MnemonicTables.cpp [X86][tablgen] Refine the class RecognizableInstr. NFCI 2022-03-26 22:41:49 +08:00
X86ModRMFilters.cpp
X86ModRMFilters.h [llvm] Remove redundant member initialization (NFC) 2022-01-08 11:56:44 -08:00
X86RecognizableInstr.cpp [TableGen][X86] Add Size field to X86MemOperand class 2022-06-19 11:46:56 -07:00
X86RecognizableInstr.h [X86][tablgen] Extract common functions in X86EVEX2VEXTablesEmitter.cpp and X86FoldTablesEmitter.cpp to avoid duplicated code. NFC 2022-03-27 08:47:18 +08:00
tdtags