<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;"><br><div><div>On Oct 24, 2013, at 3:00 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="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;">Just a note, I don't think you should or need to vectorize the actual alloca stuff. If you can simply transform the dynamically indexed load:</div><div style="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;"><br></div></blockquote><blockquote type="cite"><div style="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;">Then running SROA and InstCombine will mop up the rest. So its mostly about getting the SLPVectorizer to handle the dynamic GEP. As soon as it does that, everything else will fall away.</div><div style="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;"><br></div></blockquote></div><br><div>I don’t think that Tom wants the SLP-vectorizer to handle dynamic GEPS. What he wants is for the SLP-vectorizer to convert the first part of the code:</div><div><br></div><div><br></div><div><div><blockquote type="cite"><blockquote type="cite"><div>define void @vector(i32 addrspace(1)* %out, i32 %index) {</div><div>entry:</div><div> %0 = alloca [4 x i32]</div><div> %x = getelementptr [4 x i32]* %0, i32 0, i32 0</div><div> %y = getelementptr [4 x i32]* %0, i32 0, i32 1</div><div> %z = getelementptr [4 x i32]* %0, i32 0, i32 2</div><div> %w = getelementptr [4 x i32]* %0, i32 0, i32 3</div><div> store i32 0, i32* %x</div><div> store i32 1, i32* %y</div><div> store i32 2, i32* %z</div><div> store i32 3, i32* %w</div></blockquote><div><br></div></blockquote><div><br></div><div>Into this: Store <i32 0, i32 1, i32 2, i32 3> .... </div><br><blockquote type="cite"><br><blockquote type="cite"><div> %1 = bitcast [4 x i32]* %0 to <4 x i32>*</div><div> %2 = load <4 x i32>* %1</div><div> %3 = extractelement <4 x i32> %2, i32 %index</div><div> store i32 %3, i32 addrspace(1)* %out</div><div> ret void</div><div>}</div></blockquote></blockquote><div><blockquote type="cite"><div><br></div></blockquote></div><br><div><br></div></div></div></body></html>