<div dir="ltr">Shahid, I can't find your bugzilla username, so replying here.<div><br></div><div>I haven't dug too deeply, but it looks like the problem is that setting VectorizedValue to Shuf doesn't really do the right thing. If we sort the scalars, then the lanes for the external users are determined using the sorted order, so we really should be extracting from the loads. I'm pretty sure my original test in jumbled-same.ll was actually correct, the extract (from lane 1) really should have been from the load, not from the shuffle.</div><div><br></div><div>Can you please take a look?</div><div><br></div><div>Thanks,</div><div>  Michael</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 1, 2017 at 11:14 AM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This caused miscompiles in Chromium (PR32109). I've reverted in r296654.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Feb 28, 2017 at 7:51 PM, Mohammad Shahid via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: ashahid<br>
> Date: Tue Feb 28 21:51:54 2017<br>
> New Revision: 296575<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=296575&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=296575&view=rev</a><br>
> Log:<br>
> [SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available<br>
> for VectorizeTree() API.This API uses it for proper mask computation to be used in shufflevector IR.<br>
> The fix is to compute the mask for out of order memory accesses while building the vectorizable tree<br>
> instead of actual vectorization of vectorizable tree.<br>
><br>
> Reviewers: mkuper<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D30159" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D30159</a><br>
><br>
> Change-Id: Id1e287f073fa4959713ba545fa425<wbr>4db5da8b40d<br>
><br>
> Added:<br>
>     llvm/trunk/test/Transforms/<wbr>SLPVectorizer/X86/jumbled-<wbr>load-bug.ll<br>
> Modified:<br>
>     llvm/trunk/include/llvm/<wbr>Analysis/LoopAccessAnalysis.h<br>
>     llvm/trunk/lib/Analysis/<wbr>LoopAccessAnalysis.cpp<br>
>     llvm/trunk/lib/Transforms/<wbr>Vectorize/SLPVectorizer.cpp<br>
>     llvm/trunk/test/Transforms/<wbr>SLPVectorizer/X86/jumbled-<wbr>same.ll<br>
</div></div></blockquote></div><br></div>