<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Are you going to test ARM and x86? Otherwise could you send out your patch even though it is preliminary?<div class=""><br class=""></div><div class="">Thanks</div><div class="">Gerolf</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 9, 2014, at 12:44 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">I have a patch I've been testing to clean up a lot of the passes around the vectorizers. I'll add this in and finish testing it, then send it out with numbers.</p>
<div class="gmail_quote">On Oct 9, 2014 12:40 PM, "Andrew Trick" <<a href="mailto:atrick@apple.com" class="">atrick@apple.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 9, 2014, at 8:48 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>> wrote:</div><br class=""><div class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">----- Original Message -----</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">From: "Arnold Schwaighofer" <<a href="mailto:aschwaighofer@apple.com" target="_blank" class="">aschwaighofer@apple.com</a>><br class="">To: "Zinovy Nis" <<a href="mailto:zinovy.nis@gmail.com" target="_blank" class="">zinovy.nis@gmail.com</a>><br class="">Cc: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>>, "LLVM Commits" <<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a>>, "Tobias Grosser" <<a href="mailto:tobias@grosser.es" target="_blank" class="">tobias@grosser.es</a>>,<br class="">"Chandler Carruth" <<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>>, "Nadav Rotem" <<a href="mailto:nrotem@apple.com" target="_blank" class="">nrotem@apple.com</a>><br class="">Sent: Thursday, October 9, 2014 10:07:42 AM<br class="">Subject: Re: SLP/Loop vectorizer pass ordering<br class=""><br class=""><br class="">The loop vectorizer now sees this loop:<br class=""><br class="">define void<br class="">@_Z21ambient_occlusion_vecP6_IsectR5vrandILm8EE(%struct._Isect*<br class="">nocapture %isect, %class.vrand* nocapture readonly<br class="">dereferenceable(32) %rng) #0 {<br class="">entry:<br class=""> br label %for.body<br class=""><br class="">for.body:                                         ; preds =<br class="">%for.inc.for.body_crit_edge, %entry<br class=""> %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next,<br class=""> %for.inc.for.body_crit_edge ]<br class=""> %occlusion.017 = phi float [ 1.000000e+00, %entry ], [ %phitmp,<br class=""> %for.inc.for.body_crit_edge ]<br class=""> %exitcond = icmp eq i64 %indvars.iv, 63<br class=""> br i1 %exitcond, label %for.end, label %for.inc.for.body_crit_edge<br class=""><br class="">for.inc.for.body_crit_edge:                       ; preds = %for.body<br class=""> %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br class=""> %phitmp = fadd fast float %occlusion.017, 1.000000e+00<br class=""> br label %for.body<br class=""><br class="">for.end:                                          ; preds = %for.body<br class=""> %occlusion.017.lcssa = phi float [ %occlusion.017, %for.body ]<br class=""> %t5 = getelementptr inbounds %struct._Isect* %isect, i64 0, i32 0<br class=""> store float %occlusion.017.lcssa, float* %t5, align 4, !tbaa !1<br class=""> ret void<br class="">}<br class=""><br class="">Notice that the loop exit block is the loop header and the latch is<br class="">not guaranteed to be executed. The loop vectorizer assumes such<br class="">loops have been rotated.<br class=""><br class=""><br class="">If we send this IR through loop-rotate it will vectorize.<br class=""><br class="">The farther away we move the loop vectorizer from loop rotate the<br class="">likelier some optimization will destroy the rotated from. We might<br class="">just want to run loop rotate before the loop vectorizer ...<br class=""><br class=""></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">I think that makes sense -- and I don't recall loop rotation being expensive, plus is preserves just about everything (and I think does a reasonable job cleaning up after itself) ;)</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">I'd say we run some benchmarks, and barring any issues, we just do it.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""></div></blockquote><div class=""><br class=""></div><div class="">Well, that is a classic candidate for rotate. So assuming whatever GVN is doing is sane, then I’d say it makes sense to rerun rotation.</div><div class=""><br class=""></div><div class="">-Andy</div><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""><br class=""><blockquote type="cite" class="">On Oct 9, 2014, at 1:15 AM, Zinovy Nis <<a href="mailto:zinovy.nis@gmail.com" target="_blank" class="">zinovy.nis@gmail.com</a>><br class="">wrote:<br class=""><br class="">Hi.<br class=""><br class="">Did you have a chance to look at my reproducer?<br class=""><br class="">2014-10-07 21:34 GMT+04:00 Zinovy Nis <<a href="mailto:zinovy.nis@gmail.com" target="_blank" class="">zinovy.nis@gmail.com</a>>:<br class=""><blockquote type="cite" class="">Hi.<br class=""><br class="">I attached a reduced sample, based on<br class=""><a href="https://code.google.com/p/aobench/" target="_blank" class="">https://code.google.com/p/aobench/</a>.<br class=""><br class="">Run it first with an old SLP order:<br class=""><br class="">1) clang -c -Ofast -static -march=core-avx2 aobench.cpp -Rpass=.<br class="">-mllvm -debug-only=loop-vectorize -mllvm<br class="">-run-slp-after-loop-vectorization=0<br class=""><br class="">and then with a new order:<br class=""><br class="">2) clang -c -Ofast -static -march=core-avx2 aobench.cpp -Rpass=.<br class="">-debug-only=loop-vectorize -mllvm<br class="">-run-slp-after-loop-vectorization=1<br class=""><br class="">and see the logs:<br class=""><br class="">1) aobench.cpp:59:9: remark: vectorized loop (vectorization<br class="">factor: 8,<br class="">unrolling interleave factor: 1) [-Rpass=loop-vectorize]<br class="">2) aobench.cpp:59:9: remark: loop ***not*** vectorized: use<br class="">-Rpass-analysis=loop-vectorize for more info<br class="">[-Rpass-missed=loop-vectorize]<br class=""><br class="">LV: Found an unidentified PHI.  %occlusion.017 = phi float [<br class="">1.000000e+00, %entry ], [ %phitmp, %for.inc.for.body_crit_edge ]<br class="">LV: Can't vectorize the instructions or CFG<br class="">LV: Not vectorizing: Cannot prove legality.<br class=""><br class="">2014-10-06 17:46 GMT+04:00 Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>>:<br class=""><blockquote type="cite" class="">----- Original Message -----<br class=""><blockquote type="cite" class="">From: "Zinovy Nis" <<a href="mailto:zinovy.nis@gmail.com" target="_blank" class="">zinovy.nis@gmail.com</a>><br class="">To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>><br class="">Cc: "LLVM Commits" <<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a>>, "Tobias Grosser"<br class=""><<a href="mailto:tobias@grosser.es" target="_blank" class="">tobias@grosser.es</a>>, "Chandler Carruth"<br class=""><<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>>, "Nadav Rotem" <<a href="mailto:nrotem@apple.com" target="_blank" class="">nrotem@apple.com</a>>,<br class="">"Arnold Schwaighofer" <<a href="mailto:aschwaighofer@apple.com" target="_blank" class="">aschwaighofer@apple.com</a>><br class="">Sent: Monday, October 6, 2014 8:44:28 AM<br class="">Subject: Re: SLP/Loop vectorizer pass ordering<br class=""><br class="">A bit later. At least GVN creates critical edges which are not<br class="">handled<br class="">by loop vectorizer then.<br class=""></blockquote><br class="">Okay, please do (this is fairly important) -- if you can extract<br class="">some relevant IR, filing a bug report would be great. Are you<br class="">saying that running SLP early inhibits GVN from creating<br class="">critical edges that the loop vectorizer does not understand?<br class=""><br class="">Thanks again,<br class="">Hal<br class=""><br class=""><blockquote type="cite" class=""><br class="">2014-10-06 17:33 GMT+04:00 Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>>:<br class=""><blockquote type="cite" class="">----- Original Message -----<br class=""><blockquote type="cite" class="">From: "Zinovy Nis" <<a href="mailto:zinovy.nis@gmail.com" target="_blank" class="">zinovy.nis@gmail.com</a>><br class="">To: "Chandler Carruth" <<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>><br class="">Cc: "LLVM Commits" <<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a>>, "Tobias<br class="">Grosser"<br class=""><<a href="mailto:tobias@grosser.es" target="_blank" class="">tobias@grosser.es</a>><br class="">Sent: Monday, October 6, 2014 8:19:24 AM<br class="">Subject: Re: SLP/Loop vectorizer pass ordering<br class=""><br class="">Please wait a while, I'm using it to revert the new order as<br class="">it<br class="">introduces regression in our internal benchmark: SLP was<br class="">creating<br class="">loop<br class="">vectorization opportunities when was called before LV. Now no<br class="">such<br class="">opportunities are available, so we've got a regression.<br class=""></blockquote><br class="">Interesting. Can you provide any further details?<br class=""><br class="">-Hal<br class=""><br class=""><blockquote type="cite" class=""><br class="">2014-10-06 3:28 GMT+04:00 Chandler Carruth<br class=""><<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>>:<br class=""><blockquote type="cite" class=""><br class="">On Thu, Sep 4, 2014 at 6:32 AM, James Molloy<br class=""><<a href="mailto:james@jamesmolloy.co.uk" target="_blank" class="">james@jamesmolloy.co.uk</a>><br class="">wrote:<br class=""><blockquote type="cite" class=""><br class="">Hi Hal, Chandler,<br class=""><br class="">r217144.<br class=""></blockquote><br class=""><br class="">Is anyone still using the option to disable this? If I don't<br class="">hear<br class="">anything,<br class="">I'll remove this option entirely in the next week.<br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""><br class=""></blockquote>_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""><br class=""></blockquote><br class="">--<br class="">Hal Finkel<br class="">Assistant Computational Scientist<br class="">Leadership Computing Facility<br class="">Argonne National Laboratory<br class=""></blockquote><br class=""></blockquote><br class="">--<br class="">Hal Finkel<br class="">Assistant Computational Scientist<br class="">Leadership Computing Facility<br class="">Argonne National Laboratory<br class=""></blockquote></blockquote></blockquote><br class=""><br class=""></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">--<span class=""> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Hal Finkel</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Assistant Computational Scientist</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Leadership Computing Facility</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Argonne National Laboratory</span></div></blockquote></div><br class=""></div></blockquote></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></div></body></html>