<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    A key point here is that not all targets will have a "generic"
    address space.  This is a new concept which is bring introduced and
    needs to be defined carefully.<br>
    <br>
    Philip<br>
    <br>
    <div class="moz-cite-prefix">On 03/31/2014 02:08 PM, Jingyue Wu
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMROOrHfoRnvVXn20CRck5SVkJMGZ1h6n_hokMg3GfgdqCadiw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Matt, 
        <div><br>
        </div>
        <div>I actually think it should go to lib/Transforms/InstCombine
          when it gets generalized. Also, <span
            style="font-family:arial,sans-serif;font-size:13px">TTI</span> would
          need to expose which address space is generic and whether such
          optimization would benefit at all. 
          <div>
            <br>
          </div>
          <div>Jingyue</div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Mar 31, 2014 at 2:00 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:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
              This looks like it doesn't handle vectors of pointers,
            although that's probably not very important.<br>
            <br>
              I don't see anything tying this to NVPTX except the use of
            0 for generic. Where should this go when generalized? Put it
            in lib/CodeGen and add getGenericAddressSpace() to TTI?<br>
            <br>
            <br>
            ================<br>
            Comment at:
            lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp:67-72<br>
            @@ +66,8 @@<br>
            +<br>
            +  Value *Src = Cast->getOperand(0);<br>
            +  PointerType *SrcTy =
            cast<PointerType>(Src->getType());<br>
            +  PointerType *DestTy =
            cast<PointerType>(Cast->getType());<br>
            +  // We cannot remove the addrspacecast if the element type
            changes.<br>
            +  if (SrcTy->getElementType() !=
            DestTy->getElementType())<br>
            +    return false;<br>
            +<br>
            ----------------<br>
            If the element type changes, you can still do it, but you'll
            need to do the bitcast separately. I had a patch a while ago
            (<a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20131118/195642.html"
              target="_blank">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20131118/195642.html</a>)
            to canonicalize to splitting the bitcast and addrspacecast
            into separate operations. It might be better to handle it
            that way than trying to figure it out here.<br>
            <br>
            <br>
            <a moz-do-not-send="true"
              href="http://llvm-reviews.chandlerc.com/D3235"
              target="_blank">http://llvm-reviews.chandlerc.com/D3235</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>