<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 17, 2012, at 9:13 AM, Tomas Minac <<a href="mailto:minac.tomas@gmail.com">minac.tomas@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Andy,<br>
      <br>
      thank you for your respond,<br>
      <br>
      On 09/06/12 21:32, Andrew Trick wrote:<br>
    </div>
    <blockquote cite="mid:CE09B65C-7B94-4C0E-AD1F-446C9009E625@apple.com" type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <br>
      <div>
        <div>On Sep 4, 2012, at 9:05 AM, Tomas Minac <<a moz-do-not-send="true" href="mailto:minac.tomas@gmail.com">minac.tomas@gmail.com</a>>

          wrote:</div>
        <br class="Apple-interchange-newline">
        <blockquote type="cite">
          <meta http-equiv="content-type" content="text/html;
            charset=ISO-8859-1">
          <div bgcolor="#FFFFFF" text="#000000"> <br>
            <div class="moz-forward-container">
              <meta http-equiv="content-type" content="text/html;
                charset=ISO-8859-1">
              Hello,<br>
              <br>
              I am member of research team on our Faculty of Information
              Technology (university VUT in Brno Czech Republic). We use
              LLVM for many projects and actually we want to create
              system, which will be able compile and profile aplication
              for VLIW processors in few iterations.<br>
              We want to load profile information in 'opt' part of LLVM
              and use it for create superblocks. Note, when superblocks
              will be created, we want to use llc for our specials
              backends.<br>
            </div>
          </div>
        </blockquote>
        <div><br>
        </div>
        I suggest looking at the problem upside-down. What optimization
        do you need to enable on superblocks, and how will changing the
        IR help? Any single predecessor blocks laid out sequentially
        looks like a superblock to me. What do you gain by changing the
        IR? Maybe you can write a self-contained MachineIR pass that
        does the optimization you need, or extend an existing pass.</div>
      <div><br>
      </div>
      <div>-Andy</div>
    </blockquote>
    <br>
    Our backend processor is VLIW, but we want our system to be platform
    independent. That means, after this project we maybe used it for
    specials risc processor or other VLIWs.<br>
    We think superblock can has multiple outputs, so we want to somehow
    put basic block together and not only these one, which has single
    predecessor. The basic goal is create superblock by using branch
    target expansion, loop peeling, loop unrolling (from article <a class="moz-txt-link-freetext" href="http://www.eecs.umich.edu/%7Emahlke/papers/1993/hwu_jsuper93.pdf">http://www.eecs.umich.edu/~mahlke/papers/1993/hwu_jsuper93.pdf</a>)
    to get as big superblock as it will be possible. After, in llc will
    be special scheduler and it will work with these superblocks.<br>
    Finally, we decided to extend basic block class with information
    (can be simply integer value) to which superblock basic block
    belongs.<br></div></blockquote><div><br></div><div>Yes, you need to transform the CFG to form superblocks. No you don't need to extend the IR itself. You can implement a new Analysis pass that summarizes superblocks (e.g. which superblock does each block belong to). Although I'm not sure what that buys you over simply laying out the blocks in superblock order.</div><div>-Andy</div><div><br></div><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000"><blockquote cite="mid:CE09B65C-7B94-4C0E-AD1F-446C9009E625@apple.com" type="cite"><div>
        <blockquote type="cite">
          <div bgcolor="#FFFFFF" text="#000000">
            <div class="moz-forward-container">         *.ll -> opt 
              -> llc -> *.asm<br>
                            |<br>
                   profile information    <br>
              <br>
              We are thinking about creating superblocks in two ways:<br>
                  1. Simply join basic blocks and branch instrunction in
              the join point replace by some intrinsic instrunction.<br>
                          Example:<br>
              <font face="monospace">define i32 @foo(i32 %a, i32 %b)
                nounwind uwtable {<br>
                entry:<br>
                        ...<br>
                  br i1 %cond, label %if.then, label %if.else<br>
                if.then:                                          ;
                preds = %entry<br>
                        ...<br>
                  br label %if.end<br>
                if.else:                                          ;
                preds = %entry<br>
                        ...<br>
                  br label %if.end<br>
                if.end:                                           ;
                preds = %if.else, %if.then<br>
                        ...<br>
                  ret i32 %add7</font><br>
                      It will be transformed to:<br>
              <br>
              <font face="monospace">define i32 @foo(i32 %a, i32 %b)
                nounwind uwtable {<br>
                entry:<br>
                        ...<br>
                    spec.instrinsic.instr.with.label.on.if.else()<br>
                        ...<br>
                  br label %if.end<br>
                if.else:                                          ;
                preds = %entry<br>
                        ...<br>
                  br label %if.end<br>
                if.end:                                           ;
                preds = %if.else, %if.then<br>
                        ...<br>
                  ret i32 %add7</font><br>
              <br>
                  2. Create class named SuperBlock, which will be very
              similar to BasicBlock class and has vector of contained
              BasicBlocks. Of course, in this case, we will have to
              create MachineSuperBlock class, because we want to use
              llc, how I noted above. Result can looks like that:<br>
                  Example:<br>
              <font face="monospace">define i32 @foo(i32 %a, i32 %b)
                nounwind uwtable {<br>
                superblock.entry.start:<br>
                entry:<br>
                        ...<br>
                  br i1 %cond, label %if.then, label %if.else<br>
                if.then:                                          ;
                preds = %entry<br>
                        ...<br>
                  br label %if.end<br>
                superblock.entry.end:<br>
                superblock.if.else.start:<br>
                if.else:                                          ;
                preds = %entry<br>
                        ...<br>
                  br label %if.end<br>
              </font><br>
              <font face="monospace"><font face="monospace">superblock.if.else.end:<br>
                  superblock.if.end.start:<br>
                </font> if.end:                                          

                ; preds = %if.else, %if.then<br>
                        ...<br>
                  ret i32 %add7</font><br>
              <font face="monospace">superblock.if.end.end:</font><br>
                  <br>
              What do you think which way will bring less problems for
              additional processing with llc?<br>
              <br>
              I hope and looking for some more advices or any notes to
              our drafts I will be thankfull.<br>
              <br>
              Regards,<br>
              Tomas Minac<br>
              <br>
              <br>
            </div>
            <br>
          </div>
          _______________________________________________<br>
          LLVM Developers mailing list<br>
          <a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
                  <a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a><br>
          <a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
  </div>

</blockquote></div><br></body></html>