1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "VESelectionDAGInfo.h"
10
11#define GET_SDNODE_DESC
12#include "VEGenSDNodeInfo.inc"
13
14using namespace llvm;
15
16VESelectionDAGInfo::VESelectionDAGInfo()
17 : SelectionDAGGenTargetInfo(VEGenSDNodeInfo) {}
18
19VESelectionDAGInfo::~VESelectionDAGInfo() = default;
20
21const char *VESelectionDAGInfo::getTargetNodeName(unsigned Opcode) const {
22#define TARGET_NODE_CASE(NAME) \
23 case VEISD::NAME: \
24 return "VEISD::" #NAME;
25
26 switch (static_cast<VEISD::NodeType>(Opcode)) {
27 TARGET_NODE_CASE(GLOBAL_BASE_REG)
28 TARGET_NODE_CASE(LEGALAVL)
29 }
30#undef TARGET_NODE_CASE
31
32 return SelectionDAGGenTargetInfo::getTargetNodeName(Opcode);
33}
34
35void VESelectionDAGInfo::verifyTargetNode(const SelectionDAG &DAG,
36 const SDNode *N) const {
37 switch (N->getOpcode()) {
38 case VEISD::GETSTACKTOP:
39 // result #0 has invalid type; expected ch, got i64
40 return;
41 }
42
43 SelectionDAGGenTargetInfo::verifyTargetNode(DAG, N);
44}
45