<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I guess it tends not to block cross block optimization opportunity, or it just happen</div><div class="gmail_default"><a class="gmail-m_4048814098611670904moz-txt-link-freetext" href="https://reviews.llvm.org/D30416" target="_blank" style="font-family:arial,sans-serif;font-size:14px">https://reviews.llvm.org/<wbr>D30416</a><span style="font-size:14px"> is one?</span><br></div><div class="gmail_default"><span style="font-size:14px"><br></span></div><div class="gmail_default"><span style="font-size:14px">Regards,</span></div><div class="gmail_default"><span style="font-size:14px">chenwj</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-17 1:49 GMT+08:00 Friedman, Eli via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    <div class="m_4048814098611670904moz-cite-prefix">On 6/15/2017 11:13 PM, Ehsan Amiri
      wrote:<br>
    </div>
    </span><blockquote type="cite">
      <div dir="auto">
        <div><br>
          <div class="gmail_extra"><span class="">Forgot to reply to all<br>
            </span><div class="gmail_quote"><br type="attribution">
              <blockquote class="m_4048814098611670904quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div dir="auto">
                  <div>Hi Eli
                    <div class="m_4048814098611670904quoted-text">
                      <div class="gmail_extra">
                        <div class="gmail_quote">
                          <blockquote class="m_4048814098611670904m_-148379498413252890quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                            <div text="#000000" bgcolor="#FFFFFF">
                              <div class="m_4048814098611670904m_-148379498413252890quoted-text">
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">We
                                      want to read S->b for example.
                                      The size of struct S is 64 bits,
                                      and seems LLVM treats it as i64.</div><span class="">
                                    <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Below
                                      is the IR corresponding to
                                      S->b, IIRC. </div>
                                    <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
                                    </div>
                                    <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> 
                                        %0 = load i64, *i64 ptr, align
                                      4;</div>
                                    <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> 
                                        %1 = %0 lshr 8;</div>
                                    <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> 
                                        %2 = %1 and 255;</div>
                                  </span></div>
                                </blockquote>
                                <br>
                              </div>
                              This looks fine.</div>
                          </blockquote>
                        </div>
                      </div>
                    </div>
                  </div><span class="">
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">Why can't we expect InstCombine to
                    simplify this to an 8 bit load, assuming each of %0
                    and %1 has only one use ?</div>
                  <font color="#888888">
                    <div dir="auto">
                      <div class="gmail_extra"><br>
                      </div>
                    </div>
                  </font></span></div>
              </blockquote>
            </div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <p>We don't aggressively narrow loads and stores in IR because it
      tends to block other optimizations.  See
      <a class="m_4048814098611670904moz-txt-link-freetext" href="https://reviews.llvm.org/D30416" target="_blank">https://reviews.llvm.org/<wbr>D30416</a>.<br>
    </p><span class="">
    <p>-Eli<br>
    </p>
    <pre class="m_4048814098611670904moz-signature" cols="72">-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
  </span></div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div>