<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 2, 2019, at 11:13, Sjoerd Meijer <<a href="mailto:Sjoerd.Meijer@arm.com" class="">Sjoerd.Meijer@arm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Hi Michael and Florian,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">( <span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">+ llvm-dev for visibility)</span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I would like to quickly follow up on "Pragma vectorize_width() implies vectorize(enable)",</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">which got reverted with commit 858a1ae for 2 reasons, see also that revert commit message. Ignore the assert, that's been fixed now.</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">The other thing is that with the patch behaviour is slightly changed and we could get a diagnostic we didn't get before:</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class="">warning: loop not vectorized: the optimizer was unable to<br class=""></span><div class="">      perform the requested transformation; the transformation might be disabled or<br class=""></div><div class="">      specified as part of an unsupported transformation ordering<br class=""></div><span class="">      [-Wpass-failed=transform-warning]</span><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class=""><br class=""></span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class="">For the example given in revert <span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class="">858a1ae, in both cases before and after my commit, the loop vectoriser was bailing because "Not vectorizing: The exiting block is not the loop latch". But the difference is that <span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class="">vectorize_width() now implies vectorize(enable), and so this is now marked as forced vectorisation which wasn't the case before. </span></span></span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif;" class="">Because of this forced vectorization, and that the transformation wasn't applied, we now emit this diagnostic. T</span></span></span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">he first part of this diagnostic is spot on: "<span style="font-family: Calibri, Arial, Helvetica, sans-serif;" class="">the optimizer was unable to</span></span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""> perform the requested transformation</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">". We could argue about the suggestions given as to why the transformations didn't happen in this case, but overall I think this is an improvement.</span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class=""><br class=""></span></span></span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I just wanted to check if we are happy with this behaviour? Okay to recommit?</div></div></blockquote><br class=""></div><div>The additional warning makes sense to me and I think is also beneficial to the user. </div><div><br class=""></div><div>Before, we silently ignored vector_width() in the example [1] and I suppose the user was expecting vectorize_width(4) to be honored. Now we are more transparent in informing the user what is happening: we were not able to honor their requested pragma and I assume they would be interested in knowing.</div><div><br class=""></div><div>But I think it would be good for the warning to also mention that the requested transformation might not be legal (which is the case for building [1] with -Oz). This makes it a little better.</div><div><br class=""></div><div>Hans, as you reverted the patch, is the warning (modulo wording) in line with what you would expect?</div><div><br class=""></div><div>Cheers,</div><div>Florian</div><div><br class=""></div><div><br class=""></div><div>[1] </div><div><div>      float ScaleSumSamples_C(const float* src, float* dst, float scale, int width) {</div><div>        float fsum = 0.f;</div><div>        int i;</div><div>      #if defined(__clang__)</div><div>      #pragma clang loop vectorize_width(4)</div><div>      #endif</div><div>        for (i = 0; i < width; ++i) {</div><div>          float v = *src++;</div><div>          fsum += v * v;</div><div>          *dst++ = v * scale;</div><div>        }</div><div>        return fsum;</div><div>      }</div></div><br class=""></body></html>