<div dir="ltr"><br><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 15, 2014 at 10:46 AM, John Criswell <span dir="ltr"><<a href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div class="">
    <div>On 7/15/14, 9:32 AM, Gaoyao Xiao wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I have some IR files which can  be compiled using llc-3.0
          and gcc-4.6.3. I want to instrument these IR files. My
          instrumentation pass is implemented under LLVM-3.5 and some
          data structures in LLVM-3.5 are not available on LLVM-3.0,
          such as <i>AttributeSet</i> in <i>Attribute.h</i>. I tried
          to compile my instrumentation pass under LLVM-3.0 and it
          failed due to missing data types. So I am asking whether it is
          possible to use LLVM-3.5 to instrument the IR files?  If not,
          is there any walk around?</div>
      </div>
    </blockquote>
    <br></div>
    I believe LLVM 3.5 is supposed to be able to read bitcode files from
    LLVM 3.0.  It is possible, though, that bugs may prevent this from
    working.  If it doesn't work, you should probably file a bug report
    with (if possible) a reduced test case.<br>
    <br>
    If reading the old bitcode files directly into opt/clang/whatever
    doesn't work, try disassembling the bitcode into an assembly file
    with llvm-dis from LLVM 3.0 and re-assembling the output using
    llvm-as from LLVM 3.5:<br></div></blockquote><div>opt and clang can read the bitcode but the produced binary cannot run.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
    <br>
    llvm-dis-3.0 -f -o - file.bc | llvm-as-3.5 -f -o newfile.bc<br></div></blockquote><div>I tried this and the newfile.bc is incorrect. newfile.bc can be compiled to binary but cannot run.<br><br></div><div>I also tried to this: 
    <br><i>llvm-dis-3.0 -f -o - file.bc | llvm-as-3.5 -f -o newfile.bc<br>llvm-dis-3.5 -f -o newfile.bc | llvm-as-3.0 -o newnewfile.bc<br></i><br></div><div>llvm-as-3.0 fails and give errors as below:<br>llvm-as: /home/jun/New_SecondWrite_Output/benchmarks/bzip2_O3/bzip2_O3-3.5.ll:43:37: error: expected top-level entity<br>
declare void @perror(i8* nocapture) #0<br><br></div><div>So it seems llvm3.5 indeed is incompatible with llvm3.0.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks!</div>
        <div>Gaoyao</div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>