Path: blob/main/contrib/llvm-project/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.h
96383 views
//===-- RISCVRegisterBankInfo.h ---------------------------------*- C++ -*-===//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/// \file8/// This file declares the targeting of the RegisterBankInfo class for RISC-V.9/// \todo This should be generated by TableGen.10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_RISCV_RISCVREGISTERBANKINFO_H13#define LLVM_LIB_TARGET_RISCV_RISCVREGISTERBANKINFO_H1415#include "llvm/CodeGen/RegisterBankInfo.h"1617#define GET_REGBANK_DECLARATIONS18#include "RISCVGenRegisterBank.inc"1920namespace llvm {2122class TargetRegisterInfo;2324class RISCVGenRegisterBankInfo : public RegisterBankInfo {25protected:26#define GET_TARGET_REGBANK_CLASS27#include "RISCVGenRegisterBank.inc"28};2930/// This class provides the information for the target register banks.31class RISCVRegisterBankInfo final : public RISCVGenRegisterBankInfo {32public:33RISCVRegisterBankInfo(unsigned HwMode);3435const RegisterBank &getRegBankFromRegClass(const TargetRegisterClass &RC,36LLT Ty) const override;3738const InstructionMapping &39getInstrMapping(const MachineInstr &MI) const override;4041private:42/// \returns true if \p MI only uses and defines FPRs.43bool hasFPConstraints(const MachineInstr &MI, const MachineRegisterInfo &MRI,44const TargetRegisterInfo &TRI) const;4546/// \returns true if \p MI only uses FPRs.47bool onlyUsesFP(const MachineInstr &MI, const MachineRegisterInfo &MRI,48const TargetRegisterInfo &TRI) const;4950/// \returns true if any use of \p Def only user FPRs.51bool anyUseOnlyUseFP(Register Def, const MachineRegisterInfo &MRI,52const TargetRegisterInfo &TRI) const;5354/// \returns true if \p MI only defines FPRs.55bool onlyDefinesFP(const MachineInstr &MI, const MachineRegisterInfo &MRI,56const TargetRegisterInfo &TRI) const;57};58} // end namespace llvm59#endif606162