This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, vec-tails 07/10] Support loop epilogue combining

On Tue, Jul 26, 2016 at 11:57 AM, Ilya Enkovich <> wrote:
> 2016-07-26 0:08 GMT+03:00 Jeff Law <>:
>> On 07/25/2016 12:32 PM, Richard Biener wrote:
>>> On July 25, 2016 8:01:17 PM GMT+02:00, Jeff Law <> wrote:
>>>> On 07/22/2016 05:36 AM, Richard Biener wrote:
>>>>> The thing that needs work I think is re-running of if-conversion.
>>>> I wonder if we could revamp if-conversion to work on a subset of the
>>>> CFG?   I can see that potentially being useful in other contexts.
>>>> Would
>>>> that work for you Richi?
>>> Well, you need to make it not need post-dominators or preserve them (or
>>> compute "post-dominators" on SESE regions).
>> Oh, but it'd be so nice to have DOMs and/or PDOMs on regions.  But that's
>> probably out of scope for gcc-7.
>>> What doesn't work with the idea to clone the epilogue using
>>> __built-in_vectorized()
>>> For the if- vs. Not if-converted loop?
>> I must be missing something.   I don't see how builtin_vectorized_function
>> helps, but maybe I've got the wrong built-in or don't understand what you're
>> suggesting.
>> It sounds like this is the biggest impediment to moving forward.  So let's
>> reset and make sure we're all on the same page here.
>> Ilya, what's the fundamental reason why we need to run if-conversion again?
>> Yes, I know you want to if-convert the epilogue, but why?
>> What are the consequences of not doing if-conversion on the epilogue?
>> Presumably we miss a vectorization opportunity on the tail.  But that may be
>> a reasonable limitation to allow the existing work to move forward while you
>> go back and revamp things a little.
> If we have some control-flow in a loop then we have to if-convert it
> for vectorizer.
> We need to preserve both versions: if-converted one for vectorizer and
> the original
> one to be used if vectorization fails.  For epilogues we have similar
> situation and
> need two versions.  I do it by running if-conversion on a copy of original loop.
> Note that it doesn't run full if-conversion pass. If-conversion is
> called for epilogue
> loop only.

But it will still compute post-dominators for the full function for example.

You have the if-converted loop available already - it's the loop we are going
to vectorize.  If if-conversion generated if (__builtin_vectorized_p ()) style
loop copies then you can simply create the epilogue in the same way.
If it didn't then the loop is already if-converted anyway.

I see no need to re-run if-conversion here.


> Thanks,
> Ilya
>> Jeff

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]