forked from OSchip/llvm-project
parent
6c0c21954c
commit
a6d0afcb74
|
@ -451,9 +451,9 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void StartPassTimer(llvm::Pass *);
|
extern void StartPassTimer(llvm::Pass *);
|
||||||
extern void StopPassTimer(llvm::Pass *);
|
extern void StopPassTimer(llvm::Pass *);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1396,7 +1396,7 @@ bool Andersens::Node::intersectsIgnoring(Node *N, unsigned Ignoring) const {
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpToDOUT(SparseBitVector<> *bitmap) {
|
static void dumpToDOUT(SparseBitVector<> *bitmap) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
raw_os_ostream OS(*DOUT);
|
raw_os_ostream OS(*DOUT);
|
||||||
dump(*bitmap, OS);
|
dump(*bitmap, OS);
|
||||||
|
|
|
@ -817,7 +817,7 @@ bool llvm::CannotBeNegativeZero(const Value *V, unsigned Depth) {
|
||||||
// indices from Idxs that should be left out when inserting into the resulting
|
// indices from Idxs that should be left out when inserting into the resulting
|
||||||
// struct. To is the result struct built so far, new insertvalue instructions
|
// struct. To is the result struct built so far, new insertvalue instructions
|
||||||
// build on that.
|
// build on that.
|
||||||
Value *BuildSubAggregate(Value *From, Value* To, const Type *IndexedType,
|
static Value *BuildSubAggregate(Value *From, Value* To, const Type *IndexedType,
|
||||||
SmallVector<unsigned, 10> &Idxs,
|
SmallVector<unsigned, 10> &Idxs,
|
||||||
unsigned IdxSkip,
|
unsigned IdxSkip,
|
||||||
LLVMContext &Context,
|
LLVMContext &Context,
|
||||||
|
@ -877,7 +877,7 @@ Value *BuildSubAggregate(Value *From, Value* To, const Type *IndexedType,
|
||||||
// insertvalue instruction somewhere).
|
// insertvalue instruction somewhere).
|
||||||
//
|
//
|
||||||
// All inserted insertvalue instructions are inserted before InsertBefore
|
// All inserted insertvalue instructions are inserted before InsertBefore
|
||||||
Value *BuildSubAggregate(Value *From, const unsigned *idx_begin,
|
static Value *BuildSubAggregate(Value *From, const unsigned *idx_begin,
|
||||||
const unsigned *idx_end, LLVMContext &Context,
|
const unsigned *idx_end, LLVMContext &Context,
|
||||||
Instruction *InsertBefore) {
|
Instruction *InsertBefore) {
|
||||||
assert(InsertBefore && "Must have someplace to insert!");
|
assert(InsertBefore && "Must have someplace to insert!");
|
||||||
|
|
|
@ -48,13 +48,14 @@ RewriterOpt("rewriter",
|
||||||
clEnumValEnd),
|
clEnumValEnd),
|
||||||
cl::init(local));
|
cl::init(local));
|
||||||
|
|
||||||
cl::opt<bool>
|
static cl::opt<bool>
|
||||||
ScheduleSpills("schedule-spills",
|
ScheduleSpills("schedule-spills",
|
||||||
cl::desc("Schedule spill code"),
|
cl::desc("Schedule spill code"),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
|
||||||
VirtRegRewriter::~VirtRegRewriter() {}
|
VirtRegRewriter::~VirtRegRewriter() {}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
/// This class is intended for use with the new spilling framework only. It
|
/// This class is intended for use with the new spilling framework only. It
|
||||||
/// rewrites vreg def/uses to use the assigned preg, but does not insert any
|
/// rewrites vreg def/uses to use the assigned preg, but does not insert any
|
||||||
|
@ -101,8 +102,12 @@ struct VISIBILITY_HIDDEN TrivialRewriter : public VirtRegRewriter {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************ //
|
// ************************************************************************ //
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
/// AvailableSpills - As the local rewriter is scanning and rewriting an MBB
|
/// AvailableSpills - As the local rewriter is scanning and rewriting an MBB
|
||||||
/// from top down, keep track of which spill slots or remat are available in
|
/// from top down, keep track of which spill slots or remat are available in
|
||||||
/// each register.
|
/// each register.
|
||||||
|
@ -225,6 +230,8 @@ public:
|
||||||
std::vector<MachineOperand*> &KillOps);
|
std::vector<MachineOperand*> &KillOps);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************ //
|
// ************************************************************************ //
|
||||||
|
|
||||||
// Given a location where a reload of a spilled register or a remat of
|
// Given a location where a reload of a spilled register or a remat of
|
||||||
|
@ -297,6 +304,8 @@ stop:;
|
||||||
return NewInsertLoc;
|
return NewInsertLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
// ReusedOp - For each reused operand, we keep track of a bit of information,
|
// ReusedOp - For each reused operand, we keep track of a bit of information,
|
||||||
// in case we need to rollback upon processing a new operand. See comments
|
// in case we need to rollback upon processing a new operand. See comments
|
||||||
// below.
|
// below.
|
||||||
|
@ -396,6 +405,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// ****************** //
|
// ****************** //
|
||||||
// Utility Functions //
|
// Utility Functions //
|
||||||
|
@ -962,6 +972,8 @@ namespace {
|
||||||
// Local Spiller Implementation //
|
// Local Spiller Implementation //
|
||||||
// ***************************** //
|
// ***************************** //
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
class VISIBILITY_HIDDEN LocalRewriter : public VirtRegRewriter {
|
class VISIBILITY_HIDDEN LocalRewriter : public VirtRegRewriter {
|
||||||
MachineRegisterInfo *RegInfo;
|
MachineRegisterInfo *RegInfo;
|
||||||
const TargetRegisterInfo *TRI;
|
const TargetRegisterInfo *TRI;
|
||||||
|
@ -2320,6 +2332,8 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
llvm::VirtRegRewriter* llvm::createVirtRegRewriter() {
|
llvm::VirtRegRewriter* llvm::createVirtRegRewriter() {
|
||||||
switch (RewriterOpt) {
|
switch (RewriterOpt) {
|
||||||
default: llvm_unreachable("Unreachable!");
|
default: llvm_unreachable("Unreachable!");
|
||||||
|
|
|
@ -57,6 +57,7 @@ static void runAtExitHandlers() {
|
||||||
* linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
|
* linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
|
||||||
* available as an exported symbol, so we have to add it explicitly.
|
* available as an exported symbol, so we have to add it explicitly.
|
||||||
*/
|
*/
|
||||||
|
namespace {
|
||||||
class StatSymbols {
|
class StatSymbols {
|
||||||
public:
|
public:
|
||||||
StatSymbols() {
|
StatSymbols() {
|
||||||
|
@ -73,6 +74,7 @@ public:
|
||||||
sys::DynamicLibrary::AddSymbol("mknod", (void*)(intptr_t)mknod);
|
sys::DynamicLibrary::AddSymbol("mknod", (void*)(intptr_t)mknod);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
static StatSymbols initStatSymbols;
|
static StatSymbols initStatSymbols;
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,6 @@ int sys::AlarmStatus() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sleep(unsigned n) {
|
void sys::Sleep(unsigned n) {
|
||||||
::sleep(n);
|
::sleep(n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace {
|
||||||
char Thumb2ITBlockPass::ID = 0;
|
char Thumb2ITBlockPass::ID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ARMCC::CondCodes getPredicate(const MachineInstr *MI,
|
static ARMCC::CondCodes getPredicate(const MachineInstr *MI,
|
||||||
const Thumb2InstrInfo *TII) {
|
const Thumb2InstrInfo *TII) {
|
||||||
unsigned Opc = MI->getOpcode();
|
unsigned Opc = MI->getOpcode();
|
||||||
if (Opc == ARM::tBcc || Opc == ARM::t2Bcc)
|
if (Opc == ARM::tBcc || Opc == ARM::t2Bcc)
|
||||||
|
|
|
@ -898,7 +898,7 @@ LowerSTORE(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Generate the address of a constant pool entry.
|
//! Generate the address of a constant pool entry.
|
||||||
SDValue
|
static SDValue
|
||||||
LowerConstantPool(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
|
LowerConstantPool(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
|
||||||
MVT PtrVT = Op.getValueType();
|
MVT PtrVT = Op.getValueType();
|
||||||
ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
|
ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
|
||||||
|
@ -1550,7 +1550,7 @@ SDValue SPU::get_v2i64_imm(SDNode *N, SelectionDAG &DAG) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Lower a BUILD_VECTOR instruction creatively:
|
//! Lower a BUILD_VECTOR instruction creatively:
|
||||||
SDValue
|
static SDValue
|
||||||
LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) {
|
LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) {
|
||||||
MVT VT = Op.getValueType();
|
MVT VT = Op.getValueType();
|
||||||
MVT EltVT = VT.getVectorElementType();
|
MVT EltVT = VT.getVectorElementType();
|
||||||
|
|
|
@ -549,6 +549,8 @@ static SPCC::CondCodes FPCondCCodeToFCC(ISD::CondCode CC) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
class TargetLoweringObjectFileSparc : public TargetLoweringObjectFileELF {
|
class TargetLoweringObjectFileSparc : public TargetLoweringObjectFileELF {
|
||||||
public:
|
public:
|
||||||
void getSectionFlagsAsString(SectionKind Kind,
|
void getSectionFlagsAsString(SectionKind Kind,
|
||||||
|
@ -571,6 +573,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
|
SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
|
||||||
: TargetLowering(TM, new TargetLoweringObjectFileSparc()) {
|
: TargetLowering(TM, new TargetLoweringObjectFileSparc()) {
|
||||||
|
|
|
@ -172,7 +172,7 @@ static void findUsedValues(GlobalVariable *LLVMUsed,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// StripSymbolNames - Strip symbol names.
|
/// StripSymbolNames - Strip symbol names.
|
||||||
bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
|
static bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
|
||||||
|
|
||||||
SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
|
SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
|
||||||
findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
|
findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
|
||||||
|
@ -201,7 +201,7 @@ bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
|
||||||
// StripDebugInfo - Strip debug info in the module if it exists.
|
// StripDebugInfo - Strip debug info in the module if it exists.
|
||||||
// To do this, we remove llvm.dbg.func.start, llvm.dbg.stoppoint, and
|
// To do this, we remove llvm.dbg.func.start, llvm.dbg.stoppoint, and
|
||||||
// llvm.dbg.region.end calls, and any globals they point to if now dead.
|
// llvm.dbg.region.end calls, and any globals they point to if now dead.
|
||||||
bool StripDebugInfo(Module &M) {
|
static bool StripDebugInfo(Module &M) {
|
||||||
|
|
||||||
SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
|
SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
|
||||||
findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
|
findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
|
||||||
|
|
|
@ -760,6 +760,7 @@ void PromoteMem2Reg::RewriteSingleStoreAlloca(AllocaInst *AI,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
/// StoreIndexSearchPredicate - This is a helper predicate used to search by the
|
/// StoreIndexSearchPredicate - This is a helper predicate used to search by the
|
||||||
/// first element of a pair.
|
/// first element of a pair.
|
||||||
|
@ -770,6 +771,8 @@ struct StoreIndexSearchPredicate {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// PromoteSingleBlockAlloca - Many allocas are only used within a single basic
|
/// PromoteSingleBlockAlloca - Many allocas are only used within a single basic
|
||||||
/// block. If this is the case, avoid traversing the CFG and inserting a lot of
|
/// block. If this is the case, avoid traversing the CFG and inserting a lot of
|
||||||
/// potentially useless PHI nodes by just performing a single linear pass over
|
/// potentially useless PHI nodes by just performing a single linear pass over
|
||||||
|
|
|
@ -1582,13 +1582,13 @@ void TimingInfo::createTheTimeInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If TimingInfo is enabled then start pass timer.
|
/// If TimingInfo is enabled then start pass timer.
|
||||||
void StartPassTimer(Pass *P) {
|
void llvm::StartPassTimer(Pass *P) {
|
||||||
if (TheTimeInfo)
|
if (TheTimeInfo)
|
||||||
TheTimeInfo->passStarted(P);
|
TheTimeInfo->passStarted(P);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If TimingInfo is enabled then stop pass timer.
|
/// If TimingInfo is enabled then stop pass timer.
|
||||||
void StopPassTimer(Pass *P) {
|
void llvm::StopPassTimer(Pass *P) {
|
||||||
if (TheTimeInfo)
|
if (TheTimeInfo)
|
||||||
TheTimeInfo->passEnded(P);
|
TheTimeInfo->passEnded(P);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue