<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;"><div>Hi Richard, </div><div><br></div><div><div>Thanks for working on this. Comments below. </div><div><br></div></div><div><blockquote type="cite"><div style="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;">I don't understand the basis for the last statement though. Do you mean<br>that you think most cases produce better code if scalarised at the SD stage<br>rather than at the IR level? Could you give an example?</div></blockquote><div><br></div>You presented an example that shows that scalarizing vectors allow further optimizations. But I don’t think that this example represents the kind of problems that we run into in general C++ code. We currently consider vector legalization a codegen problem. LLVM is designed this way to handle certain kind of programs. Other users of LLVM (such as OpenCL JITs) do scalarize early in the optimization pipeline because the problem-domain presents lots of vectors that needs to be legalized. I am very supportive of adding the new scalarization pass, but I don’t want you to add it to the PassManagerBuilder because the PMB is designed for static C compilers, that don’t have this problem. Are you interested in improving code generation for c++ programs or for programs from another domain ?</div><div><br></div><div>Thanks,</div><div>Nadav</div><br></body></html>