<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 8/26/15 3:01 AM, koffie drinker
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAERF46K=snMCNGycvMStDUSd+SpxeTgeK3coBAgZvgrRKmHD1Q@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>Thanks for your reply. I did verify that all my calls are
          using the correct *InContext api calls.</div>
        <div>I discovered that the types were in different context by
          testing with:</div>
        <div>
          <pre class="" id="comment_text_2">                  auto t1 = LLVMInt1TypeInContext(context);
                        auto t2 = LLVMInt1Type();
</pre>
          <pre class="" id="comment_text_2"><span>The substituted value type in GVN.cpp equals to t2 instead of t1. So It somehow is using a global context instead of my own during the GVN pass. So I think it's a bug. It could be C api related.</span></pre>
          <pre class="" id="comment_text_2"><span>I willing to spend time on it and patch it if someone can point me to the part where this might happen. I'm quite new to LLVM and unfamiliar with the source tree.</span>
</pre>
          <pre class="" id="comment_text_2">
</pre>
        </div>
      </div>
    </blockquote>
    <br>
    I don't know where the C bindings are located in the source tree. 
    However, if you think the GVN pass is causing the issue, its source
    code is in the lib/Transforms/Scalar/GVN.cpp file.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CAERF46K=snMCNGycvMStDUSd+SpxeTgeK3coBAgZvgrRKmHD1Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <pre class="" id="comment_text_2">Regards</pre>
          <pre class="" id="comment_text_2">
</pre>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Aug 26, 2015 at 2:18 AM, John
          Criswell <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote">
            <div><span class="">
                <div>On 8/25/15 10:28 AM, koffie drinker via llvm-dev
                  wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">Hi,
                    <div><br>
                    </div>
                    <div>I'm experiencing a weird problem with llvm
                      3.7(rc2/rc3) that did not occur in llvm 3.6.2</div>
                    <div>I created a bug for it: <a
                        moz-do-not-send="true"
                        href="https://llvm.org/bugs/show_bug.cgi?id=24521"
                        target="_blank"><a class="moz-txt-link-freetext" href="https://llvm.org/bugs/show_bug.cgi?id=24521">https://llvm.org/bugs/show_bug.cgi?id=24521</a></a></div>
                    <div><br>
                    </div>
                    <div>
                      <div>I'm building a app where multiple code gen
                        can happen in parallel. The documentation state
                        that I need to use separate context. Each thread
                        has it's own context.</div>
                      <div><br>
                      </div>
                      <div>When code generating a constant number I use
                        the *InContext() calls to create the types. The
                        assert fails since the optimizer replaces some
                        numbers with a global type. The values are equal
                        but the types are not. I did patch some calls to
                        compare on getTypeID() but got another assert a
                        couple of days later in another source file.</div>
                    </div>
                  </div>
                </blockquote>
                <br>
              </span> It sounds like the two values (or the types of the
              values) are in different contexts.  If you are creating
              the Types, make sure each type is created in the correct
              context.  If some LLVM API function is creating the type
              for you, then it may be creating it in the wrong context
              (i.e., you have found a bug) or the LLVM API function has
              to assume a context (i.e., there is a limitation in the
              API for your application).<br>
              <br>
              If you determine that it is a bug, you should file a bug
              report.  If it's a limitation, you should file an
              enhancement request.<br>
              <br>
              Sorry I can't be more helpful than that; I haven't used
              LLVM 3.7 yet, and I haven't used multiple contexts within
              a multi-threaded application.  These are educated guesses
              on my part.<br>
              <br>
              Regards,<br>
              <br>
              John Criswell<br>
              <br>
              <blockquote type="cite"><span class="">
                  <div dir="ltr">
                    <div><br>
                    </div>
                    <div>I needed 3.7 because of
                      the LLVMAddGlobalMapping C api fixes. </div>
                    <div>Could someone help me out ? Or point me in the
                      right direction? I'm using the C api.</div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                </span>
                <pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a moz-do-not-send="true" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><span class="HOEnZb">
</span></pre>
                <span class="HOEnZb"> </span></blockquote>
              <span class="HOEnZb"> <br>
                <br>
                <pre cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a moz-do-not-send="true" href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
              </span></div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>