<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" 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 Jan 22, 2021, at 13:26, David Sherwood <<a href="mailto:david.sherwood@arm.com" class="">david.sherwood@arm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Florian,<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">RE: “Are you planning on updating the existing code that generates vector constants to use @llvm.stepvector for fixed width vectors?”<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Are you referring to InnerLoopVectorizer::getStepVector()? I guess this might be<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">worthwhile for consistency and will ensure greater test coverage, provided it doesn’t<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="FR" class="">cause regressions in code quality?<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="FR" class=""><o:p class=""> </o:p></span></div></div></div></blockquote><div><br class=""></div><div><br class=""></div>If we can guarantee that stepvector and the corresponding constant generate the same code in all cases, that seems reasonable. But I guess that would mean we would have to update all places that look through shuffles to also support stepvector? That seems like this is going to potentially be a lot of work and it is easy to miss things (and we have to ensure all new optimizations also consider both cases). </div><div><br class=""></div><div>Will there be a lot of additional test coverage by using it? Are you anticipating most transforms to apply to both fixed width and scalable vectors?</div><div><br class=""></div><div>What I am worried about is that we are claiming @llvm.stepvector behaves like the corresponding vector constant for fixed vectors, but then in practice run into situations where different code is generated, e.g. because we missed to update a transform to support both forms equally. I think it would be easier to avoid this problem altogether, by defining it away and allowing only scalable vector types for @llvm.stepvector, at least initially.</div><div><br class=""></div><div>In terms of consistency/uniformity in LLVM code, we could have `Builder::CreateStepVector()` and `PatternMatch::m_StepVector` to unify creating and matching the different versions depending on the type.</div><div><br class=""></div><div>Personally I also think using stepvector instead of fixed width vector constants like <0, 1, 2, 3> unnecessarily regresses the readability of the generated IR.</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">With regards to the use of constants there is currently an ongoing discussion in<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">another set of replies around the use of vector literals such as <0, 2, …> or<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><1, 3, …>, which you might be interested in? I agree that using an intrinsic should<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">be quite straightforward, but there suggestions for changing how we deal with<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">shufflevectors that would make use of such vector literals.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div></div></blockquote></div></div></div><br class=""></div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think extending vector literals would probably benefit from a wider context beyond stepvector and a wider audience, because it extends to scope of the proposal quite a bit. </div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Cheers,</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Florian</div></div></body></html>