<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 Jun 28, 2016, at 1:02 PM, Demikhovsky, Elena <<a href="mailto:elena.demikhovsky@intel.com" class="">elena.demikhovsky@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)" class="">
<style class=""><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037msolistparagraph, li.m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037msolistparagraph, div.m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037msolistparagraph
        {mso-style-name:m_-1653161751123399778m_6512816052916038133m_-4187661597716255897m_1692030243726901037msolistparagraph;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space
        {mso-style-name:m_-1653161751123399778m_6512816052916038133m_-4187661597716255897m_1692030243726901037apple-converted-space;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:799957587;
        mso-list-type:hybrid;
        mso-list-template-ids:-1214880770 44585902 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->

<div lang="EN-US" link="blue" vlink="purple" class="">
<div class="WordSection1"><p class="MsoNormal"><a name="_MailEndCompose" class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">Could you, please, run clang with –Rpass=loop-vectorize. You’ll be able to compare the logs between 2 versions.<o:p class=""></o:p></span></a></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">I enhanced detection of consecutive memory access inside the loop. It handles more IR combinations now.<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">But I can’t say what IR combination is handled incorrectly now.<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""><o:p class=""> </o:p></span></p><p class="MsoNormal" style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<!--[if !supportLists]--><span style="font-family:"Calibri",sans-serif;color:#2F5496" class=""><span style="mso-list:Ignore" class="">-<span style="font:7.0pt "Times New Roman"" class="">         
</span></span></span><!--[endif]--><span dir="LTR" class=""></span><b class=""><i class=""><span style="color:#2F5496" class=""> Elena<o:p class=""></o:p></span></i></b></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""><o:p class=""> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class="">
<div class="">
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm" class=""><p class="MsoNormal"><a name="_____replyseparator" class=""></a><b class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class=""> Eric Liu [<a href="mailto:ioeric@google.com" class="">mailto:ioeric@google.com</a>]
<br class="">
<b class="">Sent:</b> Tuesday, June 28, 2016 22:48<br class="">
<b class="">To:</b> Demikhovsky, Elena <<a href="mailto:elena.demikhovsky@intel.com" class="">elena.demikhovsky@intel.com</a>>; <a href="mailto:anemet@apple.com" class="">anemet@apple.com</a><br class="">
<b class="">Cc:</b> <a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<b class="">Subject:</b> Re: [llvm] r273864 - Fixed consecutive memory access detection in Loop Vectorizer.<o:p class=""></o:p></span></p>
</div>
</div><p class="MsoNormal"><o:p class=""> </o:p></p>
<div class=""><p class="MsoNormal">It would also be great if you can explain what types of code/loops can potentially be affected by the patch. Sorry that I had little knowledge about loop vectorization, but knowing code/loops that can potentially be affected would be quit
 useful for me to track the error. Thanks!<o:p class=""></o:p></p>
</div><p class="MsoNormal"><o:p class=""> </o:p></p>
<div class="">
<div class=""><p class="MsoNormal">On Tue, Jun 28, 2016 at 9:32 PM Eric Liu <<a href="mailto:ioeric@google.com" class="">ioeric@google.com</a>> wrote:<o:p class=""></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class="">
<div class=""><p class="MsoNormal">Hi Elena,<o:p class=""></o:p></p>
<div class=""><p class="MsoNormal"><o:p class=""> </o:p></p>
</div>
<div class=""><p class="MsoNormal">Thanks for explaining the changes. Unfortunately, it is not easy for me to extract a test case since the failing test case is from a compression library that is not owned by me, and the generation of test data is randomized...I'm still
 trying to track the cause, but could you also look into the uncertainty you have in the patch? Thanks a lot!<o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal"><o:p class=""> </o:p></p>
</div>
<div class=""><p class="MsoNormal">Cheers,<o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal">Eric<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal"><o:p class=""> </o:p></p>
<div class="">
<div class=""><p class="MsoNormal">On Tue, Jun 28, 2016 at 9:13 PM Demikhovsky, Elena <<a href="mailto:elena.demikhovsky@intel.com" target="_blank" class="">elena.demikhovsky@intel.com</a>> wrote:<o:p class=""></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class="">
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">This is the change between two commits:</span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">(1)</span><o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt">@@ -2658,7 +2584,9 @@ void InnerLoopVectorizer::vectorizeMemor<br class="">
   // Handle consecutive loads/stores.<br class="">
   GetElementPtrInst *Gep = getGEPInstruction(Ptr);<br class="">
   if (ConsecutiveStride) {<br class="">
-    if (Gep && Legal->isInductionVariable(Gep->getPointerOperand())) {<br class="">
+    if (Gep &&<br class="">
+        !PSE.getSE()->isLoopInvariant(PSE.getSCEV(Gep->getPointerOperand()),<br class="">
+                                      OrigLoop)) {<br class="">
       setDebugLocFromInst(Builder, Gep);<br class="">
       Value *PtrOperand = Gep->getPointerOperand();<br class="">
       Value *FirstBasePtr = getVectorValue(PtrOperand)[0];<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">And (2)</span><o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">     } else { // No GEP<br class="">
-      // Use the induction element ptr.<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-      assert(isa<SCEVAddRecExpr>(PSE.getSE()->getSCEV(Ptr)) &&<o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-             "Invalid induction ptr");<o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> </span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">(2) Is easy to explain –
</span>SCEVAddRecExpr<span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> is calculated in getPtrStride() and is not saved inside SE. I succeeded to reproduce it. (LNT build)</span></p></div></div></blockquote></div></div></div></blockquote></div></div></div></div></div></blockquote><div><br class=""></div>You want PSE.getSCEV() here that will return the SCEV with all the predicates applied.</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div lang="EN-US" link="blue" vlink="purple" class=""><div class="WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class=""><div class=""><blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class=""><div class=""><div class=""><div class=""><blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class=""><div class=""><div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">(1) Failed on a self-build (clang builds  clang with sanitizer). I was unable to reproduce the failure
 on my system. </span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">Do you think that
</span><o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> </span>  if (Gep && Legal->isInductionVariable(Gep->getPointerOperand()))<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Calibri",sans-serif;color:#1F4E79" class="">and</span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> 
</span>if (Gep && !PSE.getSE()->isLoopInvariant(PSE.getSCEV(Gep->getPointerOperand()),<br class="">
                                      OrigLoop)<o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Calibri",sans-serif;color:#1F4E79" class="">should be handled differently ?</span></p></div></div></blockquote></div></div></div></blockquote></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I am not sure I understand this change and why it’s needed.  We might better off reverting the commit for now and opening a new review with the updated diff.</div><div class=""><br class=""></div><div class="">Adam</div><br class=""><blockquote type="cite" class=""><div class=""><div lang="EN-US" link="blue" vlink="purple" class=""><div class="WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class=""><div class=""><blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class=""><div class=""><div class=""><div class=""><blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class=""><div class=""><div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Calibri",sans-serif;color:#1F4E79" class=""> </span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Calibri",sans-serif;color:#1F4E79" class="">If Eric will send me the test case, I will find the problem.</span><o:p class=""></o:p></p>
<div class=""><p class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037msolistparagraph">
<b class=""><i class=""><span style="color:#2F5496" class=""> </span></i></b><o:p class=""></o:p></p><p class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037msolistparagraph">
<span style="font-family:"Calibri",sans-serif;color:#2F5496" class="">-</span><span style="font-size:7.0pt;color:#2F5496" class="">         
</span><b class=""><i class=""><span style="color:#2F5496" class=""> </span></i></b><o:p class=""></o:p></p><p class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037msolistparagraph">
<span style="font-family:"Calibri",sans-serif;color:#2F5496" class="">-</span><span style="font-size:7.0pt;color:#2F5496" class="">         
</span><b class=""><i class=""><span style="color:#2F5496" class=""> Elena</span></i></b><o:p class=""></o:p></p>
</div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> </span><o:p class=""></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class="">
<div class="">
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm" class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a name="m_-1653161751123399778_m_651281605291603" class=""></a><b class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">
<a href="mailto:anemet@apple.com" target="_blank" class="">anemet@apple.com</a> [mailto:<a href="mailto:anemet@apple.com" target="_blank" class="">anemet@apple.com</a>]
<br class="">
<b class="">Sent:</b> Tuesday, June 28, 2016 20:46<br class="">
<b class="">To:</b> Demikhovsky, Elena <<a href="mailto:elena.demikhovsky@intel.com" target="_blank" class="">elena.demikhovsky@intel.com</a>><br class="">
<b class="">Cc:</b> Eric Liu <<a href="mailto:ioeric@google.com" target="_blank" class="">ioeric@google.com</a>>;
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a></span><o:p class=""></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class="">
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class="">
<div class="">
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm" class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class=""><br class="">
<b class="">Subject:</b> Re: [llvm] r273864 - Fixed consecutive memory access detection in Loop Vectorizer.</span><o:p class=""></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class="">
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
<div class="">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Jun 28, 2016, at 10:35 AM, Demikhovsky, Elena via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>> wrote:<o:p class=""></o:p></p>
</div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">It would be great if you can provide a test, even big.</span><o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">If I’ll not find a solution in 2-3 days, I’ll revert the patch.</span><o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> </span><o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">The problem is not in the small diff between two commits, it is, probably, in usage of getPtrStride()
 that allows to vectorize more loops.</span><o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class="">Thank you.</span><o:p class=""></o:p></p>
</div>
</div>
</blockquote>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It is still a good idea to explain what has changed for the recommit in the commit log .<o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Adam<o:p class=""></o:p></p>
</div><p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><o:p class=""> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" class="">
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> </span><o:p class=""></o:p></p>
</div>
<div style="margin-left:36.0pt" class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Calibri",sans-serif;color:#2F5496" class="">-</span><span style="font-size:7.0pt;color:#2F5496" class="">         <span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span></span><b class=""><i class=""><span style="color:#2F5496" class=""> Elena</span></i></b><o:p class=""></o:p></p>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D" class=""> </span><o:p class=""></o:p></p>
</div>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class="">
<div class="">
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm" class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">From:</span></b><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class=""> </span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">Eric
 Liu [</span><a href="mailto:ioeric@google.com" target="_blank" class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:purple" class="">mailto:ioeric@google.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">]<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><br class="">
<b class="">Sent:</b><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>Tuesday, June 28, 2016 17:36<br class="">
<b class="">To:</b><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>Demikhovsky, Elena <</span><a href="mailto:elena.demikhovsky@intel.com" target="_blank" class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:purple" class="">elena.demikhovsky@intel.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">>;<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span></span><a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:purple" class="">llvm-commits@lists.llvm.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class=""><br class="">
<b class="">Cc:</b><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>Nirav Davé <</span><a href="mailto:niravd@google.com" target="_blank" class=""><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:purple" class="">niravd@google.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="">><br class="">
<b class="">Subject:</b><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>Re: [llvm] r273864 - Fixed consecutive memory access detection in Loop Vectorizer.</span><o:p class=""></o:p></p>
</div>
</div>
</div>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Elena,<o:p class=""></o:p></p>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I see this is a re-commit of a previous patch but wondering if new changes you introduced in this re-commit have been reviewed or not? <o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">One of our internal test cases fails when built with llvm that is sync to this revision (the test passes with both r273863 llvm and gcc). I am trying to find a minimal test case
 that can reproduce the bug, but please could you take a second look at the changes? Thanks a lot!<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers,<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Eric<o:p class=""></o:p></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
<div class="">
<div class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Mon, Jun 27, 2016 at 1:26 PM Elena Demikhovsky via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span style="color:purple" class="">llvm-commits@lists.llvm.org</span></a>>
 wrote:<o:p class=""></o:p></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt" class="">
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Author: delena<br class="">
Date: Mon Jun 27 06:19:23 2016<br class="">
New Revision: 273864<br class="">
<br class="">
URL:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=273864&view=rev" target="_blank" class=""><span style="color:purple" class="">http://llvm.org/viewvc/llvm-project?rev=273864&view=rev</span></a><br class="">
Log:<br class="">
Fixed consecutive memory access detection in Loop Vectorizer.<br class="">
It did not handle correctly cases without GEP.<br class="">
<br class="">
The following loop wasn't vectorized:<br class="">
<br class="">
for (int i=0; i<len; i++)<br class="">
<br class="">
  *to++ = *from++;<br class="">
<br class="">
I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1.<br class="">
<br class="">
Re-commit rL273257 - revision:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://reviews.llvm.org/D20789" target="_blank" class=""><span style="color:purple" class="">http://reviews.llvm.org/D20789</span></a><br class="">
<br class="">
<br class="">
Added:<br class="">
    llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep.ll<br class="">
      - copied unchanged from r273257, llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep.ll<br class="">
    llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep2.ll<br class="">
Modified:<br class="">
    llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h<br class="">
    llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp<br class="">
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp<br class="">
    llvm/trunk/test/Transforms/LoopVectorize/ptr-induction.ll<br class="">
<br class="">
Modified: llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h<br class="">
URL:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h?rev=273864&r1=273863&r2=273864&view=diff" target="_blank" class=""><span style="color:purple" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h?rev=273864&r1=273863&r2=273864&view=diff</span></a><br class="">
==============================================================================<br class="">
--- llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h (original)<br class="">
+++ llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h Mon Jun 27 06:19:23 2016<br class="">
@@ -679,9 +679,11 @@ const SCEV *replaceSymbolicStrideSCEV(Pr<br class="">
 /// to \p PtrToStride and therefore add further predicates to \p PSE.<br class="">
 /// The \p Assume parameter indicates if we are allowed to make additional<br class="">
 /// run-time assumptions.<br class="">
+/// The \p ShouldCheckWrap indicates that we should ensure that address<br class="">
+/// calculation does not wrap.<br class="">
 int getPtrStride(PredicatedScalarEvolution &PSE, Value *Ptr, const Loop *Lp,<br class="">
                  const ValueToValueMap &StridesMap = ValueToValueMap(),<br class="">
-                 bool Assume = false);<br class="">
+                 bool Assume = false, bool ShouldCheckWrap = true);<br class="">
<br class="">
 /// \brief Returns true if the memory operations \p A and \p B are consecutive.<br class="">
 /// This is a simple API that does not depend on the analysis pass.<br class="">
<br class="">
Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp<br class="">
URL:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=273864&r1=273863&r2=273864&view=diff" target="_blank" class=""><span style="color:purple" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=273864&r1=273863&r2=273864&view=diff</span></a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)<br class="">
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Mon Jun 27 06:19:23 2016<br class="">
@@ -866,7 +866,7 @@ static bool isNoWrapAddRec(Value *Ptr, c<br class="">
 /// \brief Check whether the access through \p Ptr has a constant stride.<br class="">
 int llvm::getPtrStride(PredicatedScalarEvolution &PSE, Value *Ptr,<br class="">
                        const Loop *Lp, const ValueToValueMap &StridesMap,<br class="">
-                       bool Assume) {<br class="">
+                       bool Assume, bool ShouldCheckWrap) {<br class="">
   Type *Ty = Ptr->getType();<br class="">
   assert(Ty->isPointerTy() && "Unexpected non-ptr");<br class="">
<br class="">
@@ -905,9 +905,9 @@ int llvm::getPtrStride(PredicatedScalarE<br class="">
   // to access the pointer value "0" which is undefined behavior in address<br class="">
   // space 0, therefore we can also vectorize this case.<br class="">
   bool IsInBoundsGEP = isInBoundsGep(Ptr);<br class="">
-  bool IsNoWrapAddRec =<br class="">
-      PSE.hasNoOverflow(Ptr, SCEVWrapPredicate::IncrementNUSW) ||<br class="">
-      isNoWrapAddRec(Ptr, AR, PSE, Lp);<br class="">
+  bool IsNoWrapAddRec = !ShouldCheckWrap ||<br class="">
+    PSE.hasNoOverflow(Ptr, SCEVWrapPredicate::IncrementNUSW) ||<br class="">
+    isNoWrapAddRec(Ptr, AR, PSE, Lp);<br class="">
   bool IsInAddressSpaceZero = PtrTy->getAddressSpace() == 0;<br class="">
   if (!IsNoWrapAddRec && !IsInBoundsGEP && !IsInAddressSpaceZero) {<br class="">
     if (Assume) {<br class="">
<br class="">
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp<br class="">
URL:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=273864&r1=273863&r2=273864&view=diff" target="_blank" class=""><span style="color:purple" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=273864&r1=273863&r2=273864&view=diff</span></a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)<br class="">
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Mon Jun 27 06:19:23 2016<br class="">
@@ -2242,87 +2242,13 @@ Value *InnerLoopVectorizer::getStepVecto<br class="">
 }<br class="">
<br class="">
 int LoopVectorizationLegality::isConsecutivePtr(Value *Ptr) {<br class="">
-  assert(Ptr->getType()->isPointerTy() && "Unexpected non-ptr");<br class="">
-  auto *SE = PSE.getSE();<br class="">
-  // Make sure that the pointer does not point to structs.<br class="">
-  if (Ptr->getType()->getPointerElementType()->isAggregateType())<br class="">
-    return 0;<br class="">
-<br class="">
-  // If this value is a pointer induction variable, we know it is consecutive.<br class="">
-  PHINode *Phi = dyn_cast_or_null<PHINode>(Ptr);<br class="">
-  if (Phi && Inductions.count(Phi)) {<br class="">
-    InductionDescriptor II = Inductions[Phi];<br class="">
-    return II.getConsecutiveDirection();<br class="">
-  }<br class="">
-<br class="">
-  GetElementPtrInst *Gep = getGEPInstruction(Ptr);<br class="">
-  if (!Gep)<br class="">
-    return 0;<br class="">
-<br class="">
-  unsigned NumOperands = Gep->getNumOperands();<br class="">
-  Value *GpPtr = Gep->getPointerOperand();<br class="">
-  // If this GEP value is a consecutive pointer induction variable and all of<br class="">
-  // the indices are constant, then we know it is consecutive.<br class="">
-  Phi = dyn_cast<PHINode>(GpPtr);<br class="">
-  if (Phi && Inductions.count(Phi)) {<br class="">
-<br class="">
-    // Make sure that the pointer does not point to structs.<br class="">
-    PointerType *GepPtrType = cast<PointerType>(GpPtr->getType());<br class="">
-    if (GepPtrType->getElementType()->isAggregateType())<br class="">
-      return 0;<br class="">
-<br class="">
-    // Make sure that all of the index operands are loop invariant.<br class="">
-    for (unsigned i = 1; i < NumOperands; ++i)<br class="">
-      if (!SE->isLoopInvariant(PSE.getSCEV(Gep->getOperand(i)), TheLoop))<br class="">
-        return 0;<br class="">
-<br class="">
-    InductionDescriptor II = Inductions[Phi];<br class="">
-    return II.getConsecutiveDirection();<br class="">
-  }<br class="">
<br class="">
-  unsigned InductionOperand = getGEPInductionOperand(Gep);<br class="">
-<br class="">
-  // Check that all of the gep indices are uniform except for our induction<br class="">
-  // operand.<br class="">
-  for (unsigned i = 0; i != NumOperands; ++i)<br class="">
-    if (i != InductionOperand &&<br class="">
-        !SE->isLoopInvariant(PSE.getSCEV(Gep->getOperand(i)), TheLoop))<br class="">
-      return 0;<br class="">
-<br class="">
-  // We can emit wide load/stores only if the last non-zero index is the<br class="">
-  // induction variable.<br class="">
-  const SCEV *Last = nullptr;<br class="">
-  if (!getSymbolicStrides() || !getSymbolicStrides()->count(Gep))<br class="">
-    Last = PSE.getSCEV(Gep->getOperand(InductionOperand));<br class="">
-  else {<br class="">
-    // Because of the multiplication by a stride we can have a s/zext cast.<br class="">
-    // We are going to replace this stride by 1 so the cast is safe to ignore.<br class="">
-    //<br class="">
-    //  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]<br class="">
-    //  %0 = trunc i64 %indvars.iv to i32<br class="">
-    //  %mul = mul i32 %0, %Stride1<br class="">
-    //  %idxprom = zext i32 %mul to i64  << Safe cast.<br class="">
-    //  %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom<br class="">
-    //<br class="">
-    Last = replaceSymbolicStrideSCEV(PSE, *getSymbolicStrides(),<br class="">
-                                     Gep->getOperand(InductionOperand), Gep);<br class="">
-    if (const SCEVCastExpr *C = dyn_cast<SCEVCastExpr>(Last))<br class="">
-      Last =<br class="">
-          (C->getSCEVType() == scSignExtend || C->getSCEVType() == scZeroExtend)<br class="">
-              ? C->getOperand()<br class="">
-              : Last;<br class="">
-  }<br class="">
-  if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(Last)) {<br class="">
-    const SCEV *Step = AR->getStepRecurrence(*SE);<br class="">
-<br class="">
-    // The memory is consecutive because the last index is consecutive<br class="">
-    // and all other indices are loop invariant.<br class="">
-    if (Step->isOne())<br class="">
-      return 1;<br class="">
-    if (Step->isAllOnesValue())<br class="">
-      return -1;<br class="">
-  }<br class="">
+  const ValueToValueMap &Strides = getSymbolicStrides() ? *getSymbolicStrides() :<br class="">
+    ValueToValueMap();<br class="">
<br class="">
+  int Stride = getPtrStride(PSE, Ptr, TheLoop, Strides, true, false);<br class="">
+  if (Stride == 1 || Stride == -1)<br class="">
+    return Stride;<br class="">
   return 0;<br class="">
 }<br class="">
<br class="">
@@ -2658,7 +2584,9 @@ void InnerLoopVectorizer::vectorizeMemor<br class="">
   // Handle consecutive loads/stores.<br class="">
   GetElementPtrInst *Gep = getGEPInstruction(Ptr);<br class="">
   if (ConsecutiveStride) {<br class="">
-    if (Gep && Legal->isInductionVariable(Gep->getPointerOperand())) {<br class="">
+    if (Gep &&<br class="">
+        !PSE.getSE()->isLoopInvariant(PSE.getSCEV(Gep->getPointerOperand()),<br class="">
+                                      OrigLoop)) {<br class="">
       setDebugLocFromInst(Builder, Gep);<br class="">
       Value *PtrOperand = Gep->getPointerOperand();<br class="">
       Value *FirstBasePtr = getVectorValue(PtrOperand)[0];<br class="">
@@ -2671,9 +2599,6 @@ void InnerLoopVectorizer::vectorizeMemor<br class="">
       Ptr = Builder.Insert(Gep2);<br class="">
     } else if (Gep) {<br class="">
       setDebugLocFromInst(Builder, Gep);<br class="">
-      assert(PSE.getSE()->isLoopInvariant(PSE.getSCEV(Gep->getPointerOperand()),<br class="">
-                                          OrigLoop) &&<br class="">
-             "Base ptr must be invariant");<br class="">
       // The last index does not have to be the induction. It can be<br class="">
       // consecutive and be a function of the index. For example A[I+1];<br class="">
       unsigned NumOperands = Gep->getNumOperands();<br class="">
@@ -2702,8 +2627,6 @@ void InnerLoopVectorizer::vectorizeMemor<br class="">
       }<br class="">
       Ptr = Builder.Insert(Gep2);<br class="">
     } else { // No GEP<br class="">
-      // Use the induction element ptr.<br class="">
-      assert(isa<PHINode>(Ptr) && "Invalid induction ptr");<br class="">
       setDebugLocFromInst(Builder, Ptr);<br class="">
       VectorParts &PtrVal = getVectorValue(Ptr);<br class="">
       Ptr = Builder.CreateExtractElement(PtrVal[0], Zero);<br class="">
<br class="">
Added: llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep2.ll<br class="">
URL:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep2.ll?rev=273864&view=auto" target="_blank" class=""><span style="color:purple" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep2.ll?rev=273864&view=auto</span></a><br class="">
==============================================================================<br class="">
--- llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep2.ll (added)<br class="">
+++ llvm/trunk/test/Transforms/LoopVectorize/consec_no_gep2.ll Mon Jun 27 06:19:23 2016<br class="">
@@ -0,0 +1,34 @@<br class="">
+; RUN: opt < %s -loop-vectorize -S | FileCheck %s<br class="">
+target datalayout = "E-m:e-i64:64-n32:64"<br class="">
+target triple = "powerpc64-unknown-linux-gnu"<br class="">
+<br class="">
+; CHECK-LABEL: @img2buf<br class="">
+; CHECK: store <4 x i32><br class="">
+; Function Attrs: nounwind<br class="">
+define void @img2buf(i64 %val, i8* nocapture %buf, i32 %N) local_unnamed_addr #0 {<br class="">
+entry:<br class="">
+  br label %l2<br class="">
+<br class="">
+l2:<br class="">
+  br label %<a href="http://for.body57.us/" target="_blank" class=""><span style="color:purple" class="">for.body57.us</span></a><br class="">
+<br class="">
+<a href="http://for.body57.us/" target="_blank" class=""><span style="color:purple" class="">for.body57.us</span></a>:<br class="">
+  %indvars.iv24 = phi i64 [ %val, %l2 ], [ %indvars.iv.next25, %<a href="http://for.body57.us/" target="_blank" class=""><span style="color:purple" class="">for.body57.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>]<br class="">
+  %0 = trunc i64 %indvars.iv24 to i32<br class="">
+  %<a href="http://add77.us/" target="_blank" class=""><span style="color:purple" class="">add77.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>= add i32 5, %0<br class="">
+  %<a href="http://mul78.us/" target="_blank" class=""><span style="color:purple" class="">mul78.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>= shl nsw i32 %<a href="http://add77.us/" target="_blank" class=""><span style="color:purple" class="">add77.us</span></a>,
 2<br class="">
+  %<a href="http://idx.ext79.us/" target="_blank" class=""><span style="color:purple" class="">idx.ext79.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>= sext i32 %<a href="http://mul78.us/" target="_blank" class=""><span style="color:purple" class="">mul78.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>to
 i64<br class="">
+  %<a href="http://add.ptr80.us/" target="_blank" class=""><span style="color:purple" class="">add.ptr80.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>= getelementptr inbounds i8, i8*
 %buf, i64 %<a href="http://idx.ext79.us/" target="_blank" class=""><span style="color:purple" class="">idx.ext79.us</span></a><br class="">
+  %<a href="http://ui32.0.add.ptr80.sroa_cast.us/" target="_blank" class=""><span style="color:purple" class="">ui32.0.add.ptr80.sroa_cast.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>=
 bitcast i8* %<a href="http://add.ptr80.us/" target="_blank" class=""><span style="color:purple" class="">add.ptr80.us</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>to i32*<br class="">
+  store i32 0, i32* %<a href="http://ui32.0.add.ptr80.sroa_cast.us/" target="_blank" class=""><span style="color:purple" class="">ui32.0.add.ptr80.sroa_cast.us</span></a>, align 1<br class="">
+  %indvars.iv.next25 = add nsw i64 %indvars.iv24, 1<br class="">
+  %lftr.wideiv26 = trunc i64 %indvars.iv.next25 to i32<br class="">
+  %exitcond27 = icmp eq i32 %lftr.wideiv26, %N<br class="">
+  br i1 %exitcond27, label %l3, label %<a href="http://for.body57.us/" target="_blank" class=""><span style="color:purple" class="">for.body57.us</span></a><br class="">
+<br class="">
+l3:<br class="">
+  ret void<br class="">
+}<br class="">
+<br class="">
+attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64" "target-features"="+altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-qpx,-vsx"
 "unsafe-fp-math"="false" "use-soft-float"="false" }<br class="">
+<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/LoopVectorize/ptr-induction.ll<br class="">
URL:<span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/ptr-induction.ll?rev=273864&r1=273863&r2=273864&view=diff" target="_blank" class=""><span style="color:purple" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/ptr-induction.ll?rev=273864&r1=273863&r2=273864&view=diff</span></a><br class="">
==============================================================================<br class="">
--- llvm/trunk/test/Transforms/LoopVectorize/ptr-induction.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/LoopVectorize/ptr-induction.ll Mon Jun 27 06:19:23 2016<br class="">
@@ -18,6 +18,7 @@ while.body.preheader:<br class="">
 while.body:                                       ; preds = %while.body.preheader, %while.body<br class="">
   %<a href="http://a.pn/" target="_blank" class=""><span style="color:purple" class="">a.pn</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>= phi i32* [ %incdec.ptr8, %while.body ], [ %a,
 %while.body.preheader ]<br class="">
   %acc.07 = phi i32 [ %add, %while.body ], [ 0, %while.body.preheader ]<br class="">
+  %<a href="http://a1.pn/" target="_blank" class=""><span style="color:purple" class="">a1.pn</span></a><span class="m-1653161751123399778m6512816052916038133m-4187661597716255897m1692030243726901037apple-converted-space"> </span>= getelementptr inbounds i32, i32* %<a href="http://a.pn/" target="_blank" class=""><span style="color:purple" class="">a.pn</span></a>,
 i64 0<br class="">
   %incdec.ptr8 = getelementptr inbounds i32, i32* %<a href="http://a.pn/" target="_blank" class=""><span style="color:purple" class="">a.pn</span></a>, i64 1<br class="">
   %0 = load i32, i32* %incdec.ptr8, align 1<br class="">
   %add = add nuw nsw i32 %0, %acc.07<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span style="color:purple" class="">llvm-commits@lists.llvm.org</span></a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class=""><span style="color:purple" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</span></a><o:p class=""></o:p></p>
</div>
</blockquote>
<div class=""><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
</div>
</div>
</div>
</div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:start;word-spacing:0px">
<span style="font-size:9.0pt;font-family:"Helvetica",sans-serif" class="">---------------------------------------------------------------------<br class="">
Intel Israel (74) Limited</span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:start;word-spacing:0px">
<span style="font-size:9.0pt;font-family:"Helvetica",sans-serif" class="">This e-mail and any attachments may contain confidential material for<br class="">
the sole use of the intended recipient(s). Any review or distribution<br class="">
by others is strictly prohibited. If you are not the intended<br class="">
recipient, please contact the sender and delete all copies.</span><o:p class=""></o:p></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif" class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
</span><a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:purple" class="">llvm-commits@lists.llvm.org</span></a><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif" class=""><br class="">
</span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class=""><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:purple" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</span></a><o:p class=""></o:p></p>
</div>
</blockquote>
</div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p class=""></o:p></p>
</div>
</div>
</div>
<div class=""><p class="">---------------------------------------------------------------------<br class="">
Intel Israel (74) Limited<o:p class=""></o:p></p><p class="">This e-mail and any attachments may contain confidential material for<br class="">
the sole use of the intended recipient(s). Any review or distribution<br class="">
by others is strictly prohibited. If you are not the intended<br class="">
recipient, please contact the sender and delete all copies.<o:p class=""></o:p></p><p class="MsoNormal"><o:p class=""> </o:p></p>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div><p class="">---------------------------------------------------------------------<br class="">
Intel Israel (74) Limited</p><p class="">This e-mail and any attachments may contain confidential material for<br class="">
the sole use of the intended recipient(s). Any review or distribution<br class="">
by others is strictly prohibited. If you are not the intended<br class="">
recipient, please contact the sender and delete all copies.</p></div>

</div></blockquote></div><br class=""></body></html>