Path: blob/main/contrib/llvm-project/llvm/lib/Target/ARC/ARCInstrInfo.h
35269 views
//===- ARCInstrInfo.h - ARC 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 ARC implementation of the TargetInstrInfo class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_ARC_ARCINSTRINFO_H13#define LLVM_LIB_TARGET_ARC_ARCINSTRINFO_H1415#include "ARCRegisterInfo.h"16#include "llvm/CodeGen/TargetInstrInfo.h"1718#define GET_INSTRINFO_HEADER19#include "ARCGenInstrInfo.inc"2021namespace llvm {2223class ARCSubtarget;2425class ARCInstrInfo : public ARCGenInstrInfo {26const ARCRegisterInfo RI;27virtual void anchor();2829public:30ARCInstrInfo(const ARCSubtarget &);3132const ARCRegisterInfo &getRegisterInfo() const { return RI; }3334/// If the specified machine instruction is a direct35/// load from a stack slot, return the virtual or physical register number of36/// the destination along with the FrameIndex of the loaded stack slot. If37/// not, return 0. This predicate must return 0 if the instruction has38/// any side effects other than loading from the stack slot.39Register isLoadFromStackSlot(const MachineInstr &MI,40int &FrameIndex) const override;4142/// If the specified machine instruction is a direct43/// store to a stack slot, return the virtual or physical register number of44/// the source reg along with the FrameIndex of the loaded stack slot. If45/// not, return 0. This predicate must return 0 if the instruction has46/// any side effects other than storing to the stack slot.47Register isStoreToStackSlot(const MachineInstr &MI,48int &FrameIndex) const override;4950unsigned getInstSizeInBytes(const MachineInstr &MI) const override;5152bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,53MachineBasicBlock *&FBB,54SmallVectorImpl<MachineOperand> &Cond,55bool AllowModify) const override;5657unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,58MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,59const DebugLoc &,60int *BytesAdded = nullptr) const override;6162unsigned removeBranch(MachineBasicBlock &MBB,63int *BytesRemoved = nullptr) const override;6465void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,66const DebugLoc &, MCRegister DestReg, MCRegister SrcReg,67bool KillSrc) const override;6869void storeRegToStackSlot(MachineBasicBlock &MBB,70MachineBasicBlock::iterator MI, Register SrcReg,71bool IsKill, int FrameIndex,72const TargetRegisterClass *RC,73const TargetRegisterInfo *TRI,74Register VReg) const override;7576void loadRegFromStackSlot(MachineBasicBlock &MBB,77MachineBasicBlock::iterator MI, Register DestReg,78int FrameIndex, const TargetRegisterClass *RC,79const TargetRegisterInfo *TRI,80Register VReg) const override;8182bool83reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;848586bool isPostIncrement(const MachineInstr &MI) const override;8788// ARC-specific89bool isPreIncrement(const MachineInstr &MI) const;9091virtual bool getBaseAndOffsetPosition(const MachineInstr &MI,92unsigned &BasePos,93unsigned &OffsetPos) const override;9495// Emit code before MBBI to load immediate value into physical register Reg.96// Returns an iterator to the new instruction.97MachineBasicBlock::iterator loadImmediate(MachineBasicBlock &MBB,98MachineBasicBlock::iterator MI,99unsigned Reg, uint64_t Value) const;100};101102} // end namespace llvm103104#endif // LLVM_LIB_TARGET_ARC_ARCINSTRINFO_H105106107