LLVM 22.0.0git
ARMSelectionDAGInfo.h
Go to the documentation of this file.
1//===-- ARMSelectionDAGInfo.h - ARM SelectionDAG Info -----------*- C++ -*-===//
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// This file defines the ARM subclass for SelectionDAGTargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
14#define LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
15
19
20#define GET_SDNODE_ENUM
21#include "ARMGenSDNodeInfo.inc"
22
23namespace llvm {
24namespace ARMISD {
25
26enum NodeType : unsigned {
27 DYN_ALLOC = GENERATED_OPCODE_END, // Dynamic allocation on the stack.
28
29 MVESEXT, // Legalization aids for extending a vector into two/four vectors.
30 MVEZEXT, // or truncating two/four vectors into one. Eventually becomes
31 MVETRUNC, // stack store/load sequence, if not optimized to anything else.
32
33 // Operands of the standard BUILD_VECTOR node are not legalized, which
34 // is fine if BUILD_VECTORs are always lowered to shuffles or other
35 // operations, but for ARM some BUILD_VECTORs are legal as-is and their
36 // operands need to be legalized. Define an ARM-specific version of
37 // BUILD_VECTOR for this purpose.
39
40 // Vector load N-element structure to all lanes:
46
47 // NEON loads with post-increment base updates:
62
63 // NEON stores with post-increment base updates:
73};
74
75} // namespace ARMISD
76
77namespace ARM_AM {
78 static inline ShiftOpc getShiftOpcForNode(unsigned Opcode) {
79 switch (Opcode) {
80 default: return ARM_AM::no_shift;
81 case ISD::SHL: return ARM_AM::lsl;
82 case ISD::SRL: return ARM_AM::lsr;
83 case ISD::SRA: return ARM_AM::asr;
84 case ISD::ROTR: return ARM_AM::ror;
85 //case ISD::ROTL: // Only if imm -> turn into ROTR.
86 // Can't handle RRX here, because it would require folding a flag into
87 // the addressing mode. :( This causes us to miss certain things.
88 //case ARMISD::RRX: return ARM_AM::rrx;
89 }
90 }
91} // end namespace ARM_AM
92
94public:
96
97 const char *getTargetNodeName(unsigned Opcode) const override;
98
99 bool isTargetMemoryOpcode(unsigned Opcode) const override;
100
101 void verifyTargetNode(const SelectionDAG &DAG,
102 const SDNode *N) const override;
103
105 SDValue Chain, SDValue Dst, SDValue Src,
106 SDValue Size, Align Alignment,
107 bool isVolatile, bool AlwaysInline,
108 MachinePointerInfo DstPtrInfo,
109 MachinePointerInfo SrcPtrInfo) const override;
110
111 SDValue
112 EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain,
113 SDValue Dst, SDValue Src, SDValue Size,
114 Align Alignment, bool isVolatile,
115 MachinePointerInfo DstPtrInfo,
116 MachinePointerInfo SrcPtrInfo) const override;
117
118 // Adjust parameters for memset, see RTABI section 4.3.4
120 SDValue Chain, SDValue Op1, SDValue Op2,
121 SDValue Op3, Align Alignment, bool isVolatile,
122 bool AlwaysInline,
123 MachinePointerInfo DstPtrInfo) const override;
124
126 SDValue Chain, SDValue Dst, SDValue Src,
127 SDValue Size, unsigned Align,
128 RTLIB::Libcall LC) const;
129};
130
131} // namespace llvm
132
133#endif
const char * getTargetNodeName(unsigned Opcode) const override
Returns the name of the given target-specific opcode, suitable for debug printing.
SDValue EmitSpecializedLibcall(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, RTLIB::Libcall LC) const
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Op1, SDValue Op2, SDValue Op3, Align Alignment, bool isVolatile, bool AlwaysInline, MachinePointerInfo DstPtrInfo) const override
Emit target-specific code that performs a memset.
SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, Align Alignment, bool isVolatile, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override
Emit target-specific code that performs a memcpy.
SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, Align Alignment, bool isVolatile, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override
Emit target-specific code that performs a memmove.
void verifyTargetNode(const SelectionDAG &DAG, const SDNode *N) const override
Checks that the given target-specific node is valid. Aborts if it is not.
bool isTargetMemoryOpcode(unsigned Opcode) const override
Returns true if a node with the given target-specific opcode has a memory operand.
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.
SelectionDAGGenTargetInfo(const SDNodeInfo &GenNodeInfo)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
ARM_AM - ARM Addressing Mode Stuff.
static ShiftOpc getShiftOpcForNode(unsigned Opcode)
@ SHL
Shift and rotation operations.
Definition ISDOpcodes.h:762
This is an optimization pass for GlobalISel generic memory operations.
#define N
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
This class contains a discriminated union of information about pointers in memory operands,...