Path: blob/main/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYInstrInfo.h
35267 views
//===-- CSKYInstrInfo.h - CSKY Instruction Information --------*- 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//8// This file contains the CSKY implementation of the TargetInstrInfo class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_CSKY_CSKYINSTRINFO_H13#define LLVM_LIB_TARGET_CSKY_CSKYINSTRINFO_H1415#include "MCTargetDesc/CSKYMCTargetDesc.h"16#include "llvm/CodeGen/TargetInstrInfo.h"1718#define GET_INSTRINFO_HEADER19#include "CSKYGenInstrInfo.inc"2021namespace llvm {2223class CSKYSubtarget;2425class CSKYInstrInfo : public CSKYGenInstrInfo {26bool v2sf;27bool v2df;28bool v3sf;29bool v3df;3031protected:32const CSKYSubtarget &STI;3334public:35explicit CSKYInstrInfo(CSKYSubtarget &STI);3637Register isLoadFromStackSlot(const MachineInstr &MI,38int &FrameIndex) const override;39Register isStoreToStackSlot(const MachineInstr &MI,40int &FrameIndex) const override;4142void storeRegToStackSlot(MachineBasicBlock &MBB,43MachineBasicBlock::iterator MI, Register SrcReg,44bool IsKill, int FrameIndex,45const TargetRegisterClass *RC,46const TargetRegisterInfo *TRI,47Register VReg) const override;4849void loadRegFromStackSlot(MachineBasicBlock &MBB,50MachineBasicBlock::iterator MI, Register DestReg,51int FrameIndex, const TargetRegisterClass *RC,52const TargetRegisterInfo *TRI,53Register VReg) const override;5455void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,56const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,57bool KillSrc) const override;5859unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,60MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,61const DebugLoc &DL,62int *BytesAdded = nullptr) const override;6364bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,65MachineBasicBlock *&FBB,66SmallVectorImpl<MachineOperand> &Cond,67bool AllowModify = false) const override;6869unsigned removeBranch(MachineBasicBlock &MBB,70int *BytesRemoved = nullptr) const override;7172bool73reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;7475MachineBasicBlock *getBranchDestBlock(const MachineInstr &MI) const override;7677unsigned getInstSizeInBytes(const MachineInstr &MI) const override;7879Register getGlobalBaseReg(MachineFunction &MF) const;8081// Materializes the given integer Val into DstReg.82Register movImm(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,83const DebugLoc &DL, uint64_t Val,84MachineInstr::MIFlag Flag = MachineInstr::NoFlags) const;85};8687} // namespace llvm8889#endif // LLVM_LIB_TARGET_CSKY_CSKYINSTRINFO_H909192