LLVM 23.0.0git
MSP430InstrInfo.h
Go to the documentation of this file.
1//===-- MSP430InstrInfo.h - MSP430 Instruction Information ------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the MSP430 implementation of the TargetInstrInfo class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
14#define LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
15
16#include "MSP430RegisterInfo.h"
18
19#define GET_INSTRINFO_HEADER
20#include "MSP430GenInstrInfo.inc"
21
22namespace llvm {
23
24class MSP430Subtarget;
25
27 const MSP430RegisterInfo RI;
28 virtual void anchor();
29public:
30 explicit MSP430InstrInfo(const MSP430Subtarget &STI);
31
32 /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
33 /// such, whenever a client has an instance of instruction info, it should
34 /// always be able to get register info as well (through this method).
35 ///
36 const MSP430RegisterInfo &getRegisterInfo() const { return RI; }
37
39 const DebugLoc &DL, Register DestReg, Register SrcReg,
40 bool KillSrc, bool RenamableDest = false,
41 bool RenamableSrc = false) const override;
42
45 bool isKill, int FrameIndex, const TargetRegisterClass *RC, Register VReg,
46 MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
49 int FrameIdx, const TargetRegisterClass *RC, Register VReg,
50 unsigned SubReg = 0,
51 MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
52
53 unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
54
55 // Branch folding goodness
56 bool
61 bool AllowModify) const override;
62
64 int *BytesRemoved = nullptr) const override;
67 const DebugLoc &DL,
68 int *BytesAdded = nullptr) const override;
69
70 int64_t getFramePoppedByCallee(const MachineInstr &I) const {
71 assert(isFrameInstr(I) && "Not a frame instruction");
72 assert(I.getOperand(1).getImm() >= 0 && "Size must not be negative");
73 return I.getOperand(1).getImm();
74 }
75};
76
77}
78
79#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:57
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
A debug info location.
Definition DebugLoc.h:126
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIdx, const TargetRegisterClass *RC, Register VReg, unsigned SubReg=0, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
GetInstSize - Return the number of bytes of code the specified instruction may be.
const MSP430RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
MSP430InstrInfo(const MSP430Subtarget &STI)
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
int64_t getFramePoppedByCallee(const MachineInstr &I) const
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is an optimization pass for GlobalISel generic memory operations.
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58