search for: hellocount

Displaying 8 results from an estimated 8 matches for "hellocount".

Did you mean: hellocounter
2013 Mar 29
1
[LLVMdev] How to use the llvm::Linker?
...lePass { static char ID; // Pass identification, replacement for typeid Hello2() : ModulePass(ID) {} virtual bool runOnModule(llvm::Module &M){ llvm::Linker *linkertest = new llvm::Linker(programNametest,&M); llvm::errs() << linkertest->getModule(); ++HelloCounter; errs() << "Hello: "; return false; } // We don't modify the program, so we preserve all analyses virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); } }; } char Hello2::ID = 0; static RegisterPass<Hello2&...
2010 Aug 14
0
[LLVMdev] Questions about trip count
..." #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/ScalarEvolution.h" using namespace llvm; STATISTIC(HelloCounter, "Counts number of functions greeted"); namespace { struct Hello: public FunctionPass { static char ID; // Pass identification, replacement for typeid Hello() : FunctionPass(&ID) {} void getLoopInfo(const Function& F) const { const LoopInfo *LI = &getAnalysis<LoopInfo...
2010 Aug 12
2
[LLVMdev] Questions about trip count
On 08/12/2010 09:41 PM, Douglas do Couto Teixeira wrote: > Dear guys, > > I am having problems to obtain good information from the LoopInfo. > I am always getting a trip count of 0, even though I am clearly passing > a loop with a constant bound. I am using this pass below: Hi, I would propose to first check if the trip count is calculated correctly. I would do this with opt
2012 Feb 15
2
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
...} int main() { int a[10]; int b[10]; for(int i=0; i<10; i++) a[i] = i; foo(a,b); return 0; } Obviously, for "foo", it only reads from array "a" and only writes to array "b". The LLVM pass: virtual bool runOnFunction(Function &F) { ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { Instruction *Inst = &*I; if...
2019 Apr 18
3
Opt plugin linkage
...other follow-up, seems like ExecutionEngine is still not usable without editing CMakeLists, on my setup I had to edit CMakeLists.txt as well to get the example working. Below is the modifications I made: Modified Hello.cpp for testing: ``` bool runOnFunction(Function &F) override { ++HelloCounter; std::string errStr; EngineBuilder eb; eb.setErrorStr(&errStr); eb.setEngineKind(EngineKind::Kind::JIT); ExecutionEngine* ee=eb.create(); errs()<<"ExecutionEngine:"<<ee<<" Error:"<<errStr<<"\n";...
2019 Apr 16
2
Opt plugin linkage
Hey: I spent sometime debugging this, it seems like editing ``llvm/tools/opt.cpp`` and move ``cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n");`` to the beginning of main() solved it for me. I'm not sure if this is a bug on LLVM side Zhang ------------------ Original ------------------ From: "Viktor Was BSc via
2012 Feb 16
0
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
...t;10; i++) > a[i] = i; > > foo(a,b); > > return 0; > } > > Obviously, for "foo", it only reads from array "a" and only writes to > array "b". > > The LLVM pass: > virtual bool runOnFunction(Function &F) { > ++HelloCounter; > errs() << "Hello: "; > errs().write_escaped(F.getName()) << '\n'; > > AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); > for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { > Instructio...
2012 Feb 21
0
[LLVMdev] Strange behaviour with x86-64 windows, bad call instruction address
...} int main() { int a[10]; int b[10]; for(int i=0; i<10; i++) a[i] = i; foo(a,b); return 0; } Obviously, for "foo", it only reads from array "a" and only writes to array "b". The LLVM pass: virtual bool runOnFunction(Function &F) { ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { Instruction *Inst = &*I; if...