<div dir="ltr">I'm using<div>    builder.setMCPU(llvm::sys::getHostCPUName())</div><div><br></div><div>which seems to do the trick.</div><div><br></div><div>--matt</div><div><span style="line-height:1.5"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 8, 2016 at 3:37 AM Paweł Bylica <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>Can someone also explain how to configure MCJIT to generate code for native target (like clang's -march=native)?</div><div><br></div><div>Thanks,</div><div>Paweł</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 8, 2016 at 2:01 AM Morten Brodersen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Lang,</div><div text="#000000" bgcolor="#FFFFFF"><br>
    <br>
    > can you share your EngineBuilder configuration lines?<br>
    <br></div><div text="#000000" bgcolor="#FFFFFF">
    Sure.<br>
    <br>
    The 3.5.2 version use:<br>
    <br>
    <big><big><tt>        llvm::ExecutionEngine* ee =</tt><tt><br>
        </tt><tt>            llvm::EngineBuilder(module)</tt><tt><br>
        </tt><tt>                .setEngineKind(llvm::EngineKind::JIT)</tt><tt><br>
        </tt><tt>               
          .setOptLevel(llvm::CodeGenOpt::Aggressive)</tt><tt><br>
        </tt><tt>                .create();</tt><tt><br>
        </tt><tt><br>
        </tt><tt>       
          module->setDataLayout(ee->getTargetMachine()->getDataLayout());</tt><tt><br>
        </tt></big></big><br>
    And the 3.7.1 version use:<br>
    <br>
    <big><big><tt>        llvm::EngineBuilder builder(move(modulePtr));</tt><tt><br>
        </tt><tt><br>
        </tt><tt>        builder.setEngineKind(llvm::EngineKind::JIT);</tt><tt><br>
        </tt><tt>        builder.setErrorStr(&error);</tt><tt><br>
        </tt><tt>       
          builder.setOptLevel(llvm::CodeGenOpt::Aggressive);</tt><tt><br>
        </tt><tt><br>
        </tt><tt>        llvm::ExecutionEngine* ee = builder.create();<br>
          <br>
                 
module->setDataLayout(*ee->getTargetMachine()->getDataLayout());<br>
        </tt><tt></tt></big></big><br>
    Cheers</div><div text="#000000" bgcolor="#FFFFFF"><br>
    Morten</div><div text="#000000" bgcolor="#FFFFFF"><br>
    <br>
    <div>On 05/02/16 19:13, Lang Hames wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div>Hi Morten,</div>
      <div><br>
      </div>
      <div>Something else just occurred to me:
        can you share your EngineBuilder configuration lines? (<a href="http://llvm.org/docs/doxygen/html/classllvm_1_1EngineBuilder.html" target="_blank"><a href="http://llvm.org/docs/doxygen/html/classllvm_1_1EngineBuilder.html" target="_blank">http://llvm.org/docs/doxygen/html/classllvm_1_1EngineBuilder.html</a></a>)</div>
      <div><br>
      </div>
      <div>In particular - are you explicitly
        setting the optimization level? The old JIT may have had a
        different default.</div>
      <div><br>
      </div>
      <div>- Lang.</div>
      <div><br>
      </div>
      <div><br>
        <br>
        Sent from my iPad</div>
      <div><br>
        On Feb 4, 2016, at 10:54 PM, Jim Grosbach via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a></a>>
        wrote:<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          
          <div>I agree with Lang and Keno here. This is both unexpected
            and very interesting. Given the differences in defaults
            between the two, I would have expected the new JIT to have
            better performance but longer compile times. That you are
            seeing the opposite implies there is something very wrong
            and I'm very interested to help figure out what it is. <br>
            <br>
            Sent from my iPad</div>
          <div><br>
            On Feb 4, 2016, at 9:12 PM, Morten Brodersen via llvm-dev
            <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>
            wrote:<br>
            <br>
          </div>
          <blockquote type="cite">
            <div>
              
              Hi Keno,<br>
              <br>
              I am talking about runtime. The performance of the
              generated machine code. Not the time it takes to lower the
              IR to machine code.<br>
              <br>
              We typically only JIT once (taking a few secs) and then
              run the generated machine code for hours. So the JIT time
              (IR -> machine code) doesn't impact us.<br>
              <br>
              Cheers<br>
              Morten<br>
              <br>
              <div>On 05/02/16 15:58, Keno
                Fischer wrote:<br>
              </div>
              <blockquote type="cite">
                <div dir="ltr">Actually, reading over all of this again,
                  I realize I may have made the wrong statement. The
                  runtime regressions we see in julia are actually
                  regressions in how long LLVM itself takes to do the
                  compilation (but since it happens at run time in the
                  JIT case, I think of it as a regression in our running
                  time). We have only noticed occasional regressions in
                  the performance of the generated code (which we are in
                  the process of fixing). Which kind of regression are
                  you talking about, time taken by LLVM or time taken by
                  the LLVM-generated code?</div>
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Thu, Feb 4, 2016 at 11:44
                    PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a></a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On
                      4 February 2016 at 22:48, Morten Brodersen via
                      llvm-dev<br>
                      <span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>

                        wrote:<br>
                        > Hi Rafael,<br>
                        ><br>
                        > Not easily (llc).<br>
                        ><br>
                        > Is there a way to make MCJit not use the
                        large code model when JIT'ing?<br>
                        ><br>
                        <br>
                      </span>I think Davide started adding support for
                      the small code model.<br>
                      <br>
                      Cheers,<br>
                      Rafael<br>
                      <div>
                        <div>_______________________________________________<br>
                          LLVM Developers mailing list<br>
                          <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
                          <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </blockquote>
              <br>
            </div>
          </blockquote>
          <blockquote type="cite">
            <div><span>_______________________________________________</span><br>
              <span>LLVM Developers mailing list</span><br>
              <span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a></span><br>
              <span><a 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><br>
            </div>
          </blockquote>
        </div>
      </blockquote>
      <blockquote type="cite">
        <div><span>_______________________________________________</span><br>
          <span>LLVM Developers mailing list</span><br>
          <span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a></span><br>
          <span><a 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><br>
        </div>
      </blockquote>
    </blockquote>
    <br>
  </div>

_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>