LLVM  14.0.0git
Mips16ISelDAGToDAG.h
Go to the documentation of this file.
1 //===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===//
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 MipsDAGToDAGISel specialized for mips16.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
14 #define LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
15 
16 #include "MipsISelDAGToDAG.h"
17 
18 namespace llvm {
19 
21 public:
23  : MipsDAGToDAGISel(TM, OL) {}
24 
25 private:
26  std::pair<SDNode *, SDNode *> selectMULT(SDNode *N, unsigned Opc,
27  const SDLoc &DL, EVT Ty, bool HasLo,
28  bool HasHi);
29 
30  bool runOnMachineFunction(MachineFunction &MF) override;
31 
32  bool selectAddr(bool SPAllowed, SDValue Addr, SDValue &Base,
33  SDValue &Offset);
34  bool selectAddr16(SDValue Addr, SDValue &Base,
35  SDValue &Offset) override;
36  bool selectAddr16SP(SDValue Addr, SDValue &Base,
37  SDValue &Offset) override;
38 
39  bool trySelect(SDNode *Node) override;
40 
41  void processFunctionAfterISel(MachineFunction &MF) override;
42 
43  // Insert instructions to initialize the global base register in the
44  // first MBB of the function.
45  void initGlobalBaseReg(MachineFunction &MF);
46 
47  void initMips16SPAliasReg(MachineFunction &MF);
48 };
49 
50 FunctionPass *createMips16ISelDag(MipsTargetMachine &TM,
51  CodeGenOpt::Level OptLevel);
52 }
53 
54 #endif
llvm::MipsTargetMachine
Definition: MipsTargetMachine.h:27
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::SelectionDAGISel::TM
TargetMachine & TM
Definition: SelectionDAGISel.h:41
llvm::SDLoc
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Definition: SelectionDAGNodes.h:1085
llvm::SDNode
Represents one node in the SelectionDAG.
Definition: SelectionDAGNodes.h:454
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:35
llvm::MipsDAGToDAGISel
Definition: MipsISelDAGToDAG.h:31
llvm::Mips16DAGToDAGISel::Mips16DAGToDAGISel
Mips16DAGToDAGISel(MipsTargetMachine &TM, CodeGenOpt::Level OL)
Definition: Mips16ISelDAGToDAG.h:22
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:80
llvm::MachineFunction
Definition: MachineFunction.h:234
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
Node
Definition: ItaniumDemangle.h:235
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::Mips16DAGToDAGISel
Definition: Mips16ISelDAGToDAG.h:20
llvm::SelectionDAGISel::MF
MachineFunction * MF
Definition: SelectionDAGISel.h:45
llvm::SDValue
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
Definition: SelectionDAGNodes.h:137
MipsISelDAGToDAG.h
N
#define N
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::createMips16ISelDag
FunctionPass * createMips16ISelDag(MipsTargetMachine &TM, CodeGenOpt::Level OptLevel)
Definition: Mips16ISelDAGToDAG.cpp:222
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58