From bed2946a96ecb15b0b636fa74cb26ce61b1c648e Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Mon, 16 Apr 2007 18:10:23 +0000 Subject: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/RSProfiling.cpp | 37 +++++++++++++------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'lib/Transforms/Instrumentation') diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index 2b3adb27cd..7e34786edf 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -60,7 +60,7 @@ namespace { cl::values( clEnumValN(GBV, "global", "global counter"), clEnumValN(GBVO, "ra_global", - "register allocated global counter"), + "register allocated global counter"), clEnumValN(HOSTCC, "rdcc", "cycle counter"), clEnumValEnd)); @@ -82,7 +82,7 @@ namespace { static RegisterAnalysisGroup A("Profiling passes"); static RegisterPass NP("insert-null-profiling-rs", - "Measure profiling framework overhead"); + "Measure profiling framework overhead"); static RegisterAnalysisGroup NPT(NP); /// Chooser - Something that chooses when to make a sample of the profiled code @@ -155,7 +155,7 @@ namespace { }; RegisterPass X("insert-rs-profiling-framework", - "Insert random sampling instrumentation framework"); + "Insert random sampling instrumentation framework"); } //Local utilities @@ -202,14 +202,14 @@ void GlobalRandomCounter::ProcessChoicePoint(BasicBlock* bb) { "countercc", t); Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), - "counternew", t); + "counternew", t); new StoreInst(nv, Counter, t); t->setCondition(s); //reset counter BasicBlock* oldnext = t->getSuccessor(0); BasicBlock* resetblock = new BasicBlock("reset", oldnext->getParent(), - oldnext); + oldnext); TerminatorInst* t2 = new BranchInst(oldnext, resetblock); t->setSuccessor(0, resetblock); new StoreInst(ResetValue, Counter, t2); @@ -275,14 +275,14 @@ void GlobalRandomCounterOpt::ProcessChoicePoint(BasicBlock* bb) { "countercc", t); Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), - "counternew", t); + "counternew", t); new StoreInst(nv, AI, t); t->setCondition(s); //reset counter BasicBlock* oldnext = t->getSuccessor(0); BasicBlock* resetblock = new BasicBlock("reset", oldnext->getParent(), - oldnext); + oldnext); TerminatorInst* t2 = new BranchInst(oldnext, resetblock); t->setSuccessor(0, resetblock); new StoreInst(ResetValue, AI, t2); @@ -304,7 +304,7 @@ void CycleCounter::ProcessChoicePoint(BasicBlock* bb) { CallInst* c = new CallInst(F, "rdcc", t); BinaryOperator* b = BinaryOperator::createAnd(c, ConstantInt::get(Type::Int64Ty, rm), - "mrdcc", t); + "mrdcc", t); ICmpInst *s = new ICmpInst(ICmpInst::ICMP_EQ, b, ConstantInt::get(Type::Int64Ty, 0), @@ -342,8 +342,8 @@ void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNu Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos); profcode.insert(OldVal); Value *NewVal = BinaryOperator::createAdd(OldVal, - ConstantInt::get(Type::Int32Ty, 1), - "NewCounter", InsertPos); + ConstantInt::get(Type::Int32Ty, 1), + "NewCounter", InsertPos); profcode.insert(NewVal); profcode.insert(new StoreInst(NewVal, ElementPtr, InsertPos)); } @@ -366,7 +366,7 @@ Value* ProfilerRS::Translate(Value* v) { TransCache[bb] = bb; //don't translate entry block else TransCache[bb] = new BasicBlock("dup_" + bb->getName(), bb->getParent(), - NULL); + NULL); return TransCache[bb]; } else if (Instruction* i = dyn_cast(v)) { //we have already translated this @@ -462,7 +462,7 @@ void ProfilerRS::ProcessBackEdge(BasicBlock* src, BasicBlock* dst, Function& F) //b: new BranchInst(cast(Translate(dst)), bbC); new BranchInst(dst, cast(Translate(dst)), - ConstantInt::get(Type::Int1Ty, true), bbCp); + ConstantInt::get(Type::Int1Ty, true), bbCp); //c: { TerminatorInst* iB = src->getTerminator(); @@ -484,7 +484,7 @@ void ProfilerRS::ProcessBackEdge(BasicBlock* src, BasicBlock* dst, Function& F) CollapsePhi(dst, bbC); //f: ReplacePhiPred(cast(Translate(dst)), - cast(Translate(src)),bbCp); + cast(Translate(src)),bbCp); CollapsePhi(cast(Translate(dst)), bbCp); //g: for(BasicBlock::iterator ib = dst->begin(), ie = dst->end(); ib != ie; @@ -494,7 +494,7 @@ void ProfilerRS::ProcessBackEdge(BasicBlock* src, BasicBlock* dst, Function& F) if(bbC == phi->getIncomingBlock(x)) { phi->addIncoming(Translate(phi->getIncomingValue(x)), bbCp); cast(Translate(phi))->addIncoming(phi->getIncomingValue(x), - bbC); + bbC); } phi->removeIncomingValue(bbC); } @@ -510,15 +510,16 @@ bool ProfilerRS::runOnFunction(Function& F) { //assume that stuff worked. now connect the duplicated basic blocks //with the originals in such a way as to preserve ssa. yuk! for (std::set >::iterator - ib = BackEdges.begin(), ie = BackEdges.end(); ib != ie; ++ib) + ib = BackEdges.begin(), ie = BackEdges.end(); ib != ie; ++ib) ProcessBackEdge(ib->first, ib->second, F); //oh, and add the edge from the reg2mem created entry node to the //duplicated second node TerminatorInst* T = F.getEntryBlock().getTerminator(); ReplaceInstWithInst(T, new BranchInst(T->getSuccessor(0), - cast(Translate(T->getSuccessor(0))), - ConstantInt::get(Type::Int1Ty, true))); + cast( + Translate(T->getSuccessor(0))), + ConstantInt::get(Type::Int1Ty, true))); //do whatever is needed now that the function is duplicated c->PrepFunction(&F); @@ -527,7 +528,7 @@ bool ProfilerRS::runOnFunction(Function& F) { ChoicePoints.insert(&F.getEntryBlock()); for (std::set::iterator - ii = ChoicePoints.begin(), ie = ChoicePoints.end(); ii != ie; ++ii) + ii = ChoicePoints.begin(), ie = ChoicePoints.end(); ii != ie; ++ii) c->ProcessChoicePoint(*ii); ChoicePoints.clear(); -- cgit v1.2.3