On Tue, Aug 7, 2012 at 11:45 AM, Steven Bosscher <stevenb....@gmail.com> wrote:
> On Tue, Aug 7, 2012 at 11:22 AM, Richard Guenther
> <richard.guent...@gmail.com> wrote:
>> Another optimization would be to do
>>
>> @@ -440,13 +442,13 @@ compute_global_livein (bitmap livein ATT
>>               && ! bitmap_bit_p (def_blocks, pred_index)
>>               && bitmap_set_bit (livein, pred_index))
>>             {
>> -             *tos++ = pred;
>> +             VEC_safe_push (basic_block, heap, worklist, pred);
>>
>> thus combine the bitmap_set_bit and bitmap_bit_p tests on livein.
>
> That's just a micro-optimization that doesn't help much, because after
> the bitmap_bit_p in the if, the last accessed bitmap member is cached
> and the bitmap_set_bit is almost free.
>
> What is needed here, is a (much) smaller computed livein. In the end,
> the whole set of ~140,000 livein blocks is pruned to just 3, namely
> the loop exits...

So I wonder why simply looping over all SSA defs in a loop body and checking
whether a use is outside of it is not enough to compute this information ...
(yes, we might end up creating too many loop closed PHIs, namely on all
exits rather than just on those that the name is live over, but ... at
least maybe
we can prune it with DOM info)

Richard.

> Ciao!
> Steven

Reply via email to