<div dir="ltr">On 7 June 2013 14:49, Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><span style="color:rgb(34,34,34)">It is not the vectorizer that is the issue, it is the ARM backend that currently translates vectorized floating point IR to NEON instructions (it should scalarize it if desired to do so - i.e. if people care about denormals).</span></div>
</div></blockquote><div><br></div><div style>Hi Arnold,</div><div style><br></div><div style>Can't the vectorizer not generate the v4f32 vectors in the first place, with that flag disabled?</div><div><br></div><div><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><span style="color:rgb(34,34,34)">To fix this issue one would have to fix the backend: i.e not declare v4f32 et al as legal (under a flag). As to making this predicated on fast math flags on operations (something like no-denormals - i don’t think we have that in the IR yet - we only have no nan, no infinite, no signed zeros, etc) I believe this would be a lot harder because I suspect you would have to custom lower all the operations.</span></div>
</div></blockquote><div></div></div><br></div><div class="gmail_extra" style>This is one way of solving it, and maybe we will have to implement it anyway (for hand-coded IR or external front-ends).</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>However, that still doesn't solve the original issue. When the vectorizer analysis the cost of the new loop, it takes into account that now you have four operations (v4f32) instead of one, which is clearly profitable, but if we know that the back-end will serialize, than it's no longer profitable, and can quite possibly hurt performance.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>I think we need both solutions.</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>cheers,</div><div class="gmail_extra" style>
--renato</div></div>