search for: getincomingvalu

Displaying 20 results from an estimated 22 matches for "getincomingvalu".

Did you mean: getincomingvalue
2014 Sep 20
6
[LLVMdev] PHINode containing itself causes segfault when compiling Blender OpenCL kernel with R600 backend
...al to their parent... So I've tried to fix the bug by making handleLoopCondition() skip IncomingValues equal to the Phi itself, but the bug didn't go away! Surprisingly, PHINode may not just contain itself directly, but it also may contain itself inside another PHINode, i.e. Phi->getIncomingValue(0)->getIncomingValue(0) == Phi, which results in the same problem with SIAnnotateControlFlow... Besides "how to make a correct fix" :), my question also is: what are the real semantics of a PHINode containing itself directly or indirectly? I've done some tracing and saw suc...
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
...ipCount(); // save before it's clobbered 392c393,408 < --- > std::cerr << "\tGEPI: " << *GEPI; > if (PHINode *phi = dyn_cast<PHINode>(GEPI->getOperand(0))) > { > if (ConstantExpr *CE = dyn_cast<ConstantExpr>(phi->getIncomingValue(0))) > if (CE->getOpcode() == Instruction::GetElementPtr) // We want this to become explicit... > { > std::cerr << "Block Before: " << *GEPI->getParent(); > Instruction *mul = BinaryOperator::createMul(save...
2012 Mar 08
2
[LLVMdev] Updating value from PHI
...II<<"\n"; PHINode *newPHIvalue = PHINode::Create(PN->getType(), 2, PN->getName().str(), splitBB->getFirstInsertionPt()); int IDX = PN->getBasicBlockIndex(splitBB); while (IDX != -1) { Value *oldValue = PN->getIncomingValue((unsigned(IDX))); PN->removeIncomingValue(IDX, false); newPHIvalue->addIncoming(oldValue, loopLatchBB); newPHIvalue->addIncoming(PN, loopHeaderBB); IDX = PN->getBasicBlockIndex(splitBB); }...
2012 Feb 06
1
[LLVMdev] Fwd: Updating PHI for Instruction Domination?
...03 at gmail.com> Date: Mon, Feb 6, 2012 at 10:36 AM Subject: Re: [LLVMdev] Updating PHI for Instruction Domination? To: Eric Christopher <echristo at apple.com> Since I'm not sure which instructions I might want to replicate, would it be possible to cast the Value from "PHINode::getIncomingValue" to "Instruction" and then copy that and cast it back? On Sun, Feb 5, 2012 at 8:49 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > > On Sun, Feb 5, 2012 at 5:15 PM, Eric Christopher <echristo at apple.com>wrote: > >> >> On Feb 2, 2012, at 5:...
2012 Feb 05
1
[LLVMdev] How to properly use copyValue?
Nick, First, thanks for responding. Secondly, I just want to create an exact copy of an already exisitng Value, this should be pretty simple to do but I'm unclear on how to do this? For example, PHINode::getIncomingValue (unsigned) returns a "Value" and I want to make a copy of that Value. Is there some other way to do this other than copyValue() that I'm missing? On Sat, Feb 4, 2012 at 3:23 PM, Nick Lewycky <nicholas at mxc.ca> wrote: > Ryan Taylor wrote: > >> Since there are no...
2005 Jul 29
0
[LLVMdev] patch for pointer-to-array conversion
...&DeadInsts) { - assert(PN->getNumIncomingValues() == 2 && "Noncanonicalized loop!"); - unsigned PreheaderIdx = PN->getBasicBlockIndex(Preheader); - unsigned BackedgeIdx = PreheaderIdx^1; - if (GetElementPtrInst *GEPI = - dyn_cast<GetElementPtrInst>(PN->getIncomingValue(BackedgeIdx))) - if (GEPI->getOperand(0) == PN) { - assert(GEPI->getNumOperands() == 2 && "GEP types must mismatch!"); - +static std::pair<Value*,Value*> transformPointerRecurrence( + GetElementPtrInst *GEPI, PHINode *PN, BasicBlock *Preheader )...
2012 Mar 08
0
[LLVMdev] Updating value from PHI
...> PHINode *newPHIvalue = PHINode::Create(PN->getType(), 2, > PN->getName().str(), splitBB->getFirstInsertionPt()); > int IDX = PN->getBasicBlockIndex(splitBB); > while (IDX != -1) { > Value *oldValue = PN->getIncomingValue((unsigned(IDX))); > PN->removeIncomingValue(IDX, false); > newPHIvalue->addIncoming(oldValue, loopLatchBB); > newPHIvalue->addIncoming(PN, loopHeaderBB); > IDX = PN->getBasicBlockIndex(splitBB); > &g...
2012 Feb 06
0
[LLVMdev] Updating PHI for Instruction Domination?
...n, Feb 6, 2012 at 10:36 AM > Subject: Re: [LLVMdev] Updating PHI for Instruction Domination? > To: Eric Christopher <echristo at apple.com> > > > Since I'm not sure which instructions I might want to replicate, would it > be possible to cast the Value from "PHINode::getIncomingValue" to > "Instruction" and then copy that and cast it back? > > > On Sun, Feb 5, 2012 at 8:49 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > >> >> >> On Sun, Feb 5, 2012 at 5:15 PM, Eric Christopher <echristo at apple.com>wrote: >> &...
2005 Jul 28
0
[LLVMdev] help with pointer-to-array conversion
...clobbered > 392c393,408 > < > --- >> std::cerr << "\tGEPI: " << *GEPI; >> if (PHINode *phi = dyn_cast<PHINode>(GEPI->getOperand(0))) >> { >> if (ConstantExpr *CE = > dyn_cast<ConstantExpr>(phi->getIncomingValue(0))) >> if (CE->getOpcode() == Instruction::GetElementPtr) // We > want this to become explicit... >> { >> std::cerr << "Block Before: " << *GEPI->getParent(); >> Instruction *mul = > Bina...
2012 Feb 03
5
[LLVMdev] Updating PHI for Instruction Domination?
So my best bet is to try and work in reg2mem mode and then go back to mem2reg? I'm curious, it seems though when you split a block that the phis get updated, right? On Thu, Feb 2, 2012 at 5:05 PM, Eric Christopher <echristo at apple.com> wrote: > Not that I'm aware of. > > -eric > > On Feb 2, 2012, at 3:47 PM, Ryan Taylor wrote: > > So essentially I'm
2012 Feb 06
1
[LLVMdev] Updating PHI for Instruction Domination?
...Mon, Feb 6, 2012 at 10:36 AM > Subject: Re: [LLVMdev] Updating PHI for Instruction Domination? > To: Eric Christopher <echristo at apple.com> > > > Since I'm not sure which instructions I might want to replicate, would it be possible to cast the Value from "PHINode::getIncomingValue" to "Instruction" and then copy that and cast it back? > > > On Sun, Feb 5, 2012 at 8:49 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > > On Sun, Feb 5, 2012 at 5:15 PM, Eric Christopher <echristo at apple.com> wrote: > > On Feb 2, 2012,...
2013 Nov 05
0
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
...*I = dyn_cast<Instruction>(*UI)) { if (I != R && DT_->dominates(BB, I->getParent())) Replace.insert(I); else if (PHINode *Phi = dyn_cast<PHINode>(*UI)) for (unsigned Idx = 0; Idx < Phi->getNumIncomingValues(); ++Idx) if (Phi->getIncomingValue(Idx) == V && DT_->dominates(BB, Phi->getIncomingBlock(Idx))) Phi->setIncomingValue(Idx, R); } for (auto& I : Replace) I->replaceUsesOfWith(V, R); } If this doesn't help, you could try showing us the actual IR you're running the...
2013 Nov 05
2
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
Hello all; So here is my goal: *** If there is a Call instruction to myFunction(int * val), I need to identify all the instructions that uses val in the IR and replace the uses with a newly created pointer. I will also be changing the argument of myFunction to the new pointer. int * val = malloc/calloc; ... myFunction(val); .... *val = 45; becomes== int * val = malloc/calloc; int * val1 =
2013 Nov 05
1
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
...tion>(*UI)) { > if (I != R && DT_->dominates(BB, I->getParent())) > Replace.insert(I); > else if (PHINode *Phi = dyn_cast<PHINode>(*UI)) > for (unsigned Idx = 0; Idx < Phi->getNumIncomingValues(); ++Idx) > if (Phi->getIncomingValue(Idx) == V && > DT_->dominates(BB, Phi->getIncomingBlock(Idx))) > Phi->setIncomingValue(Idx, R); > } > > for (auto& I : Replace) > I->replaceUsesOfWith(V, R); > } > > If this doesn't help, you could try showi...
2012 May 10
1
[LLVMdev] How to get the label field of PHI instruction?
Typical PHI instruction in LLVM goes like this: %P = phi i32* [%A, %BB1], [%B, %BB2] When I try to access all the source operands, only %A and %B are included. I checked the methods in instruction.h, but I didn't find any methods obtaining the label fields i.e. %BB1, %BB2. I notice that each label of a basic block is related with a value which can be referenced in 'br'
2012 Feb 04
0
[LLVMdev] How to properly use copyValue?
Ryan Taylor wrote: > Since there are no constructors for Value, how do you properly insert a > new Value? Value is a pure base. If you want to construct a new Value, then you want to construct a global variable or instruction or argument or something in particular. > If I create a pointer Value *newValue and then call > AA.copyValue(oldValue, newValue), this does not work, since
2012 Mar 08
0
[LLVMdev] Updating value from PHI
I have attached a case of what I am trying to do, I'm pretty sure I'm just missing some simple API call. In the cfg you can see that although Im setting "lsr.iv441" as "lsr.iv44" from for.body.387.i it's not propagating that through the block or graph. On Wed, Mar 7, 2012 at 12:03 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > I am splitting a one BB
2012 Feb 03
2
[LLVMdev] How to properly use copyValue?
Since there are no constructors for Value, how do you properly insert a new Value? If I create a pointer Value *newValue and then call AA.copyValue(oldValue, newValue), this does not work, since newValue is not allocated. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120203/44086cf5/attachment.html>
2020 Mar 18
2
valid BasicAA behavior?
Am Di., 17. März 2020 um 16:56 Uhr schrieb Chawla, Pankaj via llvm-dev <llvm-dev at lists.llvm.org>: > All I am expecting from DA is a direction vector containing (*). There seems to be a bug in DI, see Felipe's answer. > I think the main problem is that currently there is no exact way DA can query AliasAnalysis in a ‘conservatively correct’ manner. > > Using UnknownSize
2012 Mar 07
4
[LLVMdev] Updating value from PHI
I am splitting a one BB loop into two BB. Basically, the one loop BB has 3 incoming values, one form back edge two from other edges. I want to extract the PHIs from the other two edges out into it's own BB and delete that from the loop, then redirect the backedge to the loopbody (non extracted portion) and create a new PHI coming from the extracted BB and the backedge. I can do this;