LLVM 19.0.0git
XtensaISelLowering.h
Go to the documentation of this file.
1//===- XtensaISelLowering.h - Xtensa DAG Lowering Interface -----*- 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 interfaces that Xtensa uses to lower LLVM code into a
10// selection DAG.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_XTENSA_XTENSAISELLOWERING_H
15#define LLVM_LIB_TARGET_XTENSA_XTENSAISELLOWERING_H
16
20
21namespace llvm {
22
23namespace XtensaISD {
24enum {
26
27 // Calls a function. Operand 0 is the chain operand and operand 1
28 // is the target address. The arguments start at operand 2.
29 // There is an optional glue operand at the end.
31
32 // Wraps a TargetGlobalAddress that should be loaded using PC-relative
33 // accesses. Operand 0 is the address.
35 RET
36};
37}
38
39class XtensaSubtarget;
40
42public:
44 const XtensaSubtarget &STI);
45
46 const char *getTargetNodeName(unsigned Opcode) const override;
47
48 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
49
51 bool isVarArg,
53 const SDLoc &DL, SelectionDAG &DAG,
54 SmallVectorImpl<SDValue> &InVals) const override;
55
57 SmallVectorImpl<SDValue> &InVals) const override;
58
60 bool isVarArg,
62 LLVMContext &Context) const override;
63
64 SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
66 const SmallVectorImpl<SDValue> &OutVals, const SDLoc &DL,
67 SelectionDAG &DAG) const override;
68
69 const XtensaSubtarget &getSubtarget() const { return Subtarget; }
70
71private:
72 const XtensaSubtarget &Subtarget;
73
74 SDValue LowerImmediate(SDValue Op, SelectionDAG &DAG) const;
75
76 SDValue LowerConstantPool(ConstantPoolSDNode *CP, SelectionDAG &DAG) const;
77
78 SDValue getAddrPCRel(SDValue Op, SelectionDAG &DAG) const;
79
80 CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const;
81};
82
83} // end namespace llvm
84
85#endif /* LLVM_LIB_TARGET_XTENSA_XTENSAISELLOWERING_H */
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
LLVMContext & Context
const char LLVMTargetMachineRef TM
This file describes how to lower LLVM code to machine code.
This class represents an Operation in the Expression.
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:225
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:586
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:76
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, const SDLoc &DL, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array,...
SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower calls into the specified DAG.
const XtensaSubtarget & getSubtarget() const
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SDLoc &DL, SelectionDAG &DAG) const override
This hook must be implemented to lower outgoing return values, described by the Outs array,...
bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, LLVMContext &Context) const override
This hook should be implemented to check whether the return values described by the Outs array can fi...
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
@ BUILTIN_OP_END
BUILTIN_OP_END - This must be the last enum value in this list.
Definition: ISDOpcodes.h:1407
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change.
This structure contains all information that is necessary for lowering calls.