<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place" /><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">Hi,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">I would like some help regarding the LSR pass. It seems that it likes to duplicate address calculations as in the case above, which is highly undesirable
 on my target. <o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">I wonder if there is any way to tell LSR to not duplicate the code in cases like this? Or could I perhaps run CSE after LSR again?
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">What is the logic behind this transformation? It seems that a LSR pass should not insert a multiplication, generally..?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">Thanks,
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">Jonas<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"> 
</span></font><font size="2" face="Courier"><span lang="SV" style="font-size:10.0pt;font-family:Courier">%_tmp44 = ptrtoint i16* par1 to i16<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %_tmp51 = ptrtoint i16* par2 to i16<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">...<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">inside loop:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">*** IR Dump After Canonicalize natural loops ***<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">bb7: (header)                                     ; preds = %bb7.lr.ph, %bb11<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp39 = sub i16 %_tmp35, %_tmp38<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %2      = mul i16 %_tmp39, -10<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp41 = add i16 %2, %subframeCount.12.014<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp45 = add i16 %_tmp41, %_tmp44<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp46 = inttoptr i16 %_tmp45 to i16*<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp47 = load i16* %_tmp46, align 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">bb8:                                              ; preds = %bb7<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp52 = add i16 %_tmp41, %_tmp51<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp53 = inttoptr i16 %_tmp52 to i16*<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %_tmp54 = load i16* %_tmp53, align 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">...<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  br i1 %_tmp64, label %bb7, label %bb13.loopexit<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">(latch)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">*** IR Dump After
<st1:place w:st="on">Loop</st1:place> Strength Reduction ***<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">bb7:                                              ; preds = %bb7.lr.ph, %bb11<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %_tmp39 = sub i16 %_tmp35, %_tmp38<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %2 = mul i16 %_tmp39, -10<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %3 = add i16 %_tmp44, %subframeCount.12.014<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %4 = add i16 %3, %2<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %_tmp46 = inttoptr i16 %4 to i16*<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %_tmp47 = load i16* %_tmp46, align 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">bb8:                                              ; preds = %bb7<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier">  %5 = sub i16 %_tmp35, %_tmp38<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span style="font-size:10.0pt;
font-family:Courier"> 
</span></font><font size="2" face="Courier"><span lang="SV" style="font-size:10.0pt;font-family:Courier">%6 = mul i16 %5, -10<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %7 = add i16 %_tmp51, %subframeCount.12.014<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %8 = add i16 %7, %6<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %_tmp53 = inttoptr i16 %8 to i16*<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  %_tmp54 = load i16* %_tmp53, align 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">...<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Courier"><span lang="SV" style="font-size:
10.0pt;font-family:Courier">  br i1 %_tmp64, label %bb7, label %bb13.loopexit<o:p></o:p></span></font></p>
</div>
</body>
</html>