<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">The loop vectorizer runs *once* in our pass pipeline (actually twice, a second time in LTO). It is outside the inliner SCC pass manager.<div><br></div><div>The SLP vectorizer runs as part of the inliner SCC pass manager. This is done consciously. We want to have noalias attributes available that disappears (until recently - Hal will/has fixed this) during inlining.</div><div><br></div><div>There are know regressions - most notably phoronix Cray benchmark (if memory serves right). Because of bad interaction with SROA.</div><div><br></div><div>I wanted to move the SLP vectorizer out of the SCC pass (or at least evaluate doing so) once the noalias deficiency is fixed.</div><div><br></div><div>My feeling is that we should move the SLPVectorizer after the loop vectorizer when doing this because loop vectorization is more powerful (it vectorizes by a factor greater than the parallelism available in a basic block).</div><div><br></div><div><br></div><div><br></div><div><div><blockquote type="cite"><div>On Jul 25, 2014, at 8:41 AM, James Molloy <<a href="mailto:james.molloy@arm.com">james.molloy@arm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Hi Nadav, Arnold,<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">I’ve come across an interesting optimization problem in one of the SPEC benchmarks. There is a loop that can be optimized by both the SLP vectorizer and the loop vectorizer (when I patch the loop vectorizer to deal with fsub reductions).<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">The SLP vectorizer actually makes the performance worse – I think this is due to a lack of loop unrolling afterwards. The Loop vectorizer can improve the performance.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">However, the loop vectorizer runs after the SLP vectorizer, so it never gets a chance. I’d have thought the ideal order would be Loop Vectorizer -> SLP vectorizer -> BB vectorizer, given that the loop vectorizer if it can run will probably give greater speedup than SLP.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">The current sequence is SLP vectorizer -> BB vectorizer -> Loop vectorizer.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">What are your thoughts on this?<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Cheers,<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">James</div></div></div></blockquote></div><br></div></body></html>