LLVM 23.0.0git
MipsSEISelLowering.h
Go to the documentation of this file.
1//===- MipsSEISelLowering.h - MipsSE 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// Subclass of MipsTargetLowering specialized for mips32/64.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
14#define LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
15
16#include "MipsISelLowering.h"
19
20namespace llvm {
21
23class MachineInstr;
24class MipsSubtarget;
26class SelectionDAG;
27class MCRegisterClass;
29
31 public:
32 explicit MipsSETargetLowering(const MipsTargetMachine &TM,
33 const MipsSubtarget &STI);
34
35 /// Enable MSA support for the given integer type and Register
36 /// class.
38
39 /// Enable MSA support for the given floating-point type and
40 /// Register class.
42 const TargetRegisterClass *RC);
43
45 EVT VT, unsigned AS = 0, Align Alignment = Align(1),
47 unsigned *Fast = nullptr) const override;
48
50 getPreferredVectorAction(MVT VT) const override;
51
52 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
53
54 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
55
58 MachineBasicBlock *MBB) const override;
59
60 bool isShuffleMaskLegal(ArrayRef<int> Mask, EVT VT) const override {
61 return false;
62 }
63
64 const TargetRegisterClass *getRepRegClassFor(MVT VT) const override;
65
66 private:
67 bool isEligibleForTailCallOptimization(
68 const CCState &CCInfo, unsigned NextStackOffset,
69 const MipsFunctionInfo &FI) const override;
70
71 void
72 getOpndList(SmallVectorImpl<SDValue> &Ops,
73 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
74 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
75 bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee,
76 SDValue Chain) const override;
77
78 SDValue lowerR5900FPOp(SDValue Op, SelectionDAG &DAG,
79 RTLIB::Libcall LC) const;
80 SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const;
81 SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const;
82 SDValue lowerBITCAST(SDValue Op, SelectionDAG &DAG) const;
83
84 SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
85 SelectionDAG &DAG) const;
86
87 SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
88 SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
89 SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
90 SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
92 /// Lower VECTOR_SHUFFLE into one of a number of instructions
93 /// depending on the indices in the shuffle.
98 SDValue lowerFP16_TO_FP(SDValue Op, SelectionDAG &DAG) const;
99 SDValue lowerFP_TO_FP16(SDValue Op, SelectionDAG &DAG) const;
100
101 MachineBasicBlock *emitBPOSGE32(MachineInstr &MI,
102 MachineBasicBlock *BB) const;
103 MachineBasicBlock *emitMSACBranchPseudo(MachineInstr &MI,
105 unsigned BranchOp) const;
106 /// Emit the COPY_FW pseudo instruction
107 MachineBasicBlock *emitCOPY_FW(MachineInstr &MI,
108 MachineBasicBlock *BB) const;
109 /// Emit the COPY_FD pseudo instruction
110 MachineBasicBlock *emitCOPY_FD(MachineInstr &MI,
111 MachineBasicBlock *BB) const;
112 /// Emit the INSERT_FW pseudo instruction
113 MachineBasicBlock *emitINSERT_FW(MachineInstr &MI,
114 MachineBasicBlock *BB) const;
115 /// Emit the INSERT_FD pseudo instruction
116 MachineBasicBlock *emitINSERT_FD(MachineInstr &MI,
117 MachineBasicBlock *BB) const;
118 /// Emit the INSERT_([BHWD]|F[WD])_VIDX pseudo instruction
119 MachineBasicBlock *emitINSERT_DF_VIDX(MachineInstr &MI,
121 unsigned EltSizeInBytes,
122 bool IsFP) const;
123 /// Emit the FILL_FW pseudo instruction
124 MachineBasicBlock *emitFILL_FW(MachineInstr &MI,
125 MachineBasicBlock *BB) const;
126 /// Emit the FILL_FD pseudo instruction
127 MachineBasicBlock *emitFILL_FD(MachineInstr &MI,
128 MachineBasicBlock *BB) const;
129 /// Emit the FEXP2_W_1 pseudo instructions.
130 MachineBasicBlock *emitFEXP2_W_1(MachineInstr &MI,
131 MachineBasicBlock *BB) const;
132 /// Emit the FEXP2_D_1 pseudo instructions.
133 MachineBasicBlock *emitFEXP2_D_1(MachineInstr &MI,
134 MachineBasicBlock *BB) const;
135 };
136
137} // end namespace llvm
138
139#endif // LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
MachineBasicBlock & MBB
IRTranslator LLVM IR MI
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static SDValue lowerSELECT(SDValue Op, SelectionDAG &DAG)
static SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG, const RISCVSubtarget &Subtarget)
static SDValue lowerINT_TO_FP(SDValue Op, SelectionDAG &DAG, const RISCVSubtarget &Subtarget)
static SDValue lowerFP_TO_INT(SDValue Op, SelectionDAG &DAG, const RISCVSubtarget &Subtarget)
static SDValue lowerVECTOR_SHUFFLE(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
Top-level lowering for x86 vector shuffles.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
CCState - This class holds information needed while lowering arguments and return values.
MCRegisterClass - Base class of TargetRegisterClass.
Machine Value Type.
Representation of each machine instruction.
Flags
Flags values. These may be or'd together.
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
bool isShuffleMaskLegal(ArrayRef< int > Mask, EVT VT) const override
Targets can use this to indicate that they only support some VECTOR_SHUFFLE operations,...
void addMSAFloatType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC)
Enable MSA support for the given floating-point type and Register class.
void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC)
Enable MSA support for the given integer type and Register class.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
const TargetRegisterClass * getRepRegClassFor(MVT VT) const override
Return the 'representative' register class for the specified value type.
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS=0, Align Alignment=Align(1), MachineMemOperand::Flags Flags=MachineMemOperand::MONone, unsigned *Fast=nullptr) const override
Determine if the target supports unaligned memory accesses.
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...
MipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
MipsTargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
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...
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
@ Fast
Attempts to make calls as fast as possible (e.g.
Definition CallingConv.h:41
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58
#define N
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Extended Value Type.
Definition ValueTypes.h:35