LLVM  3.7.0
MSP430InstrInfo.h
Go to the documentation of this file.
1 //===-- MSP430InstrInfo.h - MSP430 Instruction Information ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the MSP430 implementation of the TargetInstrInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
15 #define LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
16 
17 #include "MSP430RegisterInfo.h"
19 
20 #define GET_INSTRINFO_HEADER
21 #include "MSP430GenInstrInfo.inc"
22 
23 namespace llvm {
24 
25 class MSP430Subtarget;
26 
27 /// MSP430II - This namespace holds all of the target specific flags that
28 /// instruction info tracks.
29 ///
30 namespace MSP430II {
31  enum {
32  SizeShift = 2,
34 
40  };
41 }
42 
44  const MSP430RegisterInfo RI;
45  virtual void anchor();
46 public:
47  explicit MSP430InstrInfo(MSP430Subtarget &STI);
48 
49  /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
50  /// such, whenever a client has an instance of instruction info, it should
51  /// always be able to get register info as well (through this method).
52  ///
53  const TargetRegisterInfo &getRegisterInfo() const { return RI; }
54 
57  unsigned DestReg, unsigned SrcReg,
58  bool KillSrc) const override;
59 
62  unsigned SrcReg, bool isKill,
63  int FrameIndex,
64  const TargetRegisterClass *RC,
65  const TargetRegisterInfo *TRI) const override;
68  unsigned DestReg, int FrameIdx,
69  const TargetRegisterClass *RC,
70  const TargetRegisterInfo *TRI) const override;
71 
72  unsigned GetInstSizeInBytes(const MachineInstr *MI) const;
73 
74  // Branch folding goodness
75  bool
77  bool isUnpredicatedTerminator(const MachineInstr *MI) const override;
81  bool AllowModify) const override;
82 
83  unsigned RemoveBranch(MachineBasicBlock &MBB) const override;
86  DebugLoc DL) const override;
87 
88 };
89 
90 }
91 
92 #endif
bool ReverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
bool isUnpredicatedTerminator(const MachineInstr *MI) const override
A debug info location.
Definition: DebugLoc.h:34
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
const TargetRegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APInt.h:33
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:31
unsigned GetInstSizeInBytes(const MachineInstr *MI) const
GetInstSize - Return the number of bytes of code the specified instruction may be.
bundle_iterator - MachineBasicBlock iterator that automatically skips over MIs that are inside bundle...
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
MSP430InstrInfo(MSP430Subtarget &STI)
Representation of each machine instruction.
Definition: MachineInstr.h:51
unsigned RemoveBranch(MachineBasicBlock &MBB) const override
#define I(x, y, z)
Definition: MD5.cpp:54
unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, DebugLoc DL) const override
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override