| //===- TargetGlobalISel.td - Common code for GlobalISel ----*- tablegen -*-===// |
| // |
| // The LLVM Compiler Infrastructure |
| // |
| // This file is distributed under the University of Illinois Open Source |
| // License. See LICENSE.TXT for details. |
| // |
| //===----------------------------------------------------------------------===// |
| // |
| // This file defines the target-independent interfaces used to support |
| // SelectionDAG instruction selection patterns (specified in |
| // TargetSelectionDAG.td) when generating GlobalISel instruction selectors. |
| // |
| // This is intended as a compatibility layer, to enable reuse of target |
| // descriptions written for SelectionDAG without requiring explicit GlobalISel |
| // support. It will eventually supersede SelectionDAG patterns. |
| // |
| //===----------------------------------------------------------------------===// |
| |
| // Declare that a generic Instruction is 'equivalent' to an SDNode, that is, |
| // SelectionDAG patterns involving the SDNode can be transformed to match the |
| // Instruction instead. |
| class GINodeEquiv<Instruction i, SDNode node> { |
| Instruction I = i; |
| SDNode Node = node; |
| } |
| |
| def : GINodeEquiv<G_ADD, add>; |
| def : GINodeEquiv<G_BR, br>; |