<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 4, 2012, at 9:05 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 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><div><br><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 href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>