LLVM 22.0.0git
AMDGPUSelectionDAGInfo.cpp
Go to the documentation of this file.
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
10
11#define GET_SDNODE_DESC
12#include "AMDGPUGenSDNodeInfo.inc"
13
14using namespace llvm;
15
18
20
21const char *AMDGPUSelectionDAGInfo::getTargetNodeName(unsigned Opcode) const {
22#define NODE_NAME_CASE(node) \
23 case AMDGPUISD::node: \
24 return "AMDGPUISD::" #node;
25
26 switch (static_cast<AMDGPUISD::NodeType>(Opcode)) {
27 // These nodes don't have corresponding entries in *.td files yet.
28 NODE_NAME_CASE(WAVE_ADDRESS)
29 NODE_NAME_CASE(MAD_I64_I32)
30 NODE_NAME_CASE(MAD_U64_U32)
31 NODE_NAME_CASE(BUILD_VERTICAL_VECTOR)
32 // These do, but only when compiling R600.td,
33 // and the enum is generated from AMDGPU.td.
34 NODE_NAME_CASE(DOT4)
35 NODE_NAME_CASE(TEXTURE_FETCH)
36 NODE_NAME_CASE(R600_EXPORT)
37 NODE_NAME_CASE(CONST_ADDRESS)
38 NODE_NAME_CASE(DUMMY_CHAIN)
39 }
40
41#undef NODE_NAME_CASE
42
44}
45
47 const SDNode *N) const {
48 switch (N->getOpcode()) {
49 case AMDGPUISD::IF:
50 // result #0 must have type i1, but has type i32/i64
51 case AMDGPUISD::ELSE:
52 case AMDGPUISD::LOOP:
53 // operand #1 must have type i1, but has type i32/i64
54 case AMDGPUISD::LDS:
55 // result #0 must have type i64 (iPTR), but has type i32
56 return;
57 }
59}
#define NODE_NAME_CASE(node)
void verifyTargetNode(const SelectionDAG &DAG, const SDNode *N) const override
Checks that the given target-specific node is valid. Aborts if it is not.
const char * getTargetNodeName(unsigned Opcode) const override
Returns the name of the given target-specific opcode, suitable for debug printing.
Represents one node in the SelectionDAG.
const char * getTargetNodeName(unsigned Opcode) const override
Returns the name of the given target-specific opcode, suitable for debug printing.
SelectionDAGGenTargetInfo(const SDNodeInfo &GenNodeInfo)
void verifyTargetNode(const SelectionDAG &DAG, const SDNode *N) const override
Checks that the given target-specific node is valid. Aborts if it is not.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is an optimization pass for GlobalISel generic memory operations.
#define N