<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I like the general direction here.  This is essentially introducing
    the any type I mentioned in the other thread, but only for
    intrinsics.  <br>
    <br>
    Although, it seems like you might still have a problem.<br>
    <br>
    For an example intrinsic "void foo(any)", we'd need unique "foo"
    declarations for each of:<br>
    call void foo(i32 1)<br>
    call void foo(i8* nullptr)<br>
    call void foo(float 1.0)<br>
    <br>
    Unless you want to extend the typing rules to allow "any" as a first
    class IR type?  That seems questionable.  <br>
    <br>
    I think you're going to end up exactly with the name mangling
    problem my other patch tries to address.  You're creating an
    explicit any type; I was essentially creating the same thing via
    varadic intrinsics.  I think our patches are actually solving two
    different, but complementary problems.  <br>
    <br>
    If I'm missing something in your patch, please let me know.  <br>
    <br>
    Philip<br>
    <br>
    <div class="moz-cite-prefix">On 10/09/2014 02:13 PM, Juergen
      Ributzka wrote:<br>
    </div>
    <blockquote
      cite="mid:32577402-028C-43EE-B9C8-B271690BC337@apple.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hi Philip,
      <div class=""><br class="">
      </div>
      <div class="">the patch is incomplete, that is why I haven’t
        posted it yet. I attached it to show the general idea.</div>
      <div class=""><br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div class=""><br class="">
      </div>
      <div class="">Cheers,</div>
      <div class="">Juergen</div>
      <div class=""><br class="">
      </div>
      <div class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On Oct 9, 2014, at 1:51 PM, Philip Reames <<a
                moz-do-not-send="true"
                href="mailto:listmail@philipreames.com" class="">listmail@philipreames.com</a>>
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <meta content="text/html; charset=windows-1252"
                http-equiv="Content-Type" class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""> Has that
                been sent for review?  I'd like to see that approach.<br
                  class="">
                <br class="">
                p.s. Return is actually the easy case.  You only need
                three versions since you can use anyptr, anyint, and
                anyfloat.  The complication comes with function types,
                which are (at least for now) only needed for the
                target.  <br class="">
                <br class="">
                <div class="moz-cite-prefix">On 10/09/2014 01:46 PM,
                  Andrew Trick wrote:<br class="">
                </div>
                <blockquote
                  cite="mid:43B498CD-8459-4820-BD2C-02C9152A27D9@apple.com"
                  type="cite" class="">
                  <meta http-equiv="Content-Type" content="text/html;
                    charset=windows-1252" class="">
                  <div class="">Juergen has a tablegen patch that allows
                    multiple return types on the same intrinsic, which
                    should do exactly what you want without any extra
                    name mangling.</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">-Andy</div>
                  <br class="">
                  <div class="">
                    <blockquote type="cite" class="">
                      <div class="">On Oct 9, 2014, at 1:39 PM, Kevin
                        Modzelewski <<a moz-do-not-send="true"
                          href="mailto:kmod@dropbox.com" class="">kmod@dropbox.com</a>>
                        wrote:</div>
                      <br class="Apple-interchange-newline">
                      <div class="">
                        <div dir="ltr" class="">Oh interesting, that
                          seems to work -- assuming that other people
                          like the approach, would you mind factoring
                          out that part of your statepoint patch?</div>
                        <div class="gmail_extra"><br class="">
                          <div class="gmail_quote">On Thu, Oct 9, 2014
                            at 9:19 AM, Philip Reames <span dir="ltr"
                              class=""><<a moz-do-not-send="true"
                                href="mailto:listmail@philipreames.com"
                                target="_blank" class="">listmail@philipreames.com</a>></span>
                            wrote:<br class="">
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex">
                              <div bgcolor="#FFFFFF" text="#000000"
                                class="">
                                <div class="">On 10/08/2014 09:40 PM,
                                  Kevin Modzelewski wrote:<br class="">
                                </div>
                                <blockquote type="cite" class="">
                                  <pre class="">Hi atrick,

It didn't seem like there was anything special that had to be done besides
just defining the new intrinsic with the different return type.

It seems inelegant to create a new intrinsic for a new return type, but
we're running into a case where we'd like to return a double through a patchpoint
and I'm not sure of a better way to do that.</pre>
                                </blockquote>
                                You might want to take a look at how we
                                defined the gc_result intrinsics in the
                                statepoint patch which is currently up
                                for review.  With some changes to the
                                intrinsic name mangling, you can define
                                an intrinsic per "family" of types.  The
                                four we had to add were: void, int,
                                pointer, float.  (float here means any
                                floating point type, int means any
                                integer type, etc..)
                                <blockquote type="cite" class="">
                                  <pre class=""><a moz-do-not-send="true" href="http://reviews.llvm.org/D5696" target="_blank" class="">http://reviews.llvm.org/D5696</a>

Files:
  docs/StackMaps.rst
  include/llvm/IR/Intrinsics.td
  lib/CodeGen/SelectionDAG/FastISel.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  lib/IR/Verifier.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.cpp
  test/CodeGen/X86/patchpoint.ll
</pre>
                                  <br class="">
                                  <fieldset class=""></fieldset>
                                  <br class="">
                                  <pre class="">_______________________________________________
llvm-commits mailing list
<a moz-do-not-send="true" href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
                                </blockquote>
                                <br class="">
                              </div>
                            </blockquote>
                          </div>
                          <br class="">
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br class="">
                </blockquote>
                <br class="">
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
    <br>
  </body>
</html>