search for: getnumsuccessor

Displaying 16 results from an estimated 16 matches for "getnumsuccessor".

Did you mean: getnumsuccessors
2013 Jul 31
1
[LLVMdev] Problem to remove successors
Hi All, I need to remove successors from every basic block to insert new ones I tried this code, but it doesn't work void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) { assert(SuccNum < TI->getNumSuccessors() && "Trying to remove a nonexistant successor!"); // If our old successor block contains any PHI nodes, remove the entry in the // PHI nodes that comes from this branch... // BasicBlock *BB = TI->getParent(); TI->getSuccessor(SuccNum)->remove...
2010 May 04
2
[LLVMdev] Question about GVN
...terator PI = pred_begin(LoadBB), E = pred_end(LoadBB); 1589 PI != E; ++PI) { 1590 BasicBlock *Pred = *PI; 1591 if (IsValueFullyAvailableInBlock(Pred, FullyAvailableBlocks)) { 1592 continue; 1593 } 1594 PredLoads[Pred] = 0; 1595 1596 if (Pred->getTerminator()->getNumSuccessors() != 1) { 1597 if (isa<IndirectBrInst>(Pred->getTerminator())) { 1598 DEBUG(dbgs() << "COULD NOT PRE LOAD BECAUSE OF INDBR CRITICAL EDGE '" 1599 << Pred->getName() << "': " << *LI << '\n'); 16...
2008 Feb 01
1
[LLVMdev] Code Extractor Issue
...an assertion error. define i32 @test(i32 %x) { %tmp = call i32 @test3( i32 %x ) ; <i32> [#uses=1] ret i32 %tmp } The assertion error is: lli: Dominators.cpp:71: void llvm::DominatorTree::splitBlock(llvm::BasicBlock*): Assertion `NewBB->getTerminator()->getNumSuccessors() == 1 && "NewBB should have a single successor!"' failed. lli((anonymous namespace)::PrintStackTrace()+0x22)[0x87f7cb8] lli((anonymous namespace)::SignalHandler(int)+0x110)[0x87f7f7c] /lib/tls/libc.so.6[0x59fa48] /lib/tls/libc.so.6(abort+0x129)[0x5a1319] /lib/tls/libc.so.6(_...
2004 Dec 07
1
[LLVMdev] Question adding dummy basic blocks
...t of this basic block by contrusting a conditional branch(A to B and A to C). Meanwhile we generate a new basic block and unconditional branch which is from C to B. Finally, We got some problems due to PHINODE. I knew the reason, but I failed to fix it. The code is like the following if( TI->getNumSuccessors() ==1){ BasicBlock *TIBB=TI->getParent(); BasicBlock *DestBB=TI->getSuccessor(0); BasicBlock *NewBB = new BasicBlock(TIBB->getName()+DestBB->getName()+"dummy_bb",&F); new BranchInst(DestBB, NewBB); BranchInst *NewBr = new BranchInst(DestBB, NewBB, V_du...
2009 Jul 14
0
[LLVMdev] Profiling in LLVM Patch Followup 1
...have to add a counter of each outgoing edge. If the > + // outgoing edge is not critical don't split it, just insert the counter > + // in the source or destination of the edge. > + TerminatorInst *TI = BB->getTerminator(); > + for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) { > + EdgeCounts[std::make_pair(BB, TI->getSuccessor(s))]+= ECs[i++]; This can end up reading off the end of ECs if the module changes (or the profile information is of a different type). > Index: tools/llvm-prof/llvm-prof.cpp > ================================...
2009 Jul 02
1
[LLVMdev] Profiling in LLVM Patch Followup 1
Hi, this is the first in a series of patches to cleanup and improve the LLVM Profiling Infrastructure. First and foremost this patch removes duplicate functionality from ProfileInfoLoader and ProfileInfo: The ProfileInfoLoader performed not only the loading of the profile information but also some synthesis of block and function execution counts from edge profiling information. Since the
2009 Sep 01
1
[LLVMdev] [llvm-commits] SSI Patch
I tried to make 5 separate patches, but as they are constructive, they had information from the last one. So I will post one by one as it gets on the tree. 1. We had a function isUsedInTerminator that tested if a comparator was used in the terminator of its parent BasicBlock. This is wrong because a comparator can be created in a BasicBlock and used in the terminator of other BasicBlock, and
2015 Apr 24
5
[LLVMdev] Loss of precision with very large branch weights
In PR 22718, we are looking at issues with long running applications producing non-representative frequencies. For example, in these two loops: int g = 0; __attribute__((noinline)) void bar() { g++; } extern int printf(const char*, ...); int main() { int i, j, k; for (i = 0; i < 1000000; i++) bar(); printf ("g = %d\n", g); g = 0; for (i = 0; i < 500000; i++)
2010 Jan 09
2
[LLVMdev] [PATCH] Fix nondeterministic behaviour in the CodeExtractor
...or (std::set<BasicBlock*>::const_iterator i = BlocksToExtract.begin(), + for (SetVector<BasicBlock*>::const_iterator i = BlocksToExtract.begin(), e = BlocksToExtract.end(); i != e; ++i) { TerminatorInst *TI = (*i)->getTerminator(); for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) @@ -633,7 +634,7 @@ Function::BasicBlockListType &oldBlocks = oldFunc->getBasicBlockList(); Function::BasicBlockListType &newBlocks = newFunction->getBasicBlockList(); - for (std::set<BasicBlock*>::const_iterator i = BlocksToExtract.begin(), + for (Set...
2016 Jul 16
3
RFC: Strong GC References in LLVM
...versed was critical), then there are other paths through this // block along which the load may not be anticipated. Hoisting the load // above this block would be adding the load to execution paths along // which it was not previously executed. if (TmpBB->getTerminator()->getNumSuccessors() != 1) return false; Since it would have had edges to the exit block in any predecessor with a may-throw call, it would have gotten the right answer. Anyway, since i still don't plan on proposing changes here, i'm going to stop harping on this for a while. -------------- next par...
2016 Jul 15
4
RFC: Strong GC References in LLVM
On Fri, Jul 15, 2016 at 4:00 PM, Andrew Trick <atrick at apple.com> wrote: > > On Jul 15, 2016, at 3:38 PM, Sanjoy Das <sanjoy at playingwithpointers.com> > wrote: > > > Note that this is also necessary to makes post-dominance correct (but we > > already do it in most cases, but i think there are still bugs open about > > correctness) > > Yeah,
2009 Jul 22
4
[LLVMdev] Profiling in LLVM Patch Followup 1
...unter of each outgoing edge. If the >> + // outgoing edge is not critical don't split it, just insert the counter >> + // in the source or destination of the edge. >> + TerminatorInst *TI = BB->getTerminator(); >> + for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) { >> + EdgeCounts[std::make_pair(BB, TI->getSuccessor(s))]+= ECs[i++]; > > This can end up reading off the end of ECs if the module changes (or > the profile information is of a different type). > >> Index: tools/llvm-prof/llvm-prof.cpp >>...
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
2009 Jul 01
0
[LLVMdev] Profiling in LLVM Patch
...E; ++BB) { > + // Keep track of which blocks need to be instrumented. We don't want to > + // instrument blocks that are added as the result of breaking critical > + // edges! > + BlocksToInstrument.insert(BB); > + NumEdges += BB->getTerminator()->getNumSuccessors(); > + } > + } > + > + const ArrayType *ATy = ArrayType::get(Type::Int32Ty, NumEdges); > + GlobalVariable *Counters = > + new GlobalVariable(ATy, false, GlobalValue::InternalLinkage, > + 0, "OptimalEdgeProfCounters", &M); > + &gt...
2009 Jun 29
7
[LLVMdev] Profiling in LLVM Patch
Hi all, as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/020396.html I implemented the algorithm presented in [Ball94]. It only instruments the minimal number of edges necessary for edge profiling. The main changes introduced by this patch are: *) a interface compatible rewrite of ProfileInfo *) a cleanup of ProfileInfoLoader (some functionality in ProfileInfoLoader
2009 Jul 01
12
[LLVMdev] Profiling in LLVM Patch
...+ // Keep track of which blocks need to be instrumented. We don't want to >> + // instrument blocks that are added as the result of breaking critical >> + // edges! >> + BlocksToInstrument.insert(BB); >> + NumEdges += BB->getTerminator()->getNumSuccessors(); >> + } >> + } >> + >> + const ArrayType *ATy = ArrayType::get(Type::Int32Ty, NumEdges); >> + GlobalVariable *Counters = >> + new GlobalVariable(ATy, false, GlobalValue::InternalLinkage, >> + 0, "OptimalEdgeProfCounter...