search for: runonbasicblock

Displaying 20 results from an estimated 63 matches for "runonbasicblock".

2010 Apr 10
3
[LLVMdev] The "scope" of passes
hi all, i have some thing not so sure about "scope" of llvm passes: suppose i have a function pass PassF and a BasicBlock analysis pass PassB. if i want to use the analysis result of PassB for a BasicBlock in PassF, i think i can create PassB in runOnFunction of PassF, and call runOnBasicBlock manually to get the result: PassB pb; //create a PassB //we also need consider the analysis usage of PassB pb.runOnBasicBlock(bb); // run PassB on bb manually .... use the result of pb ...... is there any other better way? thanks very much --ether -------------- next part -------------- An HTML...
2012 Dec 17
4
[LLVMdev] BasicBlock back()
Hello, I am a beginner of LLVM. I am trying to move among the instructions of a BasicBlock and I cannot. In this particular example, I try to get the previous instruction of the end instruction. I am trying 2 methods: 1. I have the following sequence of code: bool patternDC::runOnBasicBlock(BasicBlock &BB) { ... if (BB.getTerminator()) { Instruction* current = BB.getTerminator(); errs() << "\n LAST: "<<*current<<"\n"; Instruction* prev = &BB.back(); errs() << "\n PENULTIMATE: &q...
2012 Dec 17
0
[LLVMdev] BasicBlock back()
...nner of LLVM. I am trying to move among the instructions of > a BasicBlock and I cannot. In this particular example, I try to get > the previous instruction of the end instruction. I am trying 2 methods: > > > > 1. I have the following sequence of code: > > bool patternDC::runOnBasicBlock(BasicBlock &BB) { > ... > if (BB.getTerminator()) > { > Instruction* current = BB.getTerminator(); > errs() << "\n LAST: "<<*current<<"\n"; > > Instruction* prev = &BB.back(); > e...
2013 Mar 06
1
[LLVMdev] LLVM load instruction query
...pProf= cast<Function>(cpProfFunc); for(Module::iterator F = M.begin(), E = M.end(); F!= E; ++F) { for(Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { anshul_insert::runOnBasicBlock(BB); } } return false; } virtual bool runOnBasicBlock(Function::iterator &BB) { for(BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) {...
2013 Jan 16
2
[LLVMdev] Dynamic Profiling - Instrumentation basic query
...)0); cacheCounter= cast<Function>(hookFunc); for(Module::iterator F = M.begin(), E = M.end(); F!= E; ++F) { for(Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { cacheProf::runOnBasicBlock(BB, hookFunc, context); } } return false; } virtual bool runOnBasicBlock(Function::iterator &BB, Constant* hookFunc, LLVMContext& context) { for(BasicBlock::iterator BI = BB->begin(), BE = BB->end()...
2012 Dec 18
1
[LLVMdev] BasicBlock back()
...ginner of LLVM. I am trying to move among the instructions of a > BasicBlock and I cannot. In this particular example, I try to get the > previous instruction of the end instruction. I am trying 2 methods: > > > > 1. I have the following sequence of code: > > bool patternDC::runOnBasicBlock(BasicBlock &BB) { > ... > if (BB.getTerminator()) > { > Instruction* current = BB.getTerminator(); > errs() << "\n LAST: "<<*current<<"\n"; > > Instruction* prev = &BB.back(); > e...
2010 Apr 19
2
[LLVMdev] The "scope" of passes
...ckPass will be re-run, even if it was run previously and not invalidated. Plus, you can always write a BasicBlockPass *and* a FunctionPass that reuse the same code. For example, you could structure your code this way: classname::analyzeBasicBlock (BasicBlock & BB) { ... } BBClassName::runOnBasicBlock (BasicBlock & BB) { analyzeBasicBlock (BB): } FuncClassName::runOnFunction (Function & F) { for each basic block in F { analyzeBasicBlock (BB) } } The you either use the BasicBlockPass or FunctionPass depending upon what your needs are. -- John T. > > Curre...
2010 Apr 20
0
[LLVMdev] The "scope" of passes
...n passes "out of scope". > > Plus, you can always write a BasicBlockPass *and* a FunctionPass that reuse > the same code. For example, you could structure your code this way: > > classname::analyzeBasicBlock (BasicBlock & BB) { > ... > } > > BBClassName::runOnBasicBlock (BasicBlock & BB) { > analyzeBasicBlock (BB): > } > > FuncClassName::runOnFunction (Function & F) { > for each basic block in F { > analyzeBasicBlock (BB) > } > } > or BBClassName::runOnBasicBlock (BasicBlock & BB) { do something } FuncClassNam...
2012 Aug 22
1
[LLVMdev] Insert Self Written Function Call from a FunctionPass?
...new AllocaInst(IntegerType::getInt32Ty(Context), 0, "count"); count->setAlignment(4); for(Function::iterator F = func.begin(), E = func.end(); F!= E; ++F) { if(F == func.begin()) { bishe_insert::insertOnFirstBlock(F); } bishe_insert::runOnBasicBlock(F); } return false; } /*insert alloca instruction in the start of the first basic block*/ virtual bool insertOnFirstBlock(Function::iterator &BB) { for(BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI)...
2012 Apr 04
2
[LLVMdev] Fwd: [Review Request][PATCH] Add the function "vectorizeBasicBlock"
...ta>(); +    }     typedef std::pair<Value *, Value *> ValuePair;     typedef std::pair<ValuePair, size_t> ValuePairWithDepth; @@ -280,11 +286,7 @@ namespace {                      Instruction *&InsertionPt,                      Instruction *I, Instruction *J); -    virtual bool runOnBasicBlock(BasicBlock &BB) { -      AA = &getAnalysis<AliasAnalysis>(); -      SE = &getAnalysis<ScalarEvolution>(); -      TD = getAnalysisIfAvailable<TargetData>(); - +    bool vectorizeBB(BasicBlock &BB) {       bool changed = false;       // Iterate a sufficient number of...
2012 Apr 04
0
[LLVMdev] [Review Request][PATCH] Add the function "vectorizeBasicBlock"
...std::pair<Value *, Value *> ValuePair; >     typedef std::pair<ValuePair, size_t> ValuePairWithDepth; > @@ -280,11 +286,7 @@ namespace { >                      Instruction *&InsertionPt, >                      Instruction *I, Instruction *J); > > -    virtual bool runOnBasicBlock(BasicBlock &BB) { > -      AA = &getAnalysis<AliasAnalysis>(); > -      SE = &getAnalysis<ScalarEvolution>(); > -      TD = getAnalysisIfAvailable<TargetData>(); > - > +    bool vectorizeBB(BasicBlock &BB) { >       bool changed = false; >    ...
2009 Sep 27
5
[LLVMdev] A basicblock iterator bug in llvm
...0x08367104 llvm::ilist_iterator<llvm::Instruction>::operator--(int) + 28 7 verify-fixrace-stub.so 0xb7f781be defens::verify_fixrace_stub::DFSBackward(llvm::Instruction*, std::string&, int, bool) + 826 8 verify-fixrace-stub.so 0xb7f78311 defens::verify_fixrace_stub::runOnBasicBlock(llvm::BasicBlock&) + 261 9 opt 0x085cdaf4 10 opt 0x085cee1c llvm::FPPassManager::runOnFunction(llvm::Function&) + 250 11 opt 0x085cefb8 llvm::FPPassManager::runOnModule(llvm::Module&) + 98 12 opt 0x085c...
2009 May 23
2
[LLVMdev] Basic Block API
Hi, Is there an API for getting (within a basic block pass) the number of basic block in the program ? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090523/944abb17/attachment.html>
2009 May 23
0
[LLVMdev] Basic Block API
...ware. You will probably need to write code that does this for you. One place to put the code would be in the doInitialization() method of the BasicBlockPass that you're writing. However, I'm not sure if the count would be accurate; other passes could invalidate the information before the runOnBasicBlock() method is called by the PassManager. Another method is to write a separate ModulePass that counts the number of basic blocks. Your pass could list it as a prerequisite, and the PassManager would automatically run this separate ModulePass for you. -- John T. > Thanks. >
2012 Dec 18
1
[LLVMdev] problem with runOnLoop
..._______________________________ > LLVM Developers mailing list > LLVMdev <at> cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > Hello, I am getting same opt Stack dump error frequently as well. Also trying to access basic blocks in runOnBasicBlock(BasicBlock &BB). This is at the 4th line with errs(): Instruction* current = BB.getTerminator(); errs() << "\n last: "<<*current<<"\n"; Instruction* prev = current->getPrevNode(); errs()<<*prev<<"\n"; What can be the cause?
2013 Mar 05
0
[LLVMdev] LLVM load instruction query
Hi Anshul, > I am creating a pass that will pass loaded value by load instruction to an > external function. > I don't know how to do it.Please Help. your question is too vague for anyone to be able to help you. Add details, for example provide the code for your pass. Ciao, Duncan.
2007 Mar 23
1
[LLVMdev] strange pass behaviour
...m using the stl for all lists and stuff. Thanks ST ---- relevant code snipped from MParSchedule.cpp namespace llvm { bool MParSchedule::runOnFunction(Function &F) { for (Function::iterator i = F.begin(), e = F.end(); i != e; ++i) { BasicBlock &B=*i; runOnBasicBlock(B); } return false; } bool MParSchedule::runOnBasicBlock(BasicBlock &B) { // fill the Instruction list and the available values list InstructionList.clear(); //ValueList.clear(); //FIXME: check if not clearing the Value List might cause problems?...
2013 Jan 20
0
[LLVMdev] Dynamic Profiling - Instrumentation basic query
...<Function>(hookFunc); > > for(Module::iterator F = M.begin(), E = M.end(); F!= E; ++F) > { > > for(Function::iterator BB = F->begin(), E = F->end(); BB != > E; ++BB) > { > cacheProf::runOnBasicBlock(BB, hookFunc, context); > } > } > > return false; > } > virtual bool runOnBasicBlock(Function::iterator &BB, Constant* > hookFunc, LLVMContext& context) > { > > for(BasicBlock::i...
2009 May 23
1
[LLVMdev] Basic Block API
...to write code that does > this for you. > > One place to put the code would be in the doInitialization() method of > the BasicBlockPass that you're writing. However, I'm not sure if the > count would be accurate; other passes could invalidate the information > before the runOnBasicBlock() method is called by the PassManager. > > Another method is to write a separate ModulePass that counts the number > of basic blocks. Your pass could list it as a prerequisite, and the > PassManager would automatically run this separate ModulePass for you. > > -- John T. > &gt...
2010 Apr 13
2
[LLVMdev] The "scope" of passes
...e" of llvm passes: >>> >>> suppose i have a function pass PassF and a BasicBlock analysis pass >>> PassB. if i want to use the analysis result of PassB for a BasicBlock in >>> PassF, i think i can create PassB in runOnFunction of PassF, and call >>> runOnBasicBlock manually to get the result: >>> >>> PassB pb; //create a PassB >>> //we also need consider the analysis usage of PassB >>> pb.runOnBasicBlock(bb); // run PassB on bb manually >>> .... use the result of pb ...... >>> >>> is there any oth...