aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/VE/VESelectionDAGInfo.cpp
blob: d4a33f4ca837e979a18eabbbc086a19f13f4e1e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "VESelectionDAGInfo.h"

#define GET_SDNODE_DESC
#include "VEGenSDNodeInfo.inc"

using namespace llvm;

VESelectionDAGInfo::VESelectionDAGInfo()
    : SelectionDAGGenTargetInfo(VEGenSDNodeInfo) {}

VESelectionDAGInfo::~VESelectionDAGInfo() = default;

const char *VESelectionDAGInfo::getTargetNodeName(unsigned Opcode) const {
#define TARGET_NODE_CASE(NAME)                                                 \
  case VEISD::NAME:                                                            \
    return "VEISD::" #NAME;

  switch (static_cast<VEISD::NodeType>(Opcode)) {
    TARGET_NODE_CASE(GLOBAL_BASE_REG)
    TARGET_NODE_CASE(LEGALAVL)
  }
#undef TARGET_NODE_CASE

  return SelectionDAGGenTargetInfo::getTargetNodeName(Opcode);
}

void VESelectionDAGInfo::verifyTargetNode(const SelectionDAG &DAG,
                                          const SDNode *N) const {
  switch (N->getOpcode()) {
  case VEISD::GETSTACKTOP:
    // result #0 has invalid type; expected ch, got i64
    return;
  }

  SelectionDAGGenTargetInfo::verifyTargetNode(DAG, N);
}