<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 03/25/2014 05:32 PM, Matt Arsenault
      wrote:<br>
    </div>
    <blockquote cite="mid:53322004.2030604@amd.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">On 03/25/2014 05:07 PM, Jingyue Wu
        wrote:<br>
      </div>
      <blockquote
cite="mid:CAMROOrH_1pwtigUK9QRjXivEs5HtZkJTEhY8pXnKnqvnjCYnVQ@mail.gmail.com"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <div dir="ltr"><br>
          <div class="gmail_extra"><br>
            <br>
            <div class="gmail_quote">On Tue, Mar 25, 2014 at 3:21 PM,
              Matt Arsenault <span dir="ltr"><<a
                  moz-do-not-send="true"
                  href="mailto:Matthew.Arsenault@amd.com"
                  target="_blank">Matthew.Arsenault@amd.com</a>></span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                <div text="#000000" bgcolor="#FFFFFF">
                  <div class="">
                    <div>On 03/25/2014 02:31 PM, Jingyue Wu wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">
                        <div class="gmail_quote">
                          <div dir="ltr"><br>
                            <div>However, we have three concerns on
                              this:</div>
                            <div>a) I doubt this optimization is valid
                              for all targets, because LLVM language
                              reference (<a moz-do-not-send="true"
                                href="http://llvm.org/docs/LangRef.html#addrspacecast-to-instruction"
                                target="_blank">http://llvm.org/docs/LangRef.html#addrspacecast-to-instruction</a>)
                              says addrspacecast "can be a no-op cast or
                              a complex value modification, depending on
                              the target and the address space pair." <br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  I think most of the simple cast optimizations would be
                  acceptable. The addrspacecasted pointer still needs to
                  point to the same memory location, so changing an
                  access to use a different address space would be OK. I
                  think canonicalizing accesses to use the original
                  address space of a casted pointer when possible would
                  make sense.</div>
              </blockquote>
              <div><br>
              </div>
              "the address space conversion is legal then both result
              and operand refer to the same memory location". I don't
              quite understand this sentence. Does the same memory
              location mean the same numeric value?</div>
          </div>
        </div>
      </blockquote>
      No, it means they could both have different values that point to
      the same physical location. Storing to a pointer in one address
      space should have the same effect as storing to the
      addrspacecasted pointer, though it might not use the same value or
      instructions to do so.<br>
    </blockquote>
    This interpretation fits my reasoning as well.  <br>
    <br>
    I would assume it's legal to reason about aliasing (for value
    forwarding, etc..), but not to reason about the semantics of the
    exact load used.  (i.e. one could perform a runtime manipulation of
    the loaded value, the other might not)<br>
    <br>
    Philip<br>
    <br>
  </body>
</html>