<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body 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>
<br>
*.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"><font face="monospace">superblock.if.end.end:</font></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>
</body>
</html>