search for: getnumincomingvalues

Displaying 10 results from an estimated 10 matches for "getnumincomingvalues".

2011 Feb 10
1
[LLVMdev] PR9112
...ib/Analysis/ValueTracking.cpp (working copy) @@ -593,6 +593,8 @@ // Otherwise take the unions of the known bit sets of the operands, // taking conservative care to avoid excessive recursion. if (Depth < MaxDepth - 1 && !KnownZero && !KnownOne) { + if (!P->getNumIncomingValues()) + return; KnownZero = APInt::getAllOnesValue(BitWidth); KnownOne = APInt::getAllOnesValue(BitWidth); for (unsigned i = 0, e = P->getNumIncomingValues(); i != e; ++i) { -- Jakub Staszak
2019 Mar 18
2
How to get the possible predecessors for a PHINode
Hi all, I have encountered the following instruction: %.0.i = phi i8* [ %9, %8 ], [ %11, %10 ] How can I get the %8 and %10? I'm using http://llvm.org/doxygen/classllvm_1_1PHINode.html as a reference but I cannot understand how to do that. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL:
2005 Jul 29
0
[LLVMdev] patch for pointer-to-array conversion
...urrence, permitting -/// analysis by the SCEV routines. -void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN, - BasicBlock *Preheader, - std::set<Instruction*> &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->getOpe...
2013 Mar 02
2
[LLVMdev] Question about method CodeExtractor::severSplitPHINodes
...gt;());00193 if (!PN) return; // No PHI nodes.00194 00195 // If the header node contains any PHI nodes, check to see if there is more00196 // than one entry from outside the region. If so, we need to sever the00197 // header block into two.00198 for (unsigned i = 0, e = PN->getNumIncomingValues <http://llvm.org/docs/doxygen/html/classllvm_1_1PHINode.html#aa45f6c0433576e3858a6209a43750ad4>(); i != e; ++i)00199 if (Blocks.count <http://llvm.org/docs/doxygen/html/classllvm_1_1SetVector.html#a0fd2953d62c1b1cabb87e420be5177c4>(PN->getIncomingBlock <http://llvm.org/docs/...
2017 May 01
4
RFC: Stop using redundant PHI node entries for multi-edge predecessors
Hi, On Mon, May 1, 2017 at 8:47 AM, Daniel Berlin via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> Today, the IR requires that if you have multiple edges from A to B >> (typically with a switch) any phi nodes in B must have an equal number of >> entries for A, but that all of them must have the same value. > >> This seems rather annoying.... >> 1) It
2013 Nov 05
0
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
...V->use_end(); UI != UE; ++UI) if (Instruction *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...
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
...E; ++UI) > if (Instruction *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); > } &g...
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
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
...and, // if it is necessary, add to the preceding basic block an instruction // for loading the saved temporary variable's value. PHINode* phiNode = dynamic_cast< PHINode* >( user ); for( unsigned idx = 0; idx < phiNode->getNumIncomingValues(); idx++ ) { if( phiNode->getIncomingValue( idx ) == inst ) { LoadInst* loadedValue = new LoadInst( valuePtr, "value_of_reduced_var", phiNode->getIncomingBlock( idx )->getTerminator() );...