<div dir="ltr">LGTM.<div><br></div><div>Thanks,</div><div>Manman</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 16, 2014 at 1:45 AM, Stepan Dyatkovskiy <span dir="ltr"><<a href="mailto:stpworld@narod.ru" target="_blank">stpworld@narod.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Fixed.</div><div> </div><div>-Stepan</div><div> </div><div>15.01.2014, 23:48, "Manman Ren" <<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@gmail.com</a>>:</div>
<div class="HOEnZb"><div class="h5"><blockquote type="cite"><div><div>Nits:</div><div> </div><div>-    return LHS.OffsetFromBase < RHS.OffsetFromBase;</div><div>+    if (LHS.OffsetFromBase < RHS.OffsetFromBase)</div>
<div>+      return true;</div><div>+    if (LHS.OffsetFromBase == RHS.OffsetFromBase)</div><div>+      return LHS.SequenceNum > RHS.SequenceNum;</div><div>+    return false;</div><div> </div><div>return (LHS.OffsetFromBase < RHS.OffsetFromBase) || (LHS.OffsetFromBase == RHS.OffsetFromBase && LHS.SequenceNum > RHS.SequenceNum); ?</div>
<div> </div><div><div>+; Function Attrs: nounwind uwtable</div><div>+; CHECK-LABEL: f</div><div>+define void @f() {</div><div>+entry:</div></div><div> </div><div>remove "Function Attrs"?</div><div> </div><div>Thanks,</div>
<div>Manman</div><div> </div></div><div><br><br><div>On Wed, Jan 15, 2014 at 7:04 AM, Stepan Dyatkovskiy <span><<a href="mailto:stpworld@narod.ru" target="_blank">stpworld@narod.ru</a>></span> wrote:<br><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Fixed test<br> <br> Stepan Dyatkovskiy wrote:<br><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hi all.<br> <br> I think, trouble was in DAGCombiner::<u></u>MergeConsequtiveStores.<br>
 <br> Consider, how it works for next example:<br> <br> store i8 1, a[0]<br> store i8 2, a[1]<br> store i8 3, a[1]   ; a[1] again.<br> return   ; DAG starts here<br> <br> 1. Method will collect all the 3 stores.<br> 2. It sorts them by distance from the base pointer (farthest with<br>
 highest index).<br> 3. It takes first consecutive non-overlapping stores and (if possible)<br> replaces them with a single store instruction.<br> <br> The point is, we can't determine here which 'store' instruction<br>
 would be the second after sorting ('store 2' or 'store 3').<br> It happens that 'store 3' would be the second, and 'store 2' would be<br> the third.<br> <br> So after merging we have the next result:<br>
 <br> store i16 (1 | 3 << 8), base   ; is a[0] but bit-casted to i16<br> store i8 2, a[1]<br> <br> So actually we swapped 'store 3' and 'store 2' and got wrong contents in<br> a[1].<br> <br> Fix: In sort routine just also take into account mem-op sequence number.<br>
 <br> -Stepan<br> <br> </div></div>______________________________<u></u>_________________<br> llvm-commits mailing list<br> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
 </blockquote><br> <br>_______________________________________________<br> llvm-commits mailing list<br> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
 </blockquote></div></div></blockquote></div></div></blockquote></div><br></div>