<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 6/15/2017 11:13 PM, Ehsan Amiri
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJ6ibVeBDTRD-LWvqQD190tLNCuJH6gtbW6qAsEg=O5pEBOM5A@mail.gmail.com">
      <div dir="auto">
        <div><br>
          <div class="gmail_extra">Forgot to reply to all<br>
            <div class="gmail_quote"><br type="attribution">
              <blockquote class="quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div dir="auto">
                  <div>Hi Eli
                    <div class="quoted-text">
                      <div class="gmail_extra">
                        <div class="gmail_quote">
                          <blockquote class="m_-148379498413252890quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex">
                            <div text="#000000" bgcolor="#FFFFFF">
                              <div
                                class="m_-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>
                                    <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>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
                              This looks fine.</div>
                          </blockquote>
                        </div>
                      </div>
                    </div>
                  </div>
                  <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></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="moz-txt-link-freetext" href="https://reviews.llvm.org/D30416">https://reviews.llvm.org/D30416</a>.<br>
    </p>
    <p>-Eli<br>
    </p>
    <pre class="moz-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>
  </body>
</html>