TableGen: permit non-leaf ComplexPattern uses
authorTim Northover <tnorthover@apple.com>
Tue, 20 May 2014 11:52:46 +0000 (11:52 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 20 May 2014 11:52:46 +0000 (11:52 +0000)
commitee8d5c393ef04bbf19cb5aa9460ebb054e60fa3e
treec400e0f76859c04cf9c7af02d6b126bee1b8b59c
parent57a98baa07ae4b4bd9d7702afc81f95b93abb48d
TableGen: permit non-leaf ComplexPattern uses

This allows the results of a ComplexPattern check to be distributed to separate
named Operands, instead of the current system where all results must apply (and
match perfectly) with a single Operand.

For example, if "some_addrmode" is a ComplexPattern producing two results, you
can write:

   def : Pat<(load (some_addrmode GPR64:$base, imm:$offset)),
             (INST GPR64:$base, imm:$offset)>;

This should allow neater instruction definitions in TableGen that don't put all
possible aspects of addressing into a single operand, but are still usable with
relatively simple C++ CodeGen idioms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209206 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Hexagon/HexagonInstrInfoV4.td
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/CodeGenDAGPatterns.h
utils/TableGen/DAGISelMatcherGen.cpp