Misha Brukman | bc9ccf6 | 2005-02-04 20:25:52 +0000 | [diff] [blame] | 1 | //===- AlphaInstrInfo.h - Alpha Instruction Information ---------*- C++ -*-===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 2 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 7 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the Alpha implementation of the TargetInstrInfo class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef ALPHAINSTRUCTIONINFO_H |
| 15 | #define ALPHAINSTRUCTIONINFO_H |
| 16 | |
| 17 | #include "llvm/Target/TargetInstrInfo.h" |
| 18 | #include "AlphaRegisterInfo.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | class AlphaInstrInfo : public TargetInstrInfo { |
| 23 | const AlphaRegisterInfo RI; |
| 24 | public: |
| 25 | AlphaInstrInfo(); |
| 26 | |
| 27 | /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As |
| 28 | /// such, whenever a client has an instance of instruction info, it should |
| 29 | /// always be able to get register info as well (through this method). |
| 30 | /// |
| 31 | virtual const MRegisterInfo &getRegisterInfo() const { return RI; } |
| 32 | |
| 33 | /// Return true if the instruction is a register to register move and |
| 34 | /// leave the source and dest operands in the passed parameters. |
| 35 | /// |
| 36 | virtual bool isMoveInstr(const MachineInstr &MI, |
| 37 | unsigned &SrcReg, unsigned &DstReg) const; |
Chris Lattner | 4083960 | 2006-02-02 20:12:32 +0000 | [diff] [blame] | 38 | |
| 39 | virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const; |
Andrew Lenharth | 133d310 | 2006-02-03 03:07:37 +0000 | [diff] [blame] | 40 | virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const; |
Chris Lattner | 0476b28 | 2006-10-24 16:41:36 +0000 | [diff] [blame] | 41 | |
Evan Cheng | b5cdaa2 | 2007-05-18 00:05:48 +0000 | [diff] [blame] | 42 | virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, |
Chris Lattner | 0476b28 | 2006-10-24 16:41:36 +0000 | [diff] [blame] | 43 | MachineBasicBlock *FBB, |
| 44 | const std::vector<MachineOperand> &Cond) const; |
Owen Anderson | d10fd97 | 2007-12-31 06:32:00 +0000 | [diff] [blame^] | 45 | virtual void copyRegToReg(MachineBasicBlock &MBB, |
| 46 | MachineBasicBlock::iterator MI, |
| 47 | unsigned DestReg, unsigned SrcReg, |
| 48 | const TargetRegisterClass *DestRC, |
| 49 | const TargetRegisterClass *SrcRC) const; |
Andrew Lenharth | f81173f | 2006-10-31 16:49:55 +0000 | [diff] [blame] | 50 | bool AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB, |
| 51 | MachineBasicBlock *&FBB, |
| 52 | std::vector<MachineOperand> &Cond) const; |
Evan Cheng | b5cdaa2 | 2007-05-18 00:05:48 +0000 | [diff] [blame] | 53 | unsigned RemoveBranch(MachineBasicBlock &MBB) const; |
Andrew Lenharth | f81173f | 2006-10-31 16:49:55 +0000 | [diff] [blame] | 54 | void insertNoop(MachineBasicBlock &MBB, |
| 55 | MachineBasicBlock::iterator MI) const; |
| 56 | bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const; |
| 57 | bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | } |
| 61 | |
| 62 | #endif |