<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 16 December 2013 21:05, James Molloy <span dir="ltr"><<a href="mailto:james@jamesmolloy.co.uk" target="_blank">james@jamesmolloy.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Fundamentally I think the two approaches aren't compatible, so one needs to be chosen as the preferred route. I actually don't mind which - to me it looks like Hal and Renato prefer metadata, and Nadav and Arnold prefer hooks, but I may have misinterpreted responses.</div>
</div></blockquote><div></div></div><br></div><div class="gmail_extra">Hi James.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I disagree they're incompatible.</div><div class="gmail_extra"><br></div>
<div class="gmail_extra">From my perspective, metadata makes more sense because I (will be able to) easily annotate functions, loops and lexical blocks with #pragma vectorize, so I can tell which other function this one vectorizes and at which width.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">However, this has three short-comings:</div><div class="gmail_extra"><br></div><div class="gmail_extra">1. I'd have to have passed over all metadata, and saved it in a table, to be able to know which calls can be vectorized. Normally, C rules kind of enforce that, but that's not true with all languages.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">2. It's not extensible at all, and will depend heavily on the user annotating the code, the front-end emitting the right IR and the vectorizer recognizing everything.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">3. It'd be harder to cope with complex patterns, like in the case you said about two vectorized functions with different argument. There is both a semantic problem, and a data movement problem that need to be done, and the vectorizer is NOT the right place for that, as both Nadav and Arnold said.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The call-backs, though, would make it harder to implement the #pragma vectorize, unless I have a special call-back for metadata loops, which will deal with all other, non-complex problems. So, in that perspective, we could have both, with the call-back driving the metadata as a plug-in.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div><div class="gmail_extra"><br></div><div class="gmail_extra">PS: I need to read the patch more thoroughly, which I'll do as soon as I send my own on the #pragma...</div>
</div>