38 #define DEBUG_TYPE "mips-isel" 60 processFunctionAfterISel(MF);
82 bool MipsDAGToDAGISel::selectAddrDefault(
SDValue Addr,
SDValue &Base,
94 bool MipsDAGToDAGISel::selectIntAddr11MM(
SDValue Addr,
SDValue &Base,
100 bool MipsDAGToDAGISel::selectIntAddr12MM(
SDValue Addr,
SDValue &Base,
106 bool MipsDAGToDAGISel::selectIntAddr16MM(
SDValue Addr,
SDValue &Base,
112 bool MipsDAGToDAGISel::selectIntAddrLSL2MM(
SDValue Addr,
SDValue &Base,
118 bool MipsDAGToDAGISel::selectIntAddrSImm10(
SDValue Addr,
SDValue &Base,
124 bool MipsDAGToDAGISel::selectIntAddrSImm10Lsl1(
SDValue Addr,
SDValue &Base,
130 bool MipsDAGToDAGISel::selectIntAddrSImm10Lsl2(
SDValue Addr,
SDValue &Base,
136 bool MipsDAGToDAGISel::selectIntAddrSImm10Lsl3(
SDValue Addr,
SDValue &Base,
148 bool MipsDAGToDAGISel::selectAddr16SP(
SDValue Addr,
SDValue &Base,
154 bool MipsDAGToDAGISel::selectVSplat(
SDNode *
N,
APInt &Imm,
155 unsigned MinSizeInBits)
const {
160 bool MipsDAGToDAGISel::selectVSplatUimm1(
SDValue N,
SDValue &Imm)
const {
165 bool MipsDAGToDAGISel::selectVSplatUimm2(
SDValue N,
SDValue &Imm)
const {
170 bool MipsDAGToDAGISel::selectVSplatUimm3(
SDValue N,
SDValue &Imm)
const {
175 bool MipsDAGToDAGISel::selectVSplatUimm4(
SDValue N,
SDValue &Imm)
const {
180 bool MipsDAGToDAGISel::selectVSplatUimm5(
SDValue N,
SDValue &Imm)
const {
185 bool MipsDAGToDAGISel::selectVSplatUimm6(
SDValue N,
SDValue &Imm)
const {
190 bool MipsDAGToDAGISel::selectVSplatUimm8(
SDValue N,
SDValue &Imm)
const {
195 bool MipsDAGToDAGISel::selectVSplatSimm5(
SDValue N,
SDValue &Imm)
const {
200 bool MipsDAGToDAGISel::selectVSplatUimmPow2(
SDValue N,
SDValue &Imm)
const {
205 bool MipsDAGToDAGISel::selectVSplatUimmInvPow2(
SDValue N,
SDValue &Imm)
const {
210 bool MipsDAGToDAGISel::selectVSplatMaskL(
SDValue N,
SDValue &Imm)
const {
215 bool MipsDAGToDAGISel::selectVSplatMaskR(
SDValue N,
SDValue &Imm)
const {
223 bool MipsDAGToDAGISel::selectVecAddAsVecSubIfProfitable(
SDNode *Node) {
227 assert(VT.isVector() &&
"Should only be called for vectors.");
236 APInt SplatValue, SplatUndef;
237 unsigned SplatBitSize;
240 if (!BVN->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
244 auto IsInlineConstant = [](
const APInt &Imm) {
return Imm.isIntN(5); };
246 if (IsInlineConstant(SplatValue))
249 APInt NegSplatValue = 0 - SplatValue;
250 if (!IsInlineConstant(NegSplatValue))
257 assert(NegC &&
"Constant-folding failed!");
267 void MipsDAGToDAGISel::Select(
SDNode *Node) {
286 selectVecAddAsVecSubIfProfitable(Node))
299 cast<MemSDNode>(Node)->getMemoryVT().getSizeInBits() / 8 <=
301 "Unexpected unaligned loads/stores.");
310 bool MipsDAGToDAGISel::
311 SelectInlineAsmMemoryOperand(
const SDValue &
Op,
unsigned ConstraintID,
312 std::vector<SDValue> &OutOps) {
314 switch(ConstraintID) {
320 OutOps.push_back(Op);
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
This class represents lattice values for constants.
bool isVector() const
Return true if this is a vector value type.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
void setNodeId(int Id)
Set unique node id.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
GlobalBaseReg - On Darwin, this node represents the result of the mflr at function entry...
static uint32_t getAlignment(const MCSectionCOFF &Sec)
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
const DataLayout & getDataLayout() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Simple integer binary arithmetic operators.
SDValue FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT, SDNode *N1, SDNode *N2)
const MipsSubtarget * Subtarget
Keep a pointer to the MipsSubtarget around so that we can make the right decision when generating cod...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const SDValue & getOperand(unsigned Num) const
Represent the analysis usage information of a pass.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void dump() const
Dump this node, for debugging.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
Class for arbitrary precision integers.
A "pseudo-class" with methods for operating on BUILD_VECTORs.
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
SDNode * getGlobalBaseReg()
getGlobalBaseReg - Output the instructions required to put the GOT address into a register...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
const TargetLowering * getTargetLowering() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getRegister(unsigned Reg, EVT VT)
void ReplaceNode(SDNode *F, SDNode *T)
Replace all uses of F with T, then remove F from the DAG.
bool systemSupportsUnalignedAccess() const
Does the system support unaligned memory access.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Wrapper class representing virtual and physical registers.