[InstCombine] Signed saturation patterns
[llvm-core.git] / lib / Target / Mips / Mips16ISelDAGToDAG.h
blob1ef194029f50990c339db77220892b75a0001fb6
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.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
14 #define LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
16 #include "MipsISelDAGToDAG.h"
18 namespace llvm {
20 class Mips16DAGToDAGISel : public MipsDAGToDAGISel {
21 public:
22 explicit Mips16DAGToDAGISel(MipsTargetMachine &TM, CodeGenOpt::Level OL)
23 : MipsDAGToDAGISel(TM, OL) {}
25 private:
26 std::pair<SDNode *, SDNode *> selectMULT(SDNode *N, unsigned Opc,
27 const SDLoc &DL, EVT Ty, bool HasLo,
28 bool HasHi);
30 bool runOnMachineFunction(MachineFunction &MF) override;
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;
39 bool trySelect(SDNode *Node) override;
41 void processFunctionAfterISel(MachineFunction &MF) override;
43 // Insert instructions to initialize the global base register in the
44 // first MBB of the function.
45 void initGlobalBaseReg(MachineFunction &MF);
47 void initMips16SPAliasReg(MachineFunction &MF);
50 FunctionPass *createMips16ISelDag(MipsTargetMachine &TM,
51 CodeGenOpt::Level OptLevel);
54 #endif