search for: splitblock

Displaying 20 results from an estimated 31 matches for "splitblock".

2014 Feb 14
2
[LLVMdev] DominatorTree not updated properly after calling the llvm::SplitBlock.
Hi Fellows, I am writing a pass that requires the DominatorTree pass. In the runOnFunction of my own pass, I call llvm::SplitBlock to split a block (%for.end) at it's first insert point. Then, when I dump my dominator tree immediately after, I can see the newly split %for.end.split, but its DFSNumIn and DFSNumOut are not properly updated in llvm::SplitBlock (i.e., still the initialized -1). At the same time, the DT->dum...
2014 Feb 14
2
[LLVMdev] DominatorTree not updated properly after calling the llvm::SplitBlock.
...:59 AM, Andrew Trick <atrick at apple.com> wrote: > > On Feb 13, 2014, at 4:34 PM, Paul Vario <paul.paul.mit at gmail.com> wrote: > > Hi Fellows, > > I am writing a pass that requires the DominatorTree pass. In the > runOnFunction of my own pass, I call llvm::SplitBlock to split a block > (%for.end) at it's first insert point. Then, when I dump my dominator tree > immediately after, I can see the newly split %for.end.split, but its > DFSNumIn and DFSNumOut are not properly updated in llvm::SplitBlock (i.e., > still the initialized -1). At the same...
2008 Nov 19
2
[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
...des() <CodeExtractor.cpp>. The algorithm first separates the header block into two, one containing only PHI nodes and the other containing the remaining non-PHI nodes. The variable NewBB holds the pointer to the latter half block. Later, it tries to update DT information. if (DT) DT->splitBlock(NewBB); In splitBlock, it checks if the NewBB has only one successor. I'm not sure why this is required, but it will fail on cases where NewBB has multiple successors, which are pretty common. For example, a switch or a conditional branch in NewBB can break this check. Could anyone tell me ho...
2008 Nov 20
0
[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
...he algorithm first separates the header block into two, one > containing only PHI nodes and the other containing the remaining non- > PHI nodes. The variable NewBB holds the pointer to the latter half > block. Later, it tries to update DT information. > > if (DT) > DT->splitBlock(NewBB); > > In splitBlock, it checks if the NewBB has only one successor. I'm > not sure why this is required, but it will fail on cases where NewBB > has multiple successors, which are pretty common. For example, a > switch or a conditional branch in NewBB can break this c...
2013 Jun 26
0
[LLVMdev] Can NewBB have more than one successors in DT.splitBlock method?
In Dominators.h, the splitBlock(NewBB) method assumes that the NewBB has only one successor. I don't see why it cant have more than one successors. Is there a reason? Or it's just assumed that way to simplify things? Thanks a lot. -- Wei Dang -------------- next part -------------- An HTML attachment was scrubbed... UR...
2008 Nov 20
1
[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
...> The algorithm first separates the header block into two, one containing > only PHI nodes and the other containing the remaining non-PHI nodes. The > variable NewBB holds the pointer to the latter half block. Later, it tries > to update DT information. > > if (DT) > DT->splitBlock(NewBB); > > In splitBlock, it checks if the NewBB has only one successor. I'm not sure > why this is required, but it will fail on cases where NewBB has multiple > successors, which are pretty common. For example, a switch or a conditional > branch in NewBB can break this check....
2008 Feb 01
1
[LLVMdev] Code Extractor Issue
...try to extract the lone basic block from the following function, I get 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....
2017 Jun 13
2
RFC: Dynamic dominators
...ly) available everywhere. Is this > covered by your current (or planned) work? I'm not sure what you exactly mean by one shot; I'll ask around tomorrow. I wanted to play a little bit with your work, but run in some issues: > > bin/llvm-as ../test/Analysis/Dominators/2007-07-11-SplitBlock.ll > > bin/dominators -to-graph ../test/Analysis/Dominators/2007-07-11-SplitBlock.bc > | tee graph > p 5 5 1 1 > a 1 3 > a 1 5 > a 2 3 > a 3 2 > a 3 4 > e > > bin/dominators graph > Unknown file format for graph > Invalid input graph > I must do somethin...
2010 Jul 20
2
[LLVMdev] How to insert a basic block in an edge
...;> >> I have tried to use SplitEdge function, but failed. Actually the third >> parameter is a variable of type Pass and it need to be non-null. But I >> could not figure out how to use it. Please help me out. > > The only reason it needs a non-NULL Pass* is to call llvm::SplitBlock which > uses P->getAnalysisIfAvailable unconditionally. Feel free to wrap those > calls in 'if (P) { ... }' and send us a patch. > > Of course, the obvious question is why aren't you doing your transforms > inside of a Pass? > > Nick > >> Regards, >&g...
2010 Oct 28
2
[LLVMdev] Splitting a basic block creates an instruction without debug metadata
Hi, I'm not sure if this is really a problem or not, but I noticed that if you're working with bitcode that has debug metadata, and you split a BasicBlock using llvm::SplitBlock or BasicBlock::splitBasicBlock, the unconditional branch added to the new block will lack debug metadata. This turned out not to be a problem for me, since my analysis pass needs only one instruction in the block to have metadata, but perhaps it will be a problem for others. Ignoring for no...
2011 Sep 06
0
[LLVMdev] Fwd: LLVM IR Branchs
...gt; instruction like > if Value1 != Value2, error > without create a new block, continuing the execution in the same block, > forcing the LLI to execute this. You can't do that; a br instruction must be at the end of a block. Splitting a block is trivial, though: the C++ API provides SplitBlock, and if you're just manipulating the text, you can insert a br to a label immediately followed by that label anywhere in any function without changing the semantics of the program. -Eli > 2011/9/5 Eli Friedman <eli.friedman at gmail.com> >> >> On Mon, Sep 5, 2011 at 4:47...
2010 Jul 18
0
[LLVMdev] How to insert a basic block in an edge
...arkar wrote: > Hi, > > I have tried to use SplitEdge function, but failed. Actually the third > parameter is a variable of type Pass and it need to be non-null. But I > could not figure out how to use it. Please help me out. The only reason it needs a non-NULL Pass* is to call llvm::SplitBlock which uses P->getAnalysisIfAvailable unconditionally. Feel free to wrap those calls in 'if (P) { ... }' and send us a patch. Of course, the obvious question is why aren't you doing your transforms inside of a Pass? Nick > Regards, > Chayan > > On Sat, Jul 17, 2010 a...
2009 Dec 03
0
[LLVMdev] Preserving ProfileInfo in several Passes
...// have only one predecessor. > SplitEdge(L->getLoopLatch(), Exit, this); Would it make sense to move the ProfileInfo updating code into SplitEdge? That way all users of SplitEdge would automatically do the right thing. Actually, SplitEdge just delegates to either SplitCriticalEdge or SplitBlock, so those two should do the work. In TailRecursionElimination.cpp, there's logic which uses a "10-fold increase" heuristic. It would be nice if that code were factored out into a utility routine so that the profiling heuristics are more centralized. > - bool Folded = Con...
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 //
2010 Jul 18
2
[LLVMdev] How to insert a basic block in an edge
Hi, I have tried to use SplitEdge function, but failed. Actually the third parameter is a variable of type Pass and it need to be non-null. But I could not figure out how to use it. Please help me out. Regards, Chayan On Sat, Jul 17, 2010 at 10:16 PM, Nick Lewycky <nicholas at mxc.ca> wrote: > Chayan Sarkar wrote: >> >> Hi all, >> >> Suppose in a CFG bb1 has two
2009 Dec 03
2
[LLVMdev] Preserving ProfileInfo in several Passes
Hi all, this (altough a big patch) is actually pretty straight forward: It (tries) to preserve ProfileInfo in all -std-compile-opts passes and all X86-Backend passes. There is still some passes that have corner cases where the ProfileInfo is not correct after the pass. Some passes are still missing... How shall I proceed with this? Andi -------------- next part -------------- A non-text
2010 Jul 21
0
[LLVMdev] How to insert a basic block in an edge
...have tried to use SplitEdge function, but failed. Actually the third >>> parameter is a variable of type Pass and it need to be non-null. But I >>> could not figure out how to use it. Please help me out. >> >> The only reason it needs a non-NULL Pass* is to call llvm::SplitBlock which >> uses P->getAnalysisIfAvailable unconditionally. Feel free to wrap those >> calls in 'if (P) { ... }' and send us a patch. >> >> Of course, the obvious question is why aren't you doing your transforms >> inside of a Pass? >> >> Nick &...
2014 Oct 29
4
[LLVMdev] Emit a jump instruction to a place inside basicblock
Hi all, I'm a beginner in LLVM. Currently, I want to implement a pass that generates a jump table. The entry in that table is a jump to some place (may be an instruction) in a basic block. I'm reading the JumpTable code in llvm 3.5, there is a table which contains jump entries to functions. In AsmPrinter::doFinalization function from file lib/CodeGen/AsmPrinter/AsmPrinter.cpp, it gets a
2015 Jul 11
7
[LLVMdev] instructions copy
Hi, I want to copy some dependent statements, like a = b, b = c, from one basicblock to another basicblocks. Because of SSA, a = b, will be like %1 = load %b, store %1, %a. If I just use clone() method in Instruction class, it will be like <badref> = load %b, store <badref>, %a. If I need remap the virtual registers, this map just will affect the whole module? And how to use it? I am
2011 Sep 06
5
[LLVMdev] Fwd: LLVM IR Branchs
I have two values and I want see if them are equals. Then, I would a instruction like if Value1 != Value2, error without create a new block, continuing the execution in the same block, forcing the LLI to execute this. 2011/9/5 Eli Friedman <eli.friedman at gmail.com> > On Mon, Sep 5, 2011 at 4:47 PM, Rafael Baldiati Parizi > <parizi.computacao at gmail.com> wrote: > >