Path: blob/main/contrib/llvm-project/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h
35269 views
//===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// Subclass of MipsDAGToDAGISel specialized for mips16.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H13#define LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H1415#include "MipsISelDAGToDAG.h"1617namespace llvm {1819class Mips16DAGToDAGISel : public MipsDAGToDAGISel {20public:21explicit Mips16DAGToDAGISel(MipsTargetMachine &TM, CodeGenOptLevel OL)22: MipsDAGToDAGISel(TM, OL) {}2324private:25std::pair<SDNode *, SDNode *> selectMULT(SDNode *N, unsigned Opc,26const SDLoc &DL, EVT Ty, bool HasLo,27bool HasHi);2829bool runOnMachineFunction(MachineFunction &MF) override;3031bool selectAddr(bool SPAllowed, SDValue Addr, SDValue &Base,32SDValue &Offset);33bool selectAddr16(SDValue Addr, SDValue &Base,34SDValue &Offset) override;35bool selectAddr16SP(SDValue Addr, SDValue &Base,36SDValue &Offset) override;3738bool trySelect(SDNode *Node) override;3940void processFunctionAfterISel(MachineFunction &MF) override;4142// Insert instructions to initialize the global base register in the43// first MBB of the function.44void initGlobalBaseReg(MachineFunction &MF);4546void initMips16SPAliasReg(MachineFunction &MF);47};4849class Mips16DAGToDAGISelLegacy : public MipsDAGToDAGISelLegacy {50public:51explicit Mips16DAGToDAGISelLegacy(MipsTargetMachine &TM, CodeGenOptLevel OL);52};5354FunctionPass *createMips16ISelDag(MipsTargetMachine &TM,55CodeGenOptLevel OptLevel);56}5758#endif596061