blob: 337a85cdf22dade7207979b00d6a08b5e75f1585 [file] [log] [blame]
Misha Brukmanbc9ccf62005-02-04 20:25:52 +00001//===- AlphaInstrInfo.h - Alpha Instruction Information ---------*- C++ -*-===//
Misha Brukman4633f1c2005-04-21 23:13:11 +00002//
Andrew Lenharth304d0f32005-01-22 23:41:55 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman4633f1c2005-04-21 23:13:11 +00007//
Andrew Lenharth304d0f32005-01-22 23:41:55 +00008//===----------------------------------------------------------------------===//
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
Evan Cheng4db3cff2011-07-01 17:57:27 +000020#define GET_INSTRINFO_HEADER
21#include "AlphaGenInstrInfo.inc"
22
Andrew Lenharth304d0f32005-01-22 23:41:55 +000023namespace llvm {
24
Evan Cheng4db3cff2011-07-01 17:57:27 +000025class AlphaInstrInfo : public AlphaGenInstrInfo {
Andrew Lenharth304d0f32005-01-22 23:41:55 +000026 const AlphaRegisterInfo RI;
27public:
28 AlphaInstrInfo();
29
30 /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
31 /// such, whenever a client has an instance of instruction info, it should
32 /// always be able to get register info as well (through this method).
33 ///
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000034 virtual const AlphaRegisterInfo &getRegisterInfo() const { return RI; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000035
Dan Gohmancbad42c2008-11-18 19:49:32 +000036 virtual unsigned isLoadFromStackSlot(const MachineInstr *MI,
37 int &FrameIndex) const;
38 virtual unsigned isStoreToStackSlot(const MachineInstr *MI,
39 int &FrameIndex) const;
Chris Lattner0476b282006-10-24 16:41:36 +000040
Evan Chengb5cdaa22007-05-18 00:05:48 +000041 virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
Stuart Hastings3bf91252010-06-17 22:43:56 +000042 MachineBasicBlock *FBB,
43 const SmallVectorImpl<MachineOperand> &Cond,
44 DebugLoc DL) const;
Jakob Stoklund Olesen99666a32010-07-11 01:08:23 +000045 virtual void copyPhysReg(MachineBasicBlock &MBB,
46 MachineBasicBlock::iterator MI, DebugLoc DL,
47 unsigned DestReg, unsigned SrcReg,
48 bool KillSrc) const;
Owen Andersonf6372aa2008-01-01 21:11:32 +000049 virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
50 MachineBasicBlock::iterator MBBI,
51 unsigned SrcReg, bool isKill, int FrameIndex,
Evan Cheng746ad692010-05-06 19:06:44 +000052 const TargetRegisterClass *RC,
53 const TargetRegisterInfo *TRI) const;
Owen Andersonf6372aa2008-01-01 21:11:32 +000054
Owen Andersonf6372aa2008-01-01 21:11:32 +000055 virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
56 MachineBasicBlock::iterator MBBI,
57 unsigned DestReg, int FrameIndex,
Evan Cheng746ad692010-05-06 19:06:44 +000058 const TargetRegisterClass *RC,
59 const TargetRegisterInfo *TRI) const;
Owen Anderson43dbe052008-01-07 01:35:02 +000060
Andrew Lenharthf81173f2006-10-31 16:49:55 +000061 bool AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
62 MachineBasicBlock *&FBB,
Evan Chengdc54d312009-02-09 07:14:22 +000063 SmallVectorImpl<MachineOperand> &Cond,
64 bool AllowModify) const;
Evan Chengb5cdaa22007-05-18 00:05:48 +000065 unsigned RemoveBranch(MachineBasicBlock &MBB) const;
Andrew Lenharthf81173f2006-10-31 16:49:55 +000066 void insertNoop(MachineBasicBlock &MBB,
67 MachineBasicBlock::iterator MI) const;
Owen Anderson44eb65c2008-08-14 22:49:33 +000068 bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const;
Dan Gohman99114052009-06-03 20:30:14 +000069
70 /// getGlobalBaseReg - Return a virtual register initialized with the
71 /// the global base register value. Output instructions required to
72 /// initialize the register in the function entry block, if necessary.
73 ///
74 unsigned getGlobalBaseReg(MachineFunction *MF) const;
75
76 /// getGlobalRetAddr - Return a virtual register initialized with the
77 /// the global return address register value. Output instructions required to
78 /// initialize the register in the function entry block, if necessary.
79 ///
80 unsigned getGlobalRetAddr(MachineFunction *MF) const;
Andrew Lenharth304d0f32005-01-22 23:41:55 +000081};
82
83}
84
85#endif