LLVM 22.0.0git
ARCISelLowering.h
Go to the documentation of this file.
1//===- ARCISelLowering.h - ARC 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 ARC uses to lower LLVM code into a
10// selection DAG.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_ARC_ARCISELLOWERING_H
15#define LLVM_LIB_TARGET_ARC_ARCISELLOWERING_H
16
17#include "ARC.h"
20
21namespace llvm {
22
23// Forward delcarations
24class ARCSubtarget;
26
27//===--------------------------------------------------------------------===//
28// TargetLowering Implementation
29//===--------------------------------------------------------------------===//
31public:
32 explicit ARCTargetLowering(const TargetMachine &TM,
33 const ARCSubtarget &Subtarget);
34
35 /// Provide custom lowering hooks for some operations.
36 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
37
38 /// Return true if the addressing mode represented by AM is legal for this
39 /// target, for a load/store of the specified type.
40 bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
41 unsigned AS,
42 Instruction *I = nullptr) const override;
43
44private:
45 const ARCSubtarget &Subtarget;
46
47 void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
48 SelectionDAG &DAG) const override;
49
50 // Lower Operand helpers
51 SDValue LowerCallArguments(SDValue Chain, CallingConv::ID CallConv,
52 bool isVarArg,
54 SDLoc dl, SelectionDAG &DAG,
55 SmallVectorImpl<SDValue> &InVals) const;
56 // Lower Operand specifics
57 SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
58 SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
59 SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
60 SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
61 SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const;
62 SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
63 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
64
65 SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
66 bool isVarArg,
68 const SDLoc &dl, SelectionDAG &DAG,
69 SmallVectorImpl<SDValue> &InVals) const override;
70
72 SmallVectorImpl<SDValue> &InVals) const override;
73
74 SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
76 const SmallVectorImpl<SDValue> &OutVals, const SDLoc &dl,
77 SelectionDAG &DAG) const override;
78
79 bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
80 bool isVarArg,
81 const SmallVectorImpl<ISD::OutputArg> &ArgsFlags,
82 LLVMContext &Context, const Type *RetTy) const override;
83
84 bool mayBeEmittedAsTailCall(const CallInst *CI) const override;
85};
86
87} // end namespace llvm
88
89#endif // LLVM_LIB_TARGET_ARC_ARCISELLOWERING_H
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Function Alias Analysis Results
#define I(x, y, z)
Definition MD5.cpp:58
This file describes how to lower LLVM code to machine code.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
Provide custom lowering hooks for some operations.
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
Return true if the addressing mode represented by AM is legal for this target, for a load/store of th...
ARCTargetLowering(const TargetMachine &TM, const ARCSubtarget &Subtarget)
This class represents a function call, abstracting a target machine's calling convention.
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:63
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
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.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
TargetLowering(const TargetLowering &)=delete
Primary interface to the complete machine description for the target machine.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op
#define N
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg + ScalableOffset*...
This structure contains all information that is necessary for lowering calls.