mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21438 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
21bbf8d022
commit
00876a2808
@ -243,7 +243,7 @@ public:
|
|||||||
|
|
||||||
void MarkVirtRegAliveInBlock(VarInfo &VRInfo, MachineBasicBlock *BB);
|
void MarkVirtRegAliveInBlock(VarInfo &VRInfo, MachineBasicBlock *BB);
|
||||||
void HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB,
|
void HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB,
|
||||||
MachineInstr *MI);
|
MachineInstr *MI);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@ -61,8 +61,8 @@ public:
|
|||||||
void removeNodeFromList(MachineBasicBlock* N);
|
void removeNodeFromList(MachineBasicBlock* N);
|
||||||
void transferNodesFromList(iplist<MachineBasicBlock,
|
void transferNodesFromList(iplist<MachineBasicBlock,
|
||||||
ilist_traits<MachineBasicBlock> > &toList,
|
ilist_traits<MachineBasicBlock> > &toList,
|
||||||
ilist_iterator<MachineBasicBlock> first,
|
ilist_iterator<MachineBasicBlock> first,
|
||||||
ilist_iterator<MachineBasicBlock> last);
|
ilist_iterator<MachineBasicBlock> last);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// MachineFunctionInfo - This class can be derived from and used by targets to
|
/// MachineFunctionInfo - This class can be derived from and used by targets to
|
||||||
|
@ -43,29 +43,29 @@ typedef short MachineOpCode;
|
|||||||
// first and initialize each one later.
|
// first and initialize each one later.
|
||||||
//
|
//
|
||||||
// E.g, for this VM instruction:
|
// E.g, for this VM instruction:
|
||||||
// ptr = alloca type, numElements
|
// ptr = alloca type, numElements
|
||||||
// we generate 2 machine instructions on the SPARC:
|
// we generate 2 machine instructions on the SPARC:
|
||||||
//
|
//
|
||||||
// mul Constant, Numelements -> Reg
|
// mul Constant, Numelements -> Reg
|
||||||
// add %sp, Reg -> Ptr
|
// add %sp, Reg -> Ptr
|
||||||
//
|
//
|
||||||
// Each instruction has 3 operands, listed above. Of those:
|
// Each instruction has 3 operands, listed above. Of those:
|
||||||
// - Reg, NumElements, and Ptr are of operand type MO_Register.
|
// - Reg, NumElements, and Ptr are of operand type MO_Register.
|
||||||
// - Constant is of operand type MO_SignExtendedImmed on the SPARC.
|
// - Constant is of operand type MO_SignExtendedImmed on the SPARC.
|
||||||
//
|
//
|
||||||
// For the register operands, the virtual register type is as follows:
|
// For the register operands, the virtual register type is as follows:
|
||||||
//
|
|
||||||
// - Reg will be of virtual register type MO_MInstrVirtualReg. The field
|
|
||||||
// MachineInstr* minstr will point to the instruction that computes reg.
|
|
||||||
//
|
//
|
||||||
// - %sp will be of virtual register type MO_MachineReg.
|
// - Reg will be of virtual register type MO_MInstrVirtualReg. The field
|
||||||
// The field regNum identifies the machine register.
|
// MachineInstr* minstr will point to the instruction that computes reg.
|
||||||
//
|
//
|
||||||
// - NumElements will be of virtual register type MO_VirtualReg.
|
// - %sp will be of virtual register type MO_MachineReg.
|
||||||
// The field Value* value identifies the value.
|
// The field regNum identifies the machine register.
|
||||||
//
|
//
|
||||||
// - Ptr will also be of virtual register type MO_VirtualReg.
|
// - NumElements will be of virtual register type MO_VirtualReg.
|
||||||
// Again, the field Value* value identifies the value.
|
// The field Value* value identifies the value.
|
||||||
|
//
|
||||||
|
// - Ptr will also be of virtual register type MO_VirtualReg.
|
||||||
|
// Again, the field Value* value identifies the value.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum MachineOperandType {
|
enum MachineOperandType {
|
||||||
MO_VirtualRegister, // virtual register for *value
|
MO_VirtualRegister, // virtual register for *value
|
||||||
MO_MachineRegister, // pre-assigned machine register `regNum'
|
MO_MachineRegister, // pre-assigned machine register `regNum'
|
||||||
MO_CCRegister,
|
MO_CCRegister,
|
||||||
MO_SignExtendedImmed,
|
MO_SignExtendedImmed,
|
||||||
MO_UnextendedImmed,
|
MO_UnextendedImmed,
|
||||||
@ -118,7 +118,7 @@ private:
|
|||||||
// the generated machine code.
|
// the generated machine code.
|
||||||
// LLVM global for MO_GlobalAddress.
|
// LLVM global for MO_GlobalAddress.
|
||||||
|
|
||||||
int64_t immedVal; // Constant value for an explicit constant
|
int64_t immedVal; // Constant value for an explicit constant
|
||||||
|
|
||||||
MachineBasicBlock *MBB; // For MO_MachineBasicBlock type
|
MachineBasicBlock *MBB; // For MO_MachineBasicBlock type
|
||||||
const char *SymbolName; // For MO_ExternalSymbol type
|
const char *SymbolName; // For MO_ExternalSymbol type
|
||||||
@ -127,7 +127,7 @@ private:
|
|||||||
char flags; // see bit field definitions above
|
char flags; // see bit field definitions above
|
||||||
MachineOperandType opType:8; // Pack into 8 bits efficiently after flags.
|
MachineOperandType opType:8; // Pack into 8 bits efficiently after flags.
|
||||||
union {
|
union {
|
||||||
int regNum; // register number for an explicit register
|
int regNum; // register number for an explicit register
|
||||||
// will be set for a value after reg allocation
|
// will be set for a value after reg allocation
|
||||||
|
|
||||||
int offset; // Offset to address of global or external, only
|
int offset; // Offset to address of global or external, only
|
||||||
@ -154,7 +154,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
MachineOperand(Value *V, MachineOperandType OpTy, UseType UseTy,
|
MachineOperand(Value *V, MachineOperandType OpTy, UseType UseTy,
|
||||||
bool isPCRelative = false)
|
bool isPCRelative = false)
|
||||||
: flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) {
|
: flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) {
|
||||||
assert(OpTy != MachineOperand::MO_GlobalAddress);
|
assert(OpTy != MachineOperand::MO_GlobalAddress);
|
||||||
zeroContents();
|
zeroContents();
|
||||||
@ -163,7 +163,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
MachineOperand(GlobalValue *V, MachineOperandType OpTy, UseType UseTy,
|
MachineOperand(GlobalValue *V, MachineOperandType OpTy, UseType UseTy,
|
||||||
bool isPCRelative = false, int Offset = 0)
|
bool isPCRelative = false, int Offset = 0)
|
||||||
: flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) {
|
: flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) {
|
||||||
assert(OpTy == MachineOperand::MO_GlobalAddress);
|
assert(OpTy == MachineOperand::MO_GlobalAddress);
|
||||||
zeroContents ();
|
zeroContents ();
|
||||||
@ -366,7 +366,7 @@ private:
|
|||||||
///
|
///
|
||||||
void setRegForValue(int reg) {
|
void setRegForValue(int reg) {
|
||||||
assert(opType == MO_VirtualRegister || opType == MO_CCRegister ||
|
assert(opType == MO_VirtualRegister || opType == MO_CCRegister ||
|
||||||
opType == MO_MachineRegister);
|
opType == MO_MachineRegister);
|
||||||
extra.regNum = reg;
|
extra.regNum = reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
|
|
||||||
// Iterators
|
// Iterators
|
||||||
iterator beginInEdges() { return inEdges.begin(); }
|
iterator beginInEdges() { return inEdges.begin(); }
|
||||||
iterator endInEdges() { return inEdges.end(); }
|
iterator endInEdges() { return inEdges.end(); }
|
||||||
iterator beginOutEdges() { return outEdges.begin(); }
|
iterator beginOutEdges() { return outEdges.begin(); }
|
||||||
iterator endOutEdges() { return outEdges.end(); }
|
iterator endOutEdges() { return outEdges.end(); }
|
||||||
|
|
||||||
@ -73,11 +73,11 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class SchedGraphCommon;
|
friend class SchedGraphCommon;
|
||||||
friend class SchedGraphEdge; // give access for adding edges
|
friend class SchedGraphEdge; // give access for adding edges
|
||||||
|
|
||||||
|
|
||||||
// disable default constructor and provide a ctor for single-block graphs
|
// disable default constructor and provide a ctor for single-block graphs
|
||||||
SchedGraphNodeCommon(); // DO NOT IMPLEMENT
|
SchedGraphNodeCommon(); // DO NOT IMPLEMENT
|
||||||
|
|
||||||
inline SchedGraphNodeCommon(unsigned Id, int index, int late=0) : ID(Id), latency(late), origIndexInBB(index) {}
|
inline SchedGraphNodeCommon(unsigned Id, int index, int late=0) : ID(Id), latency(late), origIndexInBB(index) {}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ protected:
|
|||||||
|
|
||||||
// ostream << operator for SchedGraphNode class
|
// ostream << operator for SchedGraphNode class
|
||||||
inline std::ostream &operator<<(std::ostream &os,
|
inline std::ostream &operator<<(std::ostream &os,
|
||||||
const SchedGraphNodeCommon &node) {
|
const SchedGraphNodeCommon &node) {
|
||||||
node.print(os);
|
node.print(os);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
@ -114,8 +114,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SchedGraphNodeCommon* src;
|
SchedGraphNodeCommon* src;
|
||||||
SchedGraphNodeCommon* sink;
|
SchedGraphNodeCommon* sink;
|
||||||
SchedGraphEdgeDepType depType;
|
SchedGraphEdgeDepType depType;
|
||||||
unsigned int depOrderType;
|
unsigned int depOrderType;
|
||||||
int minDelay; // cached latency (assumes fixed target arch)
|
int minDelay; // cached latency (assumes fixed target arch)
|
||||||
@ -127,35 +127,35 @@ protected:
|
|||||||
ResourceId resourceId;
|
ResourceId resourceId;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// For all constructors, if minDelay is unspecified, minDelay is
|
// For all constructors, if minDelay is unspecified, minDelay is
|
||||||
// set to _src->getLatency().
|
// set to _src->getLatency().
|
||||||
|
|
||||||
// constructor for CtrlDep or MemoryDep edges, selected by 3rd argument
|
// constructor for CtrlDep or MemoryDep edges, selected by 3rd argument
|
||||||
SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
|
SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
|
||||||
SchedGraphEdgeDepType _depType, unsigned int _depOrderType,
|
SchedGraphEdgeDepType _depType, unsigned int _depOrderType,
|
||||||
int _minDelay = -1);
|
int _minDelay = -1);
|
||||||
|
|
||||||
// constructor for explicit value dependence (may be true/anti/output)
|
// constructor for explicit value dependence (may be true/anti/output)
|
||||||
SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
|
SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
|
||||||
const Value* _val, unsigned int _depOrderType,
|
const Value* _val, unsigned int _depOrderType,
|
||||||
int _minDelay = -1);
|
int _minDelay = -1);
|
||||||
|
|
||||||
// constructor for machine register dependence
|
// constructor for machine register dependence
|
||||||
SchedGraphEdge(SchedGraphNodeCommon* _src,SchedGraphNodeCommon* _sink,
|
SchedGraphEdge(SchedGraphNodeCommon* _src,SchedGraphNodeCommon* _sink,
|
||||||
unsigned int _regNum, unsigned int _depOrderType,
|
unsigned int _regNum, unsigned int _depOrderType,
|
||||||
int _minDelay = -1);
|
int _minDelay = -1);
|
||||||
|
|
||||||
// constructor for any other machine resource dependences.
|
// constructor for any other machine resource dependences.
|
||||||
// DataDepOrderType is always NonDataDep. It it not an argument to
|
// DataDepOrderType is always NonDataDep. It it not an argument to
|
||||||
// avoid overloading ambiguity with previous constructor.
|
// avoid overloading ambiguity with previous constructor.
|
||||||
SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
|
SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
|
||||||
ResourceId _resourceId, int _minDelay = -1);
|
ResourceId _resourceId, int _minDelay = -1);
|
||||||
|
|
||||||
~SchedGraphEdge() {}
|
~SchedGraphEdge() {}
|
||||||
|
|
||||||
SchedGraphNodeCommon* getSrc() const { return src; }
|
SchedGraphNodeCommon* getSrc() const { return src; }
|
||||||
SchedGraphNodeCommon* getSink() const { return sink; }
|
SchedGraphNodeCommon* getSink() const { return sink; }
|
||||||
int getMinDelay() const { return minDelay; }
|
int getMinDelay() const { return minDelay; }
|
||||||
SchedGraphEdgeDepType getDepType() const { return depType; }
|
SchedGraphEdgeDepType getDepType() const { return depType; }
|
||||||
unsigned int getDepOrderType() const { return depOrderType; }
|
unsigned int getDepOrderType() const { return depOrderType; }
|
||||||
@ -187,7 +187,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// disable default ctor
|
// disable default ctor
|
||||||
SchedGraphEdge(); // DO NOT IMPLEMENT
|
SchedGraphEdge(); // DO NOT IMPLEMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
// ostream << operator for SchedGraphNode class
|
// ostream << operator for SchedGraphNode class
|
||||||
@ -247,12 +247,12 @@ public:
|
|||||||
inline _EdgeType* getEdge() const { return *(oi); }
|
inline _EdgeType* getEdge() const { return *(oi); }
|
||||||
|
|
||||||
inline _Self &operator++() { ++oi; return *this; } // Preincrement
|
inline _Self &operator++() { ++oi; return *this; } // Preincrement
|
||||||
inline _Self operator++(int) { // Postincrement
|
inline _Self operator++(int) { // Postincrement
|
||||||
_Self tmp(*this); ++*this; return tmp;
|
_Self tmp(*this); ++*this; return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _Self &operator--() { --oi; return *this; } // Predecrement
|
inline _Self &operator--() { --oi; return *this; } // Predecrement
|
||||||
inline _Self operator--(int) { // Postdecrement
|
inline _Self operator--(int) { // Postdecrement
|
||||||
_Self tmp = *this; --*this; return tmp;
|
_Self tmp = *this; --*this; return tmp;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -275,12 +275,12 @@ public:
|
|||||||
inline _EdgeType* getEdge() const { return *(oi); }
|
inline _EdgeType* getEdge() const { return *(oi); }
|
||||||
|
|
||||||
inline _Self &operator++() { ++oi; return *this; } // Preincrement
|
inline _Self &operator++() { ++oi; return *this; } // Preincrement
|
||||||
inline _Self operator++(int) { // Postincrement
|
inline _Self operator++(int) { // Postincrement
|
||||||
_Self tmp(*this); ++*this; return tmp;
|
_Self tmp(*this); ++*this; return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _Self &operator--() { --oi; return *this; } // Predecrement
|
inline _Self &operator--() { --oi; return *this; } // Predecrement
|
||||||
inline _Self operator--(int) { // Postdecrement
|
inline _Self operator--(int) { // Postdecrement
|
||||||
_Self tmp = *this; --*this; return tmp;
|
_Self tmp = *this; --*this; return tmp;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This header file includes the infamous alloc.h header file if the
|
* This header file includes the infamous alloc.h header file if the
|
||||||
* autoconf system has found it. It hides all of the autoconf details
|
* autoconf system has found it. It hides all of the autoconf details
|
||||||
* from the rest of the application source code.
|
* from the rest of the application source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CONFIG_ALLOC_H
|
#ifndef _CONFIG_ALLOC_H
|
||||||
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a modified version of that suggested by the Autoconf manual.
|
* This is a modified version of that suggested by the Autoconf manual.
|
||||||
* 1) The #pragma is indented so that pre-ANSI C compilers ignore it.
|
* 1) The #pragma is indented so that pre-ANSI C compilers ignore it.
|
||||||
* 2) If alloca.h cannot be found, then try stdlib.h. Some platforms
|
* 2) If alloca.h cannot be found, then try stdlib.h. Some platforms
|
||||||
* (notably FreeBSD) defined alloca() there.
|
* (notably FreeBSD) defined alloca() there.
|
||||||
*/
|
*/
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
@ -31,19 +31,19 @@
|
|||||||
#elif defined(__MINGW32__) && defined(HAVE_MALLOC_H)
|
#elif defined(__MINGW32__) && defined(HAVE_MALLOC_H)
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#elif !defined(__GNUC__)
|
#elif !defined(__GNUC__)
|
||||||
# ifdef _AIX
|
# ifdef _AIX
|
||||||
# pragma alloca
|
# pragma alloca
|
||||||
# else
|
# else
|
||||||
# ifndef alloca
|
# ifndef alloca
|
||||||
char * alloca ();
|
char * alloca ();
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef HAVE_STDLIB_H
|
# ifdef HAVE_STDLIB_H
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# else
|
# else
|
||||||
# error "The function alloca() is required but not found!"
|
# error "The function alloca() is required but not found!"
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -123,7 +123,7 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
MRegisterInfo(const MRegisterDesc *D, unsigned NR,
|
MRegisterInfo(const MRegisterDesc *D, unsigned NR,
|
||||||
regclass_iterator RegClassBegin, regclass_iterator RegClassEnd,
|
regclass_iterator RegClassBegin, regclass_iterator RegClassEnd,
|
||||||
int CallFrameSetupOpcode = -1, int CallFrameDestroyOpcode = -1);
|
int CallFrameSetupOpcode = -1, int CallFrameDestroyOpcode = -1);
|
||||||
virtual ~MRegisterInfo();
|
virtual ~MRegisterInfo();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -285,8 +285,8 @@ public:
|
|||||||
MachineBasicBlock &MBB,
|
MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator MI) const {
|
MachineBasicBlock::iterator MI) const {
|
||||||
assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 &&
|
assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 &&
|
||||||
"eliminateCallFramePseudoInstr must be implemented if using"
|
"eliminateCallFramePseudoInstr must be implemented if using"
|
||||||
" call frame setup/destroy pseudo instructions!");
|
" call frame setup/destroy pseudo instructions!");
|
||||||
assert(0 && "Call Frame Pseudo Instructions do not exist on this target!");
|
assert(0 && "Call Frame Pseudo Instructions do not exist on this target!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,26 +81,23 @@ public:
|
|||||||
|
|
||||||
// This method adjusts a stack offset to meet alignment rules of target.
|
// This method adjusts a stack offset to meet alignment rules of target.
|
||||||
virtual int adjustAlignment(int unalignedOffset, bool growUp,
|
virtual int adjustAlignment(int unalignedOffset, bool growUp,
|
||||||
unsigned align) const;
|
unsigned align) const;
|
||||||
|
|
||||||
// These methods compute offsets using the frame contents for a particular
|
// These methods compute offsets using the frame contents for a particular
|
||||||
// function. The frame contents are obtained from the MachineFunction object
|
// function. The frame contents are obtained from the MachineFunction object
|
||||||
// for the given function. The rest must be implemented by the
|
// for the given function. The rest must be implemented by the
|
||||||
// machine-specific subclass.
|
// machine-specific subclass.
|
||||||
//
|
//
|
||||||
virtual int getIncomingArgOffset (MachineFunction& mcInfo,
|
virtual int getIncomingArgOffset(MachineFunction& mcInfo,
|
||||||
unsigned argNum) const;
|
unsigned argNum) const;
|
||||||
virtual int getOutgoingArgOffset (MachineFunction& mcInfo,
|
virtual int getOutgoingArgOffset(MachineFunction& mcInfo,
|
||||||
unsigned argNum) const;
|
unsigned argNum) const;
|
||||||
|
virtual int getFirstAutomaticVarOffset(MachineFunction& mcInfo,
|
||||||
virtual int getFirstAutomaticVarOffset (MachineFunction& mcInfo,
|
bool& growUp) const;
|
||||||
bool& growUp) const;
|
virtual int getRegSpillAreaOffset(MachineFunction& mcInfo,
|
||||||
virtual int getRegSpillAreaOffset (MachineFunction& mcInfo,
|
bool& growUp) const;
|
||||||
bool& growUp) const;
|
virtual int getTmpAreaOffset(MachineFunction& mcInfo, bool& growUp) const;
|
||||||
virtual int getTmpAreaOffset (MachineFunction& mcInfo,
|
virtual int getDynamicAreaOffset(MachineFunction& mcInfo, bool& growUp) const;
|
||||||
bool& growUp) const;
|
|
||||||
virtual int getDynamicAreaOffset (MachineFunction& mcInfo,
|
|
||||||
bool& growUp) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@ -39,22 +39,22 @@ typedef unsigned InstrSchedClass;
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// struct TargetInstrDescriptor:
|
// struct TargetInstrDescriptor:
|
||||||
// Predefined information about each machine instruction.
|
// Predefined information about each machine instruction.
|
||||||
// Designed to initialized statically.
|
// Designed to initialized statically.
|
||||||
//
|
//
|
||||||
|
|
||||||
const unsigned M_NOP_FLAG = 1 << 0;
|
const unsigned M_NOP_FLAG = 1 << 0;
|
||||||
const unsigned M_BRANCH_FLAG = 1 << 1;
|
const unsigned M_BRANCH_FLAG = 1 << 1;
|
||||||
const unsigned M_CALL_FLAG = 1 << 2;
|
const unsigned M_CALL_FLAG = 1 << 2;
|
||||||
const unsigned M_RET_FLAG = 1 << 3;
|
const unsigned M_RET_FLAG = 1 << 3;
|
||||||
const unsigned M_BARRIER_FLAG = 1 << 4;
|
const unsigned M_BARRIER_FLAG = 1 << 4;
|
||||||
const unsigned M_DELAY_SLOT_FLAG = 1 << 5;
|
const unsigned M_DELAY_SLOT_FLAG = 1 << 5;
|
||||||
const unsigned M_CC_FLAG = 1 << 6;
|
const unsigned M_CC_FLAG = 1 << 6;
|
||||||
const unsigned M_LOAD_FLAG = 1 << 7;
|
const unsigned M_LOAD_FLAG = 1 << 7;
|
||||||
const unsigned M_STORE_FLAG = 1 << 8;
|
const unsigned M_STORE_FLAG = 1 << 8;
|
||||||
|
|
||||||
// M_2_ADDR_FLAG - 3-addr instructions which really work like 2-addr ones.
|
// M_2_ADDR_FLAG - 3-addr instructions which really work like 2-addr ones.
|
||||||
const unsigned M_2_ADDR_FLAG = 1 << 9;
|
const unsigned M_2_ADDR_FLAG = 1 << 9;
|
||||||
|
|
||||||
// M_CONVERTIBLE_TO_3_ADDR - This is a M_2_ADDR_FLAG instruction which can be
|
// M_CONVERTIBLE_TO_3_ADDR - This is a M_2_ADDR_FLAG instruction which can be
|
||||||
// changed into a 3-address instruction if the first two operands cannot be
|
// changed into a 3-address instruction if the first two operands cannot be
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
int numOperands; // Number of args; -1 if variable #args
|
int numOperands; // Number of args; -1 if variable #args
|
||||||
int resultPos; // Position of the result; -1 if no result
|
int resultPos; // Position of the result; -1 if no result
|
||||||
unsigned maxImmedConst; // Largest +ve constant in IMMED field or 0.
|
unsigned maxImmedConst; // Largest +ve constant in IMMED field or 0.
|
||||||
bool immedIsSignExtended; // Is IMMED field sign-extended? If so,
|
bool immedIsSignExtended; // Is IMMED field sign-extended? If so,
|
||||||
// smallest -ve value is -(maxImmedConst+1).
|
// smallest -ve value is -(maxImmedConst+1).
|
||||||
unsigned numDelaySlots; // Number of delay slots after instruction
|
unsigned numDelaySlots; // Number of delay slots after instruction
|
||||||
unsigned latency; // Latency in machine cycles
|
unsigned latency; // Latency in machine cycles
|
||||||
@ -275,7 +275,7 @@ public:
|
|||||||
// of this machine instruction
|
// of this machine instruction
|
||||||
//
|
//
|
||||||
virtual bool constantFitsInImmedField(MachineOpCode Opcode,
|
virtual bool constantFitsInImmedField(MachineOpCode Opcode,
|
||||||
int64_t intValue) const;
|
int64_t intValue) const;
|
||||||
|
|
||||||
// Return the largest positive constant that can be held in the IMMED field
|
// Return the largest positive constant that can be held in the IMMED field
|
||||||
// of this machine instruction.
|
// of this machine instruction.
|
||||||
@ -284,7 +284,7 @@ public:
|
|||||||
// Return 0 if the instruction has no IMMED field.
|
// Return 0 if the instruction has no IMMED field.
|
||||||
//
|
//
|
||||||
virtual uint64_t maxImmedConstant(MachineOpCode Opcode,
|
virtual uint64_t maxImmedConstant(MachineOpCode Opcode,
|
||||||
bool &isSignExtended) const {
|
bool &isSignExtended) const {
|
||||||
isSignExtended = get(Opcode).immedIsSignExtended;
|
isSignExtended = get(Opcode).immedIsSignExtended;
|
||||||
return get(Opcode).maxImmedConst;
|
return get(Opcode).maxImmedConst;
|
||||||
}
|
}
|
||||||
|
@ -72,13 +72,13 @@ const int MAX_NUM_CYCLES = 32;
|
|||||||
|
|
||||||
struct InstrClassRUsage {
|
struct InstrClassRUsage {
|
||||||
InstrSchedClass schedClass;
|
InstrSchedClass schedClass;
|
||||||
int totCycles;
|
int totCycles;
|
||||||
|
|
||||||
// Issue restrictions common to instructions in this class
|
// Issue restrictions common to instructions in this class
|
||||||
unsigned maxNumIssue;
|
unsigned maxNumIssue;
|
||||||
bool isSingleIssue;
|
bool isSingleIssue;
|
||||||
bool breaksGroup;
|
bool breaksGroup;
|
||||||
CycleCount_t numBubbles;
|
CycleCount_t numBubbles;
|
||||||
|
|
||||||
// Feasible slots to use for instructions in this class.
|
// Feasible slots to use for instructions in this class.
|
||||||
// The size of vector S[] is `numSlots'.
|
// The size of vector S[] is `numSlots'.
|
||||||
@ -91,41 +91,41 @@ struct InstrClassRUsage {
|
|||||||
struct {
|
struct {
|
||||||
resourceId_t resourceId;
|
resourceId_t resourceId;
|
||||||
unsigned startCycle;
|
unsigned startCycle;
|
||||||
int numCycles;
|
int numCycles;
|
||||||
} V[MAX_NUM_CYCLES];
|
} V[MAX_NUM_CYCLES];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InstrRUsageDelta {
|
struct InstrRUsageDelta {
|
||||||
MachineOpCode opCode;
|
MachineOpCode opCode;
|
||||||
resourceId_t resourceId;
|
resourceId_t resourceId;
|
||||||
unsigned startCycle;
|
unsigned startCycle;
|
||||||
int numCycles;
|
int numCycles;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Specify instruction issue restrictions for individual instructions
|
// Specify instruction issue restrictions for individual instructions
|
||||||
// that differ from the common rules for the class.
|
// that differ from the common rules for the class.
|
||||||
//
|
//
|
||||||
struct InstrIssueDelta {
|
struct InstrIssueDelta {
|
||||||
MachineOpCode opCode;
|
MachineOpCode opCode;
|
||||||
bool isSingleIssue;
|
bool isSingleIssue;
|
||||||
bool breaksGroup;
|
bool breaksGroup;
|
||||||
CycleCount_t numBubbles;
|
CycleCount_t numBubbles;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct InstrRUsage {
|
struct InstrRUsage {
|
||||||
bool sameAsClass;
|
bool sameAsClass;
|
||||||
|
|
||||||
// Issue restrictions for this instruction
|
// Issue restrictions for this instruction
|
||||||
bool isSingleIssue;
|
bool isSingleIssue;
|
||||||
bool breaksGroup;
|
bool breaksGroup;
|
||||||
CycleCount_t numBubbles;
|
CycleCount_t numBubbles;
|
||||||
|
|
||||||
// Feasible slots to use for this instruction.
|
// Feasible slots to use for this instruction.
|
||||||
std::vector<bool> feasibleSlots;
|
std::vector<bool> feasibleSlots;
|
||||||
|
|
||||||
// Resource usages for this instruction, with one resource vector per cycle.
|
// Resource usages for this instruction, with one resource vector per cycle.
|
||||||
CycleCount_t numCycles;
|
CycleCount_t numCycles;
|
||||||
std::vector<std::vector<resourceId_t> > resourcesByCycle;
|
std::vector<std::vector<resourceId_t> > resourcesByCycle;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -139,12 +139,12 @@ private:
|
|||||||
numBubbles = delta.numBubbles;
|
numBubbles = delta.numBubbles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addUsageDelta (const InstrRUsageDelta& delta);
|
void addUsageDelta(const InstrRUsageDelta& delta);
|
||||||
void setMaxSlots (int maxNumSlots) {
|
void setMaxSlots(int maxNumSlots) {
|
||||||
feasibleSlots.resize(maxNumSlots);
|
feasibleSlots.resize(maxNumSlots);
|
||||||
}
|
}
|
||||||
|
|
||||||
friend class TargetSchedInfo; // give access to these functions
|
friend class TargetSchedInfo; // give access to these functions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ public:
|
|||||||
const TargetMachine& target;
|
const TargetMachine& target;
|
||||||
|
|
||||||
unsigned maxNumIssueTotal;
|
unsigned maxNumIssueTotal;
|
||||||
int longestIssueConflict;
|
int longestIssueConflict;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline const InstrRUsage& getInstrRUsage(MachineOpCode opCode) const {
|
inline const InstrRUsage& getInstrRUsage(MachineOpCode opCode) const {
|
||||||
@ -173,20 +173,20 @@ private:
|
|||||||
TargetSchedInfo(const TargetSchedInfo &); // DO NOT IMPLEMENT
|
TargetSchedInfo(const TargetSchedInfo &); // DO NOT IMPLEMENT
|
||||||
void operator=(const TargetSchedInfo &); // DO NOT IMPLEMENT
|
void operator=(const TargetSchedInfo &); // DO NOT IMPLEMENT
|
||||||
public:
|
public:
|
||||||
/*ctor*/ TargetSchedInfo (const TargetMachine& tgt,
|
TargetSchedInfo(const TargetMachine& tgt,
|
||||||
int _numSchedClasses,
|
int _numSchedClasses,
|
||||||
const InstrClassRUsage* _classRUsages,
|
const InstrClassRUsage* _classRUsages,
|
||||||
const InstrRUsageDelta* _usageDeltas,
|
const InstrRUsageDelta* _usageDeltas,
|
||||||
const InstrIssueDelta* _issueDeltas,
|
const InstrIssueDelta* _issueDeltas,
|
||||||
unsigned _numUsageDeltas,
|
unsigned _numUsageDeltas,
|
||||||
unsigned _numIssueDeltas);
|
unsigned _numIssueDeltas);
|
||||||
/*dtor*/ virtual ~TargetSchedInfo() {}
|
virtual ~TargetSchedInfo() {}
|
||||||
|
|
||||||
inline const TargetInstrInfo& getInstrInfo() const {
|
inline const TargetInstrInfo& getInstrInfo() const {
|
||||||
return *mii;
|
return *mii;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int getNumSchedClasses() const {
|
inline int getNumSchedClasses() const {
|
||||||
return numSchedClasses;
|
return numSchedClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,42 +199,42 @@ public:
|
|||||||
return classRUsages[sc].maxNumIssue;
|
return classRUsages[sc].maxNumIssue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline InstrSchedClass getSchedClass (MachineOpCode opCode) const {
|
inline InstrSchedClass getSchedClass(MachineOpCode opCode) const {
|
||||||
return getInstrInfo().getSchedClass(opCode);
|
return getInstrInfo().getSchedClass(opCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool instrCanUseSlot (MachineOpCode opCode,
|
inline bool instrCanUseSlot(MachineOpCode opCode,
|
||||||
unsigned s) const {
|
unsigned s) const {
|
||||||
assert(s < getInstrRUsage(opCode).feasibleSlots.size() && "Invalid slot!");
|
assert(s < getInstrRUsage(opCode).feasibleSlots.size() && "Invalid slot!");
|
||||||
return getInstrRUsage(opCode).feasibleSlots[s];
|
return getInstrRUsage(opCode).feasibleSlots[s];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int getLongestIssueConflict () const {
|
inline int getLongestIssueConflict() const {
|
||||||
return longestIssueConflict;
|
return longestIssueConflict;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int getMinIssueGap (MachineOpCode fromOp,
|
inline int getMinIssueGap(MachineOpCode fromOp,
|
||||||
MachineOpCode toOp) const {
|
MachineOpCode toOp) const {
|
||||||
assert(fromOp < (int) issueGaps.size());
|
assert(fromOp < (int) issueGaps.size());
|
||||||
const std::vector<int>& toGaps = issueGaps[fromOp];
|
const std::vector<int>& toGaps = issueGaps[fromOp];
|
||||||
return (toOp < (int) toGaps.size())? toGaps[toOp] : 0;
|
return (toOp < (int) toGaps.size())? toGaps[toOp] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const std::vector<MachineOpCode>&
|
inline const std::vector<MachineOpCode>&
|
||||||
getConflictList(MachineOpCode opCode) const {
|
getConflictList(MachineOpCode opCode) const {
|
||||||
assert(opCode < (int) conflictLists.size());
|
assert(opCode < (int) conflictLists.size());
|
||||||
return conflictLists[opCode];
|
return conflictLists[opCode];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool isSingleIssue (MachineOpCode opCode) const {
|
inline bool isSingleIssue(MachineOpCode opCode) const {
|
||||||
return getInstrRUsage(opCode).isSingleIssue;
|
return getInstrRUsage(opCode).isSingleIssue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool breaksIssueGroup (MachineOpCode opCode) const {
|
inline bool breaksIssueGroup(MachineOpCode opCode) const {
|
||||||
return getInstrRUsage(opCode).breaksGroup;
|
return getInstrRUsage(opCode).breaksGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned numBubblesAfter (MachineOpCode opCode) const {
|
inline unsigned numBubblesAfter(MachineOpCode opCode) const {
|
||||||
return getInstrRUsage(opCode).numBubbles;
|
return getInstrRUsage(opCode).numBubbles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initializeResources ();
|
virtual void initializeResources();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void computeInstrResources(const std::vector<InstrRUsage>& instrRUForClasses);
|
void computeInstrResources(const std::vector<InstrRUsage>& instrRUForClasses);
|
||||||
@ -265,18 +265,18 @@ public:
|
|||||||
std::vector<std::pair<int,int> > resourceNumVector;
|
std::vector<std::pair<int,int> > resourceNumVector;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned numSchedClasses;
|
unsigned numSchedClasses;
|
||||||
const TargetInstrInfo* mii;
|
const TargetInstrInfo* mii;
|
||||||
const InstrClassRUsage* classRUsages; // raw array by sclass
|
const InstrClassRUsage* classRUsages; // raw array by sclass
|
||||||
const InstrRUsageDelta* usageDeltas; // raw array [1:numUsageDeltas]
|
const InstrRUsageDelta* usageDeltas; // raw array [1:numUsageDeltas]
|
||||||
const InstrIssueDelta* issueDeltas; // raw array [1:numIssueDeltas]
|
const InstrIssueDelta* issueDeltas; // raw array [1:numIssueDeltas]
|
||||||
unsigned numUsageDeltas;
|
unsigned numUsageDeltas;
|
||||||
unsigned numIssueDeltas;
|
unsigned numIssueDeltas;
|
||||||
|
|
||||||
std::vector<InstrRUsage> instrRUsages; // indexed by opcode
|
std::vector<InstrRUsage> instrRUsages; // indexed by opcode
|
||||||
std::vector<std::vector<int> > issueGaps; // indexed by [opcode1][opcode2]
|
std::vector<std::vector<int> > issueGaps; // indexed by [opcode1][opcode2]
|
||||||
std::vector<std::vector<MachineOpCode> >
|
std::vector<std::vector<MachineOpCode> >
|
||||||
conflictLists; // indexed by [opcode]
|
conflictLists; // indexed by [opcode]
|
||||||
|
|
||||||
|
|
||||||
friend class ModuloSchedulingPass;
|
friend class ModuloSchedulingPass;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user