How can I generate a new function at compile time?

2014-04-24 Thread Benedikt Huber
Hi! I want to uninline some basic blocks to a separate function to aid slp vectorization. The new pass runs just before the slp vectorization pass. As a first try I create an new and empty function. Which in turn will be filled with some copies of basic blocks from the original function. As an e

Re: How can I generate a new function at compile time?

2014-04-30 Thread Benedikt Huber
Thank you for the hint. I managed to extract the basic blocks to a helper function and put a call to this helper function at the place of the removed basic blocks in the original function. All this is done with help of move_sese_region_to_fn. The helper function is created similar to create_omp_c

Re: How can I generate a new function at compile time?

2014-05-27 Thread Benedikt Huber
(Sorry for the duplicate.) I managed to pass the needed parameters to the generated function. However I cannot pin down the reason why the compilation fails. It seems that the cfg is somehow broken, but I cannot tell how. Do you have any debugging hints? As far as I can tell, the cfg is changed d

Re: How can I generate a new function at compile time?

2014-05-27 Thread Benedikt Huber
On 27 May 2014, at 17:09, Richard Biener wrote: > On Tue, May 27, 2014 at 5:03 PM, Benedikt Huber > wrote: >> (Sorry for the duplicate.) >> >> I managed to pass the needed parameters to the generated function. >> However I cannot pin down the reason why the compi

Re: How can I generate a new function at compile time?

2014-05-27 Thread Benedikt Huber
On 27 May 2014, at 17:25, Richard Biener wrote: > On Tue, May 27, 2014 at 5:17 PM, Benedikt Huber > wrote: >> >> On 27 May 2014, at 17:09, Richard Biener wrote: >> >>> On Tue, May 27, 2014 at 5:03 PM, Benedikt Huber >>> wrote: >>>> (

Re: How can I generate a new function at compile time?

2014-05-28 Thread Benedikt Huber
s. Best regards, Benedikt On 27 May 2014, at 17:35, Benedikt Huber wrote: > > On 27 May 2014, at 17:25, Richard Biener wrote: > >> On Tue, May 27, 2014 at 5:17 PM, Benedikt Huber >> wrote: >>> >>> On 27 May 2014, at 17:09, Richard Biener wrote: &g

Re: How can I generate a new function at compile time?

2014-06-03 Thread Benedikt Huber
2014, at 15:50, Richard Biener wrote: > On Wed, May 28, 2014 at 3:28 PM, Benedikt Huber > wrote: >> I ported the pass to the fsf trunk. It is built with —enable-checking. >> The patch applied with no changes and also the behaviour is the same. >> So I probably mess up the

Re: How can I generate a new function at compile time?

2014-06-03 Thread Benedikt Huber
am a little confused by that, since comdats does not change anything. But maybe there is no connection between the violated assertion and the vanishing function. On 03 Jun 2014, at 15:14, Richard Biener wrote: > On Tue, Jun 3, 2014 at 3:03 PM, Benedikt Huber > wrote: >> >> I

Re: How can I generate a new function at compile time?

2014-06-03 Thread Benedikt Huber
Ah, now I get it. So the reason is that comdats is the last ipa pass that is run. I continue to look for the problem in purge_dead_edges. Thank you for the explanation. Best regards, Benedikt On 03 Jun 2014, at 16:10, Richard Biener wrote: > On Tue, Jun 3, 2014 at 3:59 PM, Benedikt Hu

How to duplicate a loop including basic_blocks and edges?

2014-06-27 Thread Benedikt Huber
Hello everybody, I want to make a copy of a loop, but it seems that the function duplicate_loop does not work the way I need it. It does not copy basic_blocks and edges. What I need is this transformation // Original int foo () { int i, b; i = 0; b = 50; for (; i <= b; ++b) { LOOP_B

LTO problems with -fprofile-generate (aarch64)

2015-02-24 Thread Benedikt Huber
Hi, I have problems compiling xalan as part of spec2006 benchmark for aarch64, both native and cross. The issue arises when both -flto and -fprofile-generate are enabled during LTO. Compiling with the same flags for x86 has no problem. Also other projects for aarch64 compile with -flto and -fprof

Re: LTO problems with -fprofile-generate (aarch64)

2015-02-25 Thread Benedikt Huber
Compiling with -flto-partition=none succeeds, however increases compilation time significantly. One interesting thing is that even the failed compile produces an executable that works. Is that normal? Should I really attach the ipa-cgraph dump to the bug report? The file is 945M big, 27M compress

Unintended variable renaming in SSA replacement table

2015-03-17 Thread Benedikt Huber
Hi, I have a problem with a transformation pass I wrote. The pass is meant to pipeline and unroll lookups in linked lists. After my pass is run, gcc renames a variable, which leads to wrong results. Part of my pass's dump, which is as I want it. ... : list_38 = list_10->next; _22 = list_10

Re: Unintended variable renaming in SSA replacement table

2015-03-17 Thread Benedikt Huber
7 Mar 2015, at 19:25, Jeff Law wrote: > On 03/17/2015 06:32 AM, Benedikt Huber wrote: >> Hi, >> >> I have a problem with a transformation pass I wrote. >> The pass is meant to pipeline and unroll lookups in linked lists. >> >> After my pass is run, gcc rena

Re: Unintended variable renaming in SSA replacement table

2015-03-18 Thread Benedikt Huber
03/17/2015 12:54 PM, Benedikt Huber wrote: >> Thank you for the answer. >> I made sure that each variable is only assigned exactly once. >> duplicate_block already generates new names for all lhs. >> After that I edited all rhs to the uses I wanted for the unrolling, >