LLVM 22.0.0git
PPCSelectionDAGInfo.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
11
12#define GET_SDNODE_DESC
13#include "PPCGenSDNodeInfo.inc"
14
15using namespace llvm;
16
19
21
22const char *PPCSelectionDAGInfo::getTargetNodeName(unsigned Opcode) const {
23 switch (static_cast<PPCISD::NodeType>(Opcode)) {
25 return "PPCISD::GlobalBaseReg";
27 return "PPCISD::SRA_ADDZE";
29 return "PPCISD::READ_TIME_BASE";
30 case PPCISD::MFOCRF:
31 return "PPCISD::MFOCRF";
33 return "PPCISD::ANDI_rec_1_EQ_BIT";
35 return "PPCISD::ANDI_rec_1_GT_BIT";
36 case PPCISD::BDNZ:
37 return "PPCISD::BDNZ";
38 case PPCISD::BDZ:
39 return "PPCISD::BDZ";
41 return "PPCISD::PPC32_PICGOT";
43 return "PPCISD::VADD_SPLAT";
44 }
45
47}
48
50 const SDNode *N) const {
51 switch (N->getOpcode()) {
52 default:
53 break;
54 case PPCISD::DYNAREAOFFSET:
55 // invalid number of results; expected 2, got 1
56 case PPCISD::TOC_ENTRY:
57 // invalid number of results; expected 1, got 2
58 case PPCISD::STORE_COND:
59 // invalid number of results; expected 2, got 3
60 case PPCISD::LD_SPLAT:
61 case PPCISD::SEXT_LD_SPLAT:
62 case PPCISD::ZEXT_LD_SPLAT:
63 // invalid number of operands; expected 2, got 3
64 case PPCISD::ST_VSR_SCAL_INT:
65 // invalid number of operands; expected 4, got 5
66 case PPCISD::XXPERM:
67 // operand #1 must have type v2f64, but has type v16i8
68 case PPCISD::ACC_BUILD:
69 // operand #3 must have type v4i32, but has type v16i8
70 case PPCISD::PAIR_BUILD:
71 // operand #1 must have type v4i32, but has type v16i8
72 return;
73 }
74
76}
77
79 SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Op1, SDValue Op2,
80 SDValue Op3, const CallInst *CI) const {
81 return DAG.getMemcmp(Chain, dl, Op1, Op2, Op3, CI);
82}
83
84std::pair<SDValue, SDValue>
86 SDValue Chain, SDValue Src,
87 const CallInst *CI) const {
88 return DAG.getStrlen(Chain, DL, Src, CI);
89}
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This class represents a function call, abstracting a target machine's calling convention.
std::pair< SDValue, SDValue > EmitTargetCodeForMemcmp(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Op1, SDValue Op2, SDValue Op3, const CallInst *CI) const override
Emit target-specific code that performs a memcmp/bcmp, in cases where that is faster than a libcall.
const char * getTargetNodeName(unsigned Opcode) const override
Returns the name of the given target-specific opcode, suitable for debug printing.
std::pair< SDValue, SDValue > EmitTargetCodeForStrlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, const CallInst *CI) const override
void verifyTargetNode(const SelectionDAG &DAG, const SDNode *N) const override
Checks that the given target-specific node is valid. Aborts if it is not.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
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...
LLVM_ABI std::pair< SDValue, SDValue > getStrlen(SDValue Chain, const SDLoc &dl, SDValue Src, const CallInst *CI)
Lower a strlen operation into a target library call and return the resulting chain and call result as...
LLVM_ABI std::pair< SDValue, SDValue > getMemcmp(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, const CallInst *CI)
Lower a memcmp operation into a target library call and return the resulting chain and call result as...
@ BDNZ
CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based loops.
@ ANDI_rec_1_EQ_BIT
i1 = ANDI_rec_1_[EQ|GT]_BIT(i32 or i64 x) - Represents the result of the eq or gt bit of CR0 after ex...
@ MFOCRF
R32 = MFOCRF(CRREG, INFLAG) - Represents the MFOCRF instruction.
@ VADD_SPLAT
VRRC = VADD_SPLAT Elt, EltSize - Temporary node to be expanded during instruction selection to optimi...
@ PPC32_PICGOT
GPRC = address of GLOBAL_OFFSET_TABLE.
@ GlobalBaseReg
The result of the mflr at function entry, used for PIC code.
@ SRA_ADDZE
The combination of sra[wd]i and addze used to implemented signed integer division by a power of 2.
This is an optimization pass for GlobalISel generic memory operations.
#define N