llvm-project/llvm/test/TableGen
Daniel Sanders b96f40dd03 [tablegen][globalisel] Capture instructions into locals and related infrastructure for multiple instructions matches.
Summary:
Prepare the way for nested instruction matching support by having actions
like CopyRenderer look up operands in the RuleMatcher rather than a
specific InstructionMatcher. This allows actions to reference any operand
from any matched instruction.

It works by checking the 'shape' of the match and capturing
each matched instruction to a local variable. If the shape is wrong
(not enough operands, leaf nodes where non-leafs are expected, etc.), then
the rule exits early without checking the predicates. Once we've captured
the instructions, we then test the predicates as before (except using the
local variables). If the match is successful, then we render the new
instruction as before using the local variables.

It's not noticable in this patch but by the time we support multiple
instruction matching, this patch will also cause a significant improvement
to readability of the emitted code since
MRI.getVRegDef(I->getOperand(0).getReg()) will simply be MI1 after
emitCxxCaptureStmts().

This isn't quite NFC because I've also fixed a bug that I'm surprised we
haven't encountered yet. It now checks there are at least the expected
number of operands before accessing them with getOperand().

Depends on D30531

Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: rovka

Subscribers: dberris, kristof.beyls, llvm-commits

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

llvm-svn: 298257
2017-03-20 15:20:42 +00:00
..
2003-08-03-PassCode.td
2006-09-18-LargeInt.td
2010-03-24-PrematureDefaults.td
AnonDefinitionOnDemand.td
AsmPredicateCondsEmission.td Use std::bitset for SubtargetFeatures. 2015-05-26 10:47:10 +00:00
AsmVariant.td [TableGen] AsmMatcher: Add AsmVariantName to Instruction class. 2016-09-08 15:50:52 +00:00
BitOffsetDecoder.td Update test case to match minor formatting change introduced in r218563. 2014-09-27 05:36:53 +00:00
BitsInit.td Tablegen fixes for new syntax when initializing bits from variables. 2014-08-29 19:41:04 +00:00
BitsInitOverflow.td
CStyleComment.td
ClassInstanceValue.td [TableGen] Fully resolve class-instance values before defs in multiclasses 2014-09-16 17:14:13 +00:00
Dag.td
DefmInherit.td
DefmInsideMultiClass.td
DuplicateFieldValues.td [tablegen] Delete duplicates from a vector without skipping elements 2016-12-01 19:38:50 +00:00
FieldAccess.td
ForeachList.td llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176. 2014-08-12 14:06:21 +00:00
ForeachLoop.td llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176. 2014-08-12 14:06:21 +00:00
ForwardRef.td
GeneralList.td
GlobalISelEmitter.td [tablegen][globalisel] Capture instructions into locals and related infrastructure for multiple instructions matches. 2017-03-20 15:20:42 +00:00
Include.inc
Include.td
IntBitInit.td
LazyChange.td
LetInsideMultiClasses.td
ListArgs.td
ListArgsSimple.td
ListConversion.td
ListManip.td
ListOfList.td
ListSlices.td
LoLoL.td
MultiClass.td
MultiClassDefName.td [TableGen] Resolve complex def names inside multiclasses 2015-05-21 04:32:56 +00:00
MultiClassInherit.td
MultiPat.td
NestedForeach.td llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176. 2014-08-12 14:06:21 +00:00
Paste.td
RegisterBankEmitter.td TableGen: Fix infinite recursion in RegisterBankEmitter 2017-01-30 15:07:01 +00:00
SetTheory.td
SiblingForeach.td llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176. 2014-08-12 14:06:21 +00:00
Slice.td
String.td
SuperSubclassSameName.td
TargetInstrInfo.td
TargetInstrSpec.td
TemplateArgRename.td
Tree.td
TreeNames.td
TwoLevelName.td Add test cases that will show the bug that was fixed in r256725. 2016-01-13 07:53:11 +00:00
UnsetBitInit.td
UnterminatedComment.td
ValidIdentifiers.td
cast-list-initializer.td TableGen: Support folding casts from bits to int 2015-07-31 01:12:06 +00:00
cast.td
defmclass.td
eq.td
eqbit.td
foreach.td
if-empty-list-arg.td
if.td Change BitsInit to inherit from TypedInit. 2014-08-07 05:47:04 +00:00
ifbit.td Update BitRecTy::convertValue to allow if expressions with bit values on both sides of the if 2014-08-07 05:47:10 +00:00
intrinsic-long-name.td Declare MVT::SimpleValueType as an int8_t sized enum. This removes 400 bytes from TargetLoweringBase and probably other places. 2016-04-17 17:37:33 +00:00
intrinsic-varargs.td SelectionDAG: Make Properties a field of SDPatternOperator 2016-02-10 18:40:04 +00:00
lisp.td
list-element-bitref.td Change BitsInit to inherit from TypedInit. 2014-08-07 05:47:04 +00:00
listconcat.td
lit.local.cfg
math.td TableGen: Add operator !or 2016-11-15 06:49:28 +00:00
nested-comment.td
pr8330.td
strconcat.td
subst.td
subst2.td
trydecode-emission.td tests: accept different TargetOpcode values. 2016-07-07 17:51:42 +00:00
trydecode-emission2.td tests: accept different TargetOpcode values. 2016-07-07 17:51:42 +00:00
trydecode-emission3.td tests: accept different TargetOpcode values. 2016-07-07 17:51:42 +00:00
usevalname.td