<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 20, 2015, at 4:29 PM, Michael Zolotukhin via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Hi Philip,</span><br 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;" class=""><br 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;" class=""><span 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; float: none; display: inline !important;" class="">On Aug 20, 2015, at 4:22 PM, Philip Reames <</span><a href="mailto:listmail@philipreames.com" 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;" class="">listmail@philipreames.com</a><span 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; float: none; display: inline !important;" class="">> wrote:</span><br 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;" 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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">Michael,<br class=""><br class="">Can you add a test case that shows two adjacent loads one with !nontemporal, one without?  I want to make sure we get that correct (i.e. not marking the result non-temporary if vectorized).  Doing this as a test case would make it obvious to future readers as well.<br class=""><br class="">(Same for the SLP patch btw.)<br class=""></blockquote><span 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; float: none; display: inline !important;" class="">It’s not applicable to loop-vectorizer, because there we have a single original load, and then just replicate it N times (we don’t emit IR for this, but that’s the idea). Thus, all loads that we’re going to combine have the same ‘!nontemporal’ attribute. But that makes sense for the SLP-vectorization, I’ll add corresponding test case shortly.</span><br 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;" class=""></div></blockquote>Hi Philip,</div><div><br class=""></div><div>I committed the test in r245644 - does it look good to you?</div><div><br class=""></div><div>Michael</div><div><br class=""><blockquote type="cite" class=""><div class=""><br 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;" class=""><span 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; float: none; display: inline !important;" class="">Thanks,</span><br 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;" class=""><span 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; float: none; display: inline !important;" class="">Michael</span><br 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;" class=""><br 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;" 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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">Philip<br class=""><br class="">On 08/20/2015 03:27 PM, Michael Zolotukhin via llvm-commits wrote:<br class=""><blockquote type="cite" class="">Author: mzolotukhin<br class="">Date: Thu Aug 20 17:27:38 2015<br class="">New Revision: 245632<br class=""><br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D245632-26view-3Drev&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=a__wFv_hZ8xcOmDnbHb2PqziHvdq184-iwQM3ThtJLE&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D245632-26view-3Drev&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=a__wFv_hZ8xcOmDnbHb2PqziHvdq184-iwQM3ThtJLE&e=</a> Log:<br class="">[LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.<br class=""><br class="">Added:<br class="">   llvm/trunk/test/Transforms/LoopVectorize/nontemporal.ll<br class="">Modified:<br class="">   llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp<br class=""><br class="">Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Transforms_Vectorize_LoopVectorize.cpp-3Frev-3D245632-26r1-3D245631-26r2-3D245632-26view-3Ddiff&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=0vhvZxOz3ui9DNSgD8uCCSfzjGZVKszXLDxorzX48Qo&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Transforms_Vectorize_LoopVectorize.cpp-3Frev-3D245632-26r1-3D245631-26r2-3D245632-26view-3Ddiff&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=0vhvZxOz3ui9DNSgD8uCCSfzjGZVKszXLDxorzX48Qo&e=</a> ==============================================================================<br class="">--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Thu Aug 20 17:27:38 2015<br class="">@@ -552,7 +552,8 @@ static void propagateMetadata(Instructio<br class="">    if (Kind != LLVMContext::MD_tbaa &&<br class="">        Kind != LLVMContext::MD_alias_scope &&<br class="">        Kind != LLVMContext::MD_noalias &&<br class="">-        Kind != LLVMContext::MD_fpmath)<br class="">+        Kind != LLVMContext::MD_fpmath &&<br class="">+        Kind != LLVMContext::MD_nontemporal)<br class="">      continue;<br class="">      To->setMetadata(Kind, M.second);<br class=""><br class="">Added: llvm/trunk/test/Transforms/LoopVectorize/nontemporal.ll<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_Transforms_LoopVectorize_nontemporal.ll-3Frev-3D245632-26view-3Dauto&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=YxoAnzwN86Ff4IuXHfmj7vHpPLnP8Ht0scSjKTibdbg&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_Transforms_LoopVectorize_nontemporal.ll-3Frev-3D245632-26view-3Dauto&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=YxoAnzwN86Ff4IuXHfmj7vHpPLnP8Ht0scSjKTibdbg&e=</a> ==============================================================================<br class="">--- llvm/trunk/test/Transforms/LoopVectorize/nontemporal.ll (added)<br class="">+++ llvm/trunk/test/Transforms/LoopVectorize/nontemporal.ll Thu Aug 20 17:27:38 2015<br class="">@@ -0,0 +1,47 @@<br class="">+; RUN: opt < %s  -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -instcombine -S | FileCheck %s<br class="">+<br class="">+target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"<br class="">+target triple = "arm64-apple-ios5.0.0"<br class="">+<br class="">+; CHECK-LABEL: @foo(<br class="">+define void @foo(float* noalias %a, float* noalias %b, float* noalias %c, i32 %N) {<br class="">+entry:<br class="">+  %cmp.4 = icmp sgt i32 %N, 0<br class="">+  br i1 %cmp.4, label %for.body.preheader, label %for.end<br class="">+<br class="">+for.body.preheader:                               ; preds = %entry<br class="">+  br label %for.body<br class="">+<br class="">+for.body:                                         ; preds = %for.body.preheader, %for.body<br class="">+  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]<br class="">+<br class="">+; Check that we don't lose !nontemporal hint when vectorizing loads.<br class="">+; CHECK: %wide.load{{[0-9]*}} = load <4 x float>, <4 x float>* %{{[0-9]+}}, align 4, !nontemporal !0<br class="">+  %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv<br class="">+  %0 = load float, float* %arrayidx, align 4, !nontemporal !0<br class="">+<br class="">+; Check that we don't introduce !nontemporal hint when the original scalar loads didn't have it.<br class="">+; CHECK: %wide.load{{[0-9]+}} = load <4 x float>, <4 x float>* %{{[0-9]+}}, align 4{{$}}<br class="">+  %arrayidx2 = getelementptr inbounds float, float* %c, i64 %indvars.iv<br class="">+  %1 = load float, float* %arrayidx2, align 4<br class="">+  %add = fadd float %0, %1<br class="">+<br class="">+; Check that we don't lose !nontemporal hint when vectorizing stores.<br class="">+; CHECK: store <4 x float> %{{[0-9]+}}, <4 x float>* %{{[0-9]+}}, align 4, !nontemporal !0<br class="">+  %arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvars.iv<br class="">+  store float %add, float* %arrayidx4, align 4, !nontemporal !0<br class="">+<br class="">+  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br class="">+  %lftr.wideiv = trunc i64 %indvars.iv.next to i32<br class="">+  %exitcond = icmp eq i32 %lftr.wideiv, %N<br class="">+  br i1 %exitcond, label %for.end.loopexit, label %for.body<br class="">+<br class="">+for.end.loopexit:                                 ; preds = %for.body<br class="">+  br label %for.end<br class="">+<br class="">+for.end:                                          ; preds = %for.end.loopexit, %entry<br class="">+; CHECK: ret void<br class="">+  ret void<br class="">+}<br class="">+<br class="">+!0 = !{i32 1}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQICaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=ziQkFxLF161LcWw4qZBl9GRB3K3jsTax2u_B8gbGZO4&s=Z0hqA-nDtL8T92bt6aae0esKfzBixkV1CZ3QVwSGaX8&e=<span class="Apple-converted-space"> </span><br class=""></blockquote><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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br 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;" class=""><span 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; float: none; display: inline !important;" class="">llvm-commits mailing list</span><br 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;" class=""><a href="mailto:llvm-commits@lists.llvm.org" 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;" class="">llvm-commits@lists.llvm.org</a><br 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;" class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=3hV9aedjPPOxYLPKX67QgtYPSx7NC8BdaEQ1nRmm2v8&s=Ef50sJs2n0WAwDmuhKDMyykUTrHr586pub-SMq-Is-A&e=" 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;" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=3hV9aedjPPOxYLPKX67QgtYPSx7NC8BdaEQ1nRmm2v8&s=Ef50sJs2n0WAwDmuhKDMyykUTrHr586pub-SMq-Is-A&e=</a><span 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; float: none; display: inline !important;" class=""></span></div></blockquote></div><br class=""></body></html>