<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Dear Zahra,<br>
      <br>
      To reorder basic blocks, all you need to do is to write an LLVM
      pass that changes the order that the block appear within the list
      of basic blocks that belong to the function.  The only block you
      can't reorder is the entry block which, I think, always needs to
      be the first basic block in the list.<br>
      <br>
      The first thing you should do is read the document "Writing an
      LLVM Pass" (<a class="moz-txt-link-freetext" href="http://llvm.org/docs/WritingAnLLVMPass.html">http://llvm.org/docs/WritingAnLLVMPass.html</a>).  You
      should also read the "LLVM Programmer's Manual"
      (<a class="moz-txt-link-freetext" href="http://llvm.org/docs/ProgrammersManual.html">http://llvm.org/docs/ProgrammersManual.html</a>).  To look up
      specific information on LLVM classes, use doxygen
      (<a class="moz-txt-link-freetext" href="http://llvm.org/doxygen/hierarchy.html">http://llvm.org/doxygen/hierarchy.html</a>).<br>
      <br>
      The first coding task would be to write a skeleton FunctionPass
      and run it through the opt program.  After that, you should be
      able to add code to your FunctionPass to reorder the basic blocks
      within a function.<br>
      <br>
      Regards,<br>
      <br>
      John Criswell<br>
      <br>
      <br>
      On 10/5/14, 11:34 AM, Zahra fatehi marj wrote:<br>
    </div>
    <blockquote
cite="mid:CAKSnXa_pegpqD-mr-42_mgpyHyyZ09=4Fe13hah1bDtoFdyksQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div style="font-family:tahoma,sans-serif" class="gmail_default">​
          Hi.</div>
        <div style="font-family:tahoma,sans-serif" class="gmail_default">I
          want to change order of code basic blocks in memory. I visited
          "<a moz-do-not-send="true"
            href="http://llvm.org/docs/ExtendingLLVM.html">http://llvm.org/docs/ExtendingLLVM.html</a>"
          page and it advised me to ask it before any effort.</div>
        <div style="font-family:tahoma,sans-serif" class="gmail_default">What
          parts of LLVM help me and how? I am a newbie on LLVM.</div>
        <div style="font-family:tahoma,sans-serif" class="gmail_default">Thanks.</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </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>