Path: blob/main/contrib/llvm-project/llvm/lib/Target/Xtensa/XtensaInstrInfo.h
35271 views
//===-- XtensaInstrInfo.h - Xtensa Instruction Information ------*- C++ -*-===//1//2// The LLVM Compiler Infrastructure3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9//10// This file contains the Xtensa implementation of the TargetInstrInfo class.11//12//===----------------------------------------------------------------------===//1314#ifndef LLVM_LIB_TARGET_XTENSA_XTENSAINSTRINFO_H15#define LLVM_LIB_TARGET_XTENSA_XTENSAINSTRINFO_H1617#include "Xtensa.h"18#include "XtensaRegisterInfo.h"19#include "llvm/CodeGen/TargetInstrInfo.h"20#include "llvm/CodeGen/TargetRegisterInfo.h"2122#define GET_INSTRINFO_HEADER2324#include "XtensaGenInstrInfo.inc"2526namespace llvm {2728class XtensaTargetMachine;29class XtensaSubtarget;30class XtensaInstrInfo : public XtensaGenInstrInfo {31const XtensaRegisterInfo RI;32const XtensaSubtarget &STI;3334public:35XtensaInstrInfo(const XtensaSubtarget &STI);3637void adjustStackPtr(unsigned SP, int64_t Amount, MachineBasicBlock &MBB,38MachineBasicBlock::iterator I) const;3940// Return the XtensaRegisterInfo, which this class owns.41const XtensaRegisterInfo &getRegisterInfo() const { return RI; }4243Register isLoadFromStackSlot(const MachineInstr &MI,44int &FrameIndex) const override;4546Register isStoreToStackSlot(const MachineInstr &MI,47int &FrameIndex) const override;4849void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,50const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,51bool KillSrc) const override;5253void storeRegToStackSlot(MachineBasicBlock &MBB,54MachineBasicBlock::iterator MBBI, Register SrcReg,55bool isKill, int FrameIndex,56const TargetRegisterClass *RC,57const TargetRegisterInfo *TRI,58Register VReg) const override;5960void loadRegFromStackSlot(MachineBasicBlock &MBB,61MachineBasicBlock::iterator MBBI, Register DestReg,62int FrameIdx, const TargetRegisterClass *RC,63const TargetRegisterInfo *TRI,64Register VReg) const override;6566// Get the load and store opcodes for a given register class and offset.67void getLoadStoreOpcodes(const TargetRegisterClass *RC, unsigned &LoadOpcode,68unsigned &StoreOpcode, int64_t offset) const;6970// Emit code before MBBI in MI to move immediate value Value into71// physical register Reg.72void loadImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,73unsigned *Reg, int64_t Value) const;7475const XtensaSubtarget &getSubtarget() const { return STI; }76};77} // end namespace llvm7879#endif /* LLVM_LIB_TARGET_XTENSA_XTENSAINSTRINFO_H */808182