2007-12-04 22:35:58 +00:00
|
|
|
//===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-12-04 22:35:58 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2007-12-05 01:40:25 +00:00
|
|
|
// This file contains the CellSPU implementation of the TargetInstrInfo class.
|
2007-12-04 22:35:58 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPU_INSTRUCTIONINFO_H
|
|
|
|
#define SPU_INSTRUCTIONINFO_H
|
|
|
|
|
|
|
|
#include "SPU.h"
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
|
|
|
#include "SPURegisterInfo.h"
|
|
|
|
|
2011-07-01 17:57:27 +00:00
|
|
|
#define GET_INSTRINFO_HEADER
|
|
|
|
#include "SPUGenInstrInfo.inc"
|
|
|
|
|
2007-12-04 22:35:58 +00:00
|
|
|
namespace llvm {
|
|
|
|
//! Cell SPU instruction information class
|
2011-07-01 17:57:27 +00:00
|
|
|
class SPUInstrInfo : public SPUGenInstrInfo {
|
2007-12-04 22:35:58 +00:00
|
|
|
SPUTargetMachine &TM;
|
|
|
|
const SPURegisterInfo RI;
|
|
|
|
public:
|
2008-03-25 22:06:05 +00:00
|
|
|
explicit SPUInstrInfo(SPUTargetMachine &tm);
|
2007-12-04 22:35:58 +00:00
|
|
|
|
|
|
|
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
|
|
|
|
/// such, whenever a client has an instance of instruction info, it should
|
|
|
|
/// always be able to get register info as well (through this method).
|
|
|
|
///
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const SPURegisterInfo &getRegisterInfo() const { return RI; }
|
2007-12-04 22:35:58 +00:00
|
|
|
|
Various bits of framework needed for precise machine-level selection
DAG scheduling during isel. Most new functionality is currently
guarded by -enable-sched-cycles and -enable-sched-hazard.
Added InstrItineraryData::IssueWidth field, currently derived from
ARM itineraries, but could be initialized differently on other targets.
Added ScheduleHazardRecognizer::MaxLookAhead to indicate whether it is
active, and if so how many cycles of state it holds.
Added SchedulingPriorityQueue::HasReadyFilter to allowing gating entry
into the scheduler's available queue.
ScoreboardHazardRecognizer now accesses the ScheduleDAG in order to
get information about it's SUnits, provides RecedeCycle for bottom-up
scheduling, correctly computes scoreboard depth, tracks IssueCount, and
considers potential stall cycles when checking for hazards.
ScheduleDAGRRList now models machine cycles and hazards (under
flags). It tracks MinAvailableCycle, drives the hazard recognizer and
priority queue's ready filter, manages a new PendingQueue, properly
accounts for stall cycles, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 05:03:26 +00:00
|
|
|
ScheduleHazardRecognizer *
|
|
|
|
CreateTargetHazardRecognizer(const TargetMachine *TM,
|
|
|
|
const ScheduleDAG *DAG) const;
|
|
|
|
|
2008-11-18 19:49:32 +00:00
|
|
|
unsigned isLoadFromStackSlot(const MachineInstr *MI,
|
|
|
|
int &FrameIndex) const;
|
|
|
|
unsigned isStoreToStackSlot(const MachineInstr *MI,
|
|
|
|
int &FrameIndex) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2010-07-11 07:31:03 +00:00
|
|
|
virtual void copyPhysReg(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I, DebugLoc DL,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
|
|
|
bool KillSrc) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2008-01-01 21:11:32 +00:00
|
|
|
//! Store a register to a stack slot, based on its register class.
|
|
|
|
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned SrcReg, bool isKill, int FrameIndex,
|
2010-05-06 19:06:44 +00:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
2008-01-01 21:11:32 +00:00
|
|
|
|
|
|
|
//! Load a register from a stack slot, based on its register class.
|
|
|
|
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned DestReg, int FrameIndex,
|
2010-05-06 19:06:44 +00:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
2008-01-01 21:11:32 +00:00
|
|
|
|
2009-01-03 00:27:53 +00:00
|
|
|
//! Reverses a branch's condition, returning false on success.
|
|
|
|
virtual
|
|
|
|
bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const;
|
2008-12-10 00:15:19 +00:00
|
|
|
|
|
|
|
virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
|
2009-01-26 03:37:41 +00:00
|
|
|
MachineBasicBlock *&FBB,
|
2009-02-09 07:14:22 +00:00
|
|
|
SmallVectorImpl<MachineOperand> &Cond,
|
|
|
|
bool AllowModify) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2008-12-10 00:15:19 +00:00
|
|
|
virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
|
2009-01-03 00:27:53 +00:00
|
|
|
|
2008-12-10 00:15:19 +00:00
|
|
|
virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
2010-06-17 22:43:56 +00:00
|
|
|
MachineBasicBlock *FBB,
|
|
|
|
const SmallVectorImpl<MachineOperand> &Cond,
|
|
|
|
DebugLoc DL) const;
|
2008-12-10 00:15:19 +00:00
|
|
|
};
|
2007-12-04 22:35:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|