search for: use_iterators

Displaying 20 results from an estimated 173 matches for "use_iterators".

Did you mean: use_iterator
2014 Sep 25
2
[LLVMdev] MachineRegisterInfo use_iterator/reg_iterator?
Hi folks, I would like to find out the machine instructions that use some given registers in the reverse order, and I came across these iterators (use_iterator/reg_iterator). However, there are two things I noticed: 1) These iterators seem to traverse the machine function a bit differently from what I get from the machine function dump. In other words, the use_iterator list is not constructed in
2014 Sep 25
2
[LLVMdev] MachineRegisterInfo use_iterator/reg_iterator?
Thanks Quentin. I'm trying to examine from the operands of the return instruction, and then to get the last assignment of those. I thought use_iterator/reg_iterator may suit better than just loop through the machine basicblock in the reverse order. Cheng-Chih On Thu, Sep 25, 2014 at 1:51 PM, Quentin Colombet <qcolombet at apple.com> wrote: > Hi Cheng-Chih, > > On Sep 25,
2012 Apr 19
3
[LLVMdev] def-use chains and use-def chains
Hi, I need to find out all the places where the value of a variable is being used. For this I have to implement reaching definitions(def-use chains). When I searched for its implementation I found Iterating over def-use & use-def chains <http://llvm.org/docs/ProgrammersManual.html#iterate_chains>. will this work for finding the places where a variable is reaching? I tried to use
2014 Aug 09
3
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
On Sat, Aug 9, 2014 at 6:06 AM, Tim Northover <t.p.northover at gmail.com> wrote: > Hi Rob, > > On 9 August 2014 02:03, Rob Jansen <jansen at cs.umn.edu> wrote: > > Why is the first for loop not equivalent to the second? > > In the second loop, "*ui" is an llvm::Use object. It's owned by a > User, but isn't a subclass of one. To match the
2012 Apr 20
0
[LLVMdev] def-use chains and use-def chains
Hi Duncan Sands, I frankly don't know what a variable gets converted to (SSA register or memory chunk). What I meant is, for example I1: int i, j=10; I2: scanf("%d", &j); I3: i = j + 1; Here I want to know whether the value of j in I1 reaches I3 or not. Best Regards, Srikanth Vaindam you didn't define what you mean by a variable. LLVM has virtual registers which are
2007 Jul 12
2
[LLVMdev] BasicCallGraph patch
The current BasicCallGraph will miss call sites like this: %tmp86 = call i8* (...)* bitcast (i8* ()* @find_ispell to i8* (...)*)( ) ; <i8*> [#uses=1] Here the direct user of @find_ispell is a ConstantExpr. I added several lines of code to address this case. Below is the output of command: svn diff lib/Analysis/IPA/CallGraph.cpp Attached is LLVM asm files with such function calls.
2009 Apr 14
0
[LLVMdev] InstVisitor Example
...ficient pass, which inherits from ModulePass, currently iterates through the Module, Functions, and BasicBlocks multiple times (once to find strcpy, another to find strcat, and so on for various other functions). If I only care about the direct calls, would I benefit more from switching to multiple use_iterators or the InstVisitor template? - Brice On Tue, Apr 14, 2009 at 1:13 PM, Luke Dalessandro <luked at cs.rochester.edu> wrote: > > On Apr 14, 2009, at 1:49 PM, Luke Dalessandro wrote: > > I guess I should note that the "use iteration" will only work for > direct calls. I...
2005 May 11
3
[LLVMdev] Computing live values
Say I want to find all LLVM Value*-es that a live on exit from a basic block. What's the best way? - The 'LiveRange', 'LiveVariables' and 'LiveIntervals' classes seem to be tied to register allocation. - The ./lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.h file seem to provide what I need, but it's no a public header. - Volodya
2009 Apr 14
3
[LLVMdev] InstVisitor Example
On Apr 14, 2009, at 1:49 PM, Luke Dalessandro wrote: > > On Apr 14, 2009, at 12:48 PM, Brice Lin wrote: > >> I just read the LLVM Programmer's Manual, which mentions (but >> specifically does not include any details of) the InstVisitor >> template. Could someone please provide an example of how to use this >> template to find (as an example) all CallSites for
2015 Aug 17
4
Aggregate load/stores
Even if I turn to -O0 [in other words, no optimisation passes at all], it takes the same amount of time. The time is spent in 12.94% lacsap lacsap [.] llvm::SDNode::use_iterator::operator== 7.68% lacsap lacsap [.] llvm::SDNode::use_iterator::operator* 7.53% lacsap lacsap [.] llvm::SelectionDAG::ReplaceAllUsesOfValueWith 7.28% lacsap
2009 Oct 11
3
[LLVMdev] Some additions to the C bindings
On Oct 6, 2009, at 5:47 PM, Kenneth Uildriks wrote: > On Tue, Oct 6, 2009 at 2:13 PM, Kenneth Uildriks > <kennethuil at gmail.com> wrote: >> My front-end is sync'd with the trunk now, and working well, but it >> required some additional functions exposed in the C bindings. I >> hereby submit them for review and approval for inclusion in the >> trunk.
2005 May 11
1
[LLVMdev] Computing live values
On Wed, 11 May 2005, Alkis Evlogimenos wrote: > On Wed, 2005-05-11 at 13:17 -0500, Chris Lattner wrote: >> On Wed, 11 May 2005, Vladimir Prus wrote: >>> Say I want to find all LLVM Value*-es that a live on exit from a basic block. >>> What's the best way? >>> >>> - The 'LiveRange', 'LiveVariables' and 'LiveIntervals' classes
2007 Jul 17
0
[LLVMdev] BasicCallGraph patch
On Thu, 12 Jul 2007, Zhongxing Xu wrote: > The current BasicCallGraph will miss call sites like this: > %tmp86 = call i8* (...)* bitcast (i8* ()* @find_ispell to i8* (...)*)( ) > ; <i8*> [#uses=1] > > Here the direct user of @find_ispell is a ConstantExpr. > I added several lines of code to address this case. > Below is the output of command: svn diff
2014 Aug 09
2
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
Why is the first for loop not equivalent to the second? Thanks, Rob =========================== for (GlobalVariable **i = Globals.begin(), **e = Globals.end(); i != e; ++i) { GlobalVariable *GV = *i; Constant *GEP = ConstantExpr::getGetElementPtr(...); GV->replaceAllUsesWith(GEP); } =========================== for (GlobalVariable **i = Globals.begin(), **e = Globals.end(); i != e;
2014 Aug 09
1
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
> I think this is incorrect since the use_iterator is defined as: > > `typedef value_use_iterator<User> use_iterator;` > > and indeed `ui->getUser();` is not a callable function on a User. What am I > missing? Ah, looks like this has changed this year. What I said applies to trunk; you may be right there about 3.4 or earlier (looks plausible from the key commit).
2010 Jan 25
3
[LLVMdev] Deterministic iteration over llvm iterators
Forgot cc, the entire group. How can deterministically iterate over the uses of a variable. i.e. the uses should be any particular order that doesn't change from execution to execution of the opt tool. To make myself more clearer, here is a snippet of code that has Values reordered each time I analyze a particular piece of code(which doesn't change) with the LLVM opt tool and my LLVM
2007 Jul 17
2
[LLVMdev] BasicCallGraph patch
I am doing inter-procedural static analysis, so I need to do DFS of call graph. llvm-gcc sometimes generates this kind of call instruction, which cause the call graph to be incomplete. But thanks for your information, instcombine really solves the problem. On 7/17/07, Chris Lattner <sabre at nondot.org> wrote: > > On Thu, 12 Jul 2007, Zhongxing Xu wrote: > > The current
2009 Jul 17
2
[LLVMdev] Bug in LiveIntervals? Please Examine
In LiveIntervals::processImplicitDefs() we have this: for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(Reg), UE = mri_->use_end(); UI != UE; ) { MachineOperand &RMO = UI.getOperand(); MachineInstr *RMI = &*UI; ++UI; MachineBasicBlock *RMBB = RMI->getParent(); if (RMBB == MBB) continue; const
2008 Dec 05
1
[LLVMdev] replacing a global variable by a constant
Thanks a lot for your help Matthijs! :) basically this does the job quite nicely I think: for (llvm::GlobalVariable::use_iterator U = gv->use_begin(); U != gv->use_end(); ++U) { llvm::Instruction *I = llvm::cast<llvm::Instruction>(U); I->replaceAllUsesWith(constPtr); I->eraseFromParent(); } Cheers, Ralf Matthijs Kooijman wrote: > Hi Ralf, > > >> I
2009 Apr 21
4
[LLVMdev] Iterating over all uses of a Function
Hi, I try to iterate over all uses of a Function with the following code (simplified): for (Value::use_iterator UI = F->use_begin(), UE = F->use_end(); UI != UE; ++UI) { if (CallInst* I = dyn_cast<CallInst>(*UI)) { // do something interesting } } This works on Linux, but on Windows the dyn_cast fails, even though the only use of F in that