<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="moz-cite-prefix">On 01/08/2016 09:12 AM, Quentin
      Colombet via llvm-dev wrote:<br>
    </div>
    <blockquote
      cite="mid:8E86597D-61AE-4337-B9AC-36E3D0905E83@apple.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <br class="">
      <div>
        <blockquote type="cite" class="">
          <div class="">On Jan 8, 2016, at 8:51 AM, Mehdi Amini <<a
              moz-do-not-send="true" href="mailto:mehdi.amini@apple.com"
              class=""><a class="moz-txt-link-abbreviated" href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a></a>> wrote:</div>
          <br class="Apple-interchange-newline">
          <div class="">
            <blockquote type="cite" style="font-family: Helvetica;
              font-size: 12px; font-style: normal; font-variant: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class=""><br
                class="Apple-interchange-newline">
              On Jan 8, 2016, at 1:34 AM, David Chisnall via llvm-dev
              <<a moz-do-not-send="true"
                href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>>
              wrote:<br class="">
              <br class="">
              On 7 Jan 2016, at 19:47, Quentin Colombet <<a
                moz-do-not-send="true" href="mailto:qcolombet@apple.com"
                class=""><a class="moz-txt-link-abbreviated" href="mailto:qcolombet@apple.com">qcolombet@apple.com</a></a>> wrote:<br class="">
              <blockquote type="cite" class=""><br class="">
                Indeed, you said that inttoptr instruction is not a
                no-op on your architecture, whereas the language
                reference says:<br class="">
                “The ‘inttoptr‘ instruction converts value to type ty2
                by applying either a zero extension or a truncation
                depending on the size of the integer value. If value is
                larger than the size of a pointer then a truncation is
                done. If value is smaller than the size of a pointer
                then a zero extension is done. If they are the same
                size, nothing is done (no-op cast).”<br class="">
                <br class="">
                The bottom line is that IMHO, if you rely on
                inttoptr/ptrtoint instructions to do the conversion from
                fat pointers to plain integers you are abusing the IR.<br
                  class="">
                <br class="">
              </blockquote>
              <br class="">
              I believe that this is somewhere where the IR
              specification needs to evolve.  Currently, we have no
              in-tree architectures where pointers are not integers and
              so that definition is appropriate.  Adding a new pair of
              IR instructions for integer-to-pointer and
              pointer-to-integer conversions and not calling them
              inttoptr / ptrtoint is likely to be far more confusing.<br
                class="">
            </blockquote>
            <br style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant: normal; font-weight:
              normal; letter-spacing: normal; orphans: auto; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px;" class="">
            <span style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant: normal; font-weight:
              normal; letter-spacing: normal; orphans: auto; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">I think this would deserve
              its own RFC email thread.</span><br style="font-family:
              Helvetica; font-size: 12px; font-style: normal;
              font-variant: normal; font-weight: normal; letter-spacing:
              normal; orphans: auto; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal; widows:
              auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"
              class="">
          </div>
        </blockquote>
        <div><br class="">
        </div>
        +1</div>
    </blockquote>
    FYI, we need something very similar for GC purposes and are going to
    make a proposal along these lines within the next week or two.  We
    not yet to the point of having a "final" proposal, but we're
    planning on starting with some initial experimental support,
    prototyping on ToT, and evolving the spec language as we need to. 
    Details to follow separately.  <br>
    <br>
    David, you and I should probably talk offline to make sure what
    we're thinking about works for you as well.<br>
    <blockquote
      cite="mid:8E86597D-61AE-4337-B9AC-36E3D0905E83@apple.com"
      type="cite">
      <div><br class="">
      </div>
      <div>Q.<br class="">
        <blockquote type="cite" class="">
          <div class=""><br style="font-family: Helvetica; font-size:
              12px; font-style: normal; font-variant: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <span style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant: normal; font-weight:
              normal; letter-spacing: normal; orphans: auto; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">—<span
                class="Apple-converted-space"> </span></span><br
              style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant: normal; font-weight:
              normal; letter-spacing: normal; orphans: auto; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px;" class="">
            <span style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant: normal; font-weight:
              normal; letter-spacing: normal; orphans: auto; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">Mehdi</span></div>
        </blockquote>
      </div>
      <br class="">
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>