search for: user_begin

Displaying 13 results from an estimated 13 matches for "user_begin".

Did you mean: use_begin
2020 Feb 13
3
setOperands(int, Value*)
...cific operand in an Instruction and resetting it with a new value using "setOperands(int, Value*)". I am doing as: for (auto vmitr=vm.begin(), vsitr=vs.begin(); vmitr!=vm.end() && vsitr!=vs.end(); vmitr++, vsitr++){ // I have two *Value ( operands) for ( auto myitr =(*vsitr)->user_begin(); myitr!=(*vsitr)->user_end(); ++myitr){ // Finding the uses of one operand for ( int k = 0; k < (*myitr)->getNumOperands(); k++){ // going through the operands of the Instructions that uses it if ((*myitr)->getOperand(k) == *vsitr){ // Find the operand and its position in the instruct...
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;
2015 May 25
2
[LLVMdev] global variable uses
Hi, I'm trying to change all uses of a global variable so they'll use a different global variable. For instance, I have: @a = global [100 x [100 x i64]] zeroinitializer, align 16 @b = global [100 x [100 x i64]] zeroinitializer, align 16 And I want to change the use %arrayidx = getelementptr inbounds [100 x [100 x i64]]* @a, i32 0, i64 %3 to %arrayidx = getelementptr inbounds
2015 Jan 30
1
[LLVMdev] About user of bitcast/GEP instruction
...ow can this guarantee that it only erase lifetime instrinsics ? -guoqing // The only users of this bitcast/GEP instruction are lifetime intrinsics. // Follow the use/def chain to erase them now instead of leaving it for // dead code elimination later. for (auto UUI = I->user_begin(), UUE = I->user_end(); UUI != UUE;) { Instruction *Inst = cast<Instruction>(*UUI); ++UUI; Inst->eraseFromParent(); } On Fri, Jan 30, 2015 at 1:55 PM, Hal Finkel <hfinkel at anl.gov> wrote: > ----- Original Message ----- > > From: "guo...
2019 Jul 29
2
Efficient way to identify an instruction
...ing, but this returns an iterator range you can iterate through to find instructions that depend on a given one. Similarly, you have the function ‘uses()’ that can be used to traverse down the DAG when instructions are still on SSA form. Look also at the related functions 'user_end()’, 'user_begin()’, 'use_end()' and 'use_begin() I hope this helps. Joan > On 28 Jul 2019, at 08:29, Alberto Barbaro via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi, > I was thinking that maybe there is always some sort of dependency analysis that would allow me to vis...
2017 Jul 20
3
Value
Thank you! I wanted to use the right part of the instruction , %a = alloca i32, align 4 - %a here , but I don't quite understand the difference between Instruction object and Value object of a, which is used further , and in this case : %1 = alloca i32, align 4 - I also wanted to use %1 and in this case the only possibility is Instruction object. 2017-07-20 15:32 GMT+02:00 Evgeny Astigeevich
2014 Aug 09
3
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
...en <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 first loop, you either > need to call Value::user_begin instead of use_begin, or do the cast on > "ui->getUser()". > 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? -Rob ---...
2015 Apr 23
2
[LLVMdev] RFC: Missing canonicalization in LLVM
...same as its store size and the store // size is a legal integer type. if (!Ty->isIntegerTy() && Ty->isSized() && DL.isLegalInteger(DL.getTypeStoreSizeInBits(Ty)) && DL.getTypeStoreSizeInBits(Ty) == DL.getTypeSizeInBits(Ty)) { if (std::all_of(LI.user_begin(), LI.user_end(), [&LI](User *U) { auto *SI = dyn_cast<StoreInst>(U); return SI && SI->getPointerOperand() != &LI; })) { ... After ignoring load/stores which satisfy something like the above code, you can always fallback to the current co...
2015 Jan 30
0
[LLVMdev] About user of bitcast/GEP instruction
----- Original Message ----- > From: "guoqing zhang" <gqzhang81 at gmail.com> > To: llvmdev at cs.uiuc.edu > Sent: Friday, January 30, 2015 4:29:16 AM > Subject: [LLVMdev] About user of bitcast/GEP instruction > > Hi, > > > In PromoteMemoryToRegister.cpp, it seems to rely on the fact that the > only users of bitcast/GEP instruction are lifetime
2015 Jan 30
3
[LLVMdev] About user of bitcast/GEP instruction
Hi, In PromoteMemoryToRegister.cpp, it seems to rely on the fact that the only users of bitcast/GEP instruction are lifetime intrinsics (llvm.lifetime.start/end). I did some searching in llvm/test folder, it seems to be true. However, by reading LLVM IR manual, I don't see any restriction stated on the possible user of bitcast/GEP instruction. So my question is who impose the restriction ?
2017 Jul 20
2
Value
...= alloca i32, align 4 - %a here > > >, but I don't quite understand the difference between Instruction object > and Value object of a, which is used further , and in this case : > > Instr1: alloca i32, align 4 > > If there are users of Instr1 then can access them calling user_begin() > on Instr1. You can access Instr1 from users as in the example above. Of > course you need to keep the pointer to Instr1 somewhere to check that it's > used. > > > > %1 = alloca i32, align 4 - I also wanted to use %1 and in this case the > only possibility is Instruct...
2015 Apr 21
2
[LLVMdev] RFC: Missing canonicalization in LLVM
So this change did indeed have an effect! :) I’m seeing regressions in a number of benchmarks mainly due to a host of extra bitcasts that get introduced. Here’s the problem I’m seeing in a nutshell: 1) There is a Phi with input type double 2) Polly demotes the phi into a load/store of type double 3) InstCombine canonicalizes the load/store to use i64 instead of double 4)
2019 Jul 28
2
Efficient way to identify an instruction
Hi Tim, as always thanks for your help. Unfortunately I made a mistake in my email but apart from that I still have problems. Il giorno sab 27 lug 2019 alle ore 11:53 Tim Northover < t.p.northover at gmail.com> ha scritto: > Hi Alberto, > > On Sat, 27 Jul 2019 at 10:09, Alberto Barbaro via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Having the reference I to