Displaying 20 results from an estimated 36 matches for "mergereturns".
Did you mean:
mergereturn
2010 Mar 31
0
[LLVMdev] CFG entry and exit blocks
Dear Trevor,
I'm too lazy to convert your .dot file into a graph file, but I'll make
some comments anyway.
:)
First, LLVM does not guarantee that a function has a single exit block.
Multiple basic blocks can have a return instruction as their terminator
instruction. There is a pass (Unify Function Exit nodes i.e.,
-mergereturn <http://llvm.org/docs/Passes.html#mergereturn>)
2004 Aug 16
1
[LLVMdev] Optimization Levels - Need The Details
On Sat, 2004-08-14 at 21:00, Chris Lattner wrote:
> On Sat, 14 Aug 2004, Reid Spencer wrote:
>
> > I'm at the point in developing llvmc (Compiler Driver) where I need to
> > get the details on the specific optimization arguments that the -O
> > family of options should (by default) issue to "opt". I'm soliciting
> > your feedback on this so I can
2010 May 09
0
[LLVMdev] Remove identical or redundant basic blocks?
Eugene Toder wrote:
> Would it make sense to have a similar pass that operates on llvm main IR?
>
The unify exit return node (-mergereturn?) pass should take care of the
first example. The -simplifycfg option might take care of the second
example. Both work on LLVM IR.
-- John T.
> On Sat, May 8, 2010 at 5:15 PM, Dale Johannesen <dalej at apple.com> wrote:
>
>>
2010 Mar 31
2
[LLVMdev] CFG entry and exit blocks
Hi,
I'm confused about the entry and exit blocks of an LLVM CFG. I
understand that every CFG has one and only one entry block, and this
is confirmed by the existence of the getEntryBlock function in the
Function class.
But what about exit (a.k.a. return) blocks? At first I assumed that
LLVM CFGs have one and only one exit block, too, but the following
code is a counter-example:
2010 May 08
2
[LLVMdev] Remove identical or redundant basic blocks?
Would it make sense to have a similar pass that operates on llvm main IR?
On Sat, May 8, 2010 at 5:15 PM, Dale Johannesen <dalej at apple.com> wrote:
> The branch folding pass does this, but it operates later, on the
> target-dependent form in llc.
>
> On May 8, 2010, at 8:48 AM, Heinz Riener wrote:
>
>> Dear all,
>>
>> after optimizing a small LLVM example
2010 May 09
1
[LLVMdev] Remove identical or redundant basic blocks?
Dale is totally right, all of these blocks disappear in later
target-dependent optimizations. I have not thought about that since
eliminating these blocks requires no target-dependent information.
However, I guess it is not worth eliminating them earlier.
John, I tried your advice and executed opt (after -O3) again with
-mergereturn and -simplifycfg: The -mergereturn pass introduces
another
2010 Jul 24
2
[LLVMdev] Controlling the order of a FunctionPass
John Criswell wrote:
> Trevor Harmon wrote:
>> On Jul 22, 2010, at 2:05 PM, John Criswell wrote:
>>
>>
>>> If you write your pass as a ModulePass, then you can iterate over the
>>> functions in any order that you want.
>>>
>>
>> I had considered that, but my FunctionPass depends on other passes
>> processing the functions first:
2013 Nov 15
2
[LLVMdev] dominator, post-dominator and memory leak
Hi Henrique,
I have tried using -mergereturn and inserting a free into the predecessors
of dominance frontier of malloc block and it caused double free. It is
possible for multiple free's to be inserted on the path from malloc to an
exit. For example, in the following CFG:
BB10 (malloc)
/ \
BB11 BB12
... / \ / \
2013 Nov 13
0
[LLVMdev] dominator, post-dominator and memory leak
>
> It seems that placing the calls to free at the predecessors of dominance
> frontier is inadequate. It is possible that there are exit blocks that are
> dominated by BB12 (calls to malloc). I guess we can also insert calls to
> free at these exit blocks too.
That crossed my mind a few minutes later. : )
If you're interested, PRE.cpp existed last at r25315. It calculates the
2013 Nov 15
0
[LLVMdev] dominator, post-dominator and memory leak
Try breaking the critical edges (-break-crit-edges).
This way, a new block will be created between BB13 and BB11 (call this
BB11.break) and BB15 and BB12 (call this BB12.break).
The predecessors of the dominance frontier will, thus, be BB11.break,
BB12.break, and BB14.
When we enter through a block with a call to malloc(), we will end up in
one of the blocks in the dominance frontier (kind of).
2017 Mar 02
5
Structurizing multi-exit regions
Hi,
I'm trying to solve a problem from StructurizeCFG not actually handling
regions with multiple exits. Sample IR attached.
StructurizeCFG doesn't touch this function, exiting early on the
isTopLevelRegion check. SIAnnotateControlFlow then gets confused and
ends up inserting an if into one of the blocks, and the matching end.cf
into one of the return/unreachable blocks. The input to
2010 Mar 31
2
[LLVMdev] CFG entry and exit blocks
On Mar 30, 2010, at 7:51 PM, John Criswell wrote:
> I'm too lazy to convert your .dot file into a graph file
What format should I have posted? (I'm not sure what you mean by
"graph file".) I had thought that .dot was the preferred format here,
since that's what LLVM generates (e.g., "opt -dot-cfg ...").
> First, LLVM does not guarantee that a function
2013 Nov 13
3
[LLVMdev] dominator, post-dominator and memory leak
Hi Henrique,
Thanks for the quick reply!
On Tue, Nov 12, 2013 at 9:13 PM, Henrique Santos <
henrique.nazare.santos at gmail.com> wrote:
> PRE normally uses a latest placement algorithm to do something of the sort.
> I don't know about GVN/PRE, but older version of PRE might have it.
> Just placing the calls to free at the predecessors (dominated by BB12) of
> the dominance
2010 Jul 23
0
[LLVMdev] Controlling the order of a FunctionPass
Trevor Harmon wrote:
> On Jul 22, 2010, at 2:05 PM, John Criswell wrote:
>
>
>> If you write your pass as a ModulePass, then you can iterate over the
>> functions in any order that you want.
>>
>
> I had considered that, but my FunctionPass depends on other passes
> processing the functions first:
>
Two things to consider:
1) The PassManager
2010 Aug 05
1
[LLVMdev] a problem when using postDominatorTree
Wenbin Zhang wrote:
> I'll try the trunk, as well as check my code again. If indeed it's not
> fixed, I'll try to post a triggering case here.
> Thanks for the advice~
>
Did you run the -mergereturn pass (it might also be called
UnifyExitNodes in the source code)? This is the pass that ensures that
each function has exactly one basic block that returns control to the
2010 Jul 22
3
[LLVMdev] Controlling the order of a FunctionPass
On Jul 22, 2010, at 2:05 PM, John Criswell wrote:
> If you write your pass as a ModulePass, then you can iterate over the
> functions in any order that you want.
I had considered that, but my FunctionPass depends on other passes
processing the functions first:
void MyPass::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<UnifyFunctionExitNodes>();
2010 Aug 05
3
[LLVMdev] a problem when using postDominatorTree
On 08/05/2010 06:46 AM, Wenbin Zhang wrote:
> Hi all,
> I'm using postDominatorTree to do some program analysis. My code works
> well for small tests, but when I run it on real applications, the
> following error occurs:
> /Inorder PostDominator Tree: DFSNumbers invalid: 0 slow queries.
> [1] <<exit node>> {0,21}
> [2] %bb1 {1,2}
> [2] %bb {3,4}
> [2]
2013 Nov 13
2
[LLVMdev] dominator, post-dominator and memory leak
Thanks! I will try that and see whether it works.
On Wed, Nov 13, 2013 at 5:01 AM, Henrique Santos <
henrique.nazare.santos at gmail.com> wrote:
> It seems that placing the calls to free at the predecessors of dominance
>> frontier is inadequate. It is possible that there are exit blocks that are
>> dominated by BB12 (calls to malloc). I guess we can also insert calls to
2004 Aug 15
0
[LLVMdev] Optimization Levels - Need The Details
On Sat, 14 Aug 2004, Reid Spencer wrote:
> I'm at the point in developing llvmc (Compiler Driver) where I need to
> get the details on the specific optimization arguments that the -O
> family of options should (by default) issue to "opt". I'm soliciting
> your feedback on this so I can start testing optimization. Hopefully you
> can provide it by early this coming
2013 Nov 13
0
[LLVMdev] dominator, post-dominator and memory leak
Bill,
Just in case this is relevant for you: If you're working with C++ code, or otherwise have any functions that might throw exceptions, you might also need to catch those exceptions in order to free the allocated memory. This will involve looking for calls to functions that mayThrow(), changing their calls to invokes, and freeing the memory before resuming the unwinding.
-Hal
-----