<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3821.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Times New Roman" size=2>Hi ,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>I got a few for writing a
pass.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>1) Is it possible to use input
parameters in command line ?</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2> For example, we got
our own pass, ie. HELLO</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2> opt -load
../../Debug/lib/libHELLO.so -HELLO < hello.bc</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2> From the above
command line, could we use some input parameter and we can read those parameter
in Pass routine?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>2) For splitting BB, the way what I did
is to pick up instruction randomly and do splitting before this instruction. But
sometime I got error when I run the Pass. It seems some of instruction set
cannot be splitted, right? the instruction like 'phi..'. If so, how could we
check this instruction to see if it can be splitted or not.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>3) Here is a piece of code</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2> char a[]="hello
world";<BR> int i;<BR></FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
for(i=0;i<10;i++){<BR> a[i]=a[i]+1;</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2> }</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>And I got IR code like the
following</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>no_exit: ; preds =
%strlen.entry, %no_exit</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2><BR> %indvar = phi uint [
%indvar.next, %no_exit ], [ 0, %strlen.entry ] ; <uint>
[#uses=3]<BR> %i.0.0 = cast uint %indvar to int ; <int>
[#uses=1]<BR> %tmp.24 = getelementptr [12 x sbyte]* %a, int 0, uint
%indvar ; <sbyte*> [#uses=2]<BR> %tmp.28 = load sbyte*
%tmp.24 ; <sbyte> [#uses=1]<BR> %tmp.29 = add sbyte
%tmp.28, 1 ; <sbyte> [#uses=1]<BR> store sbyte %tmp.29,
sbyte* %tmp.24<BR> %inc = add int %i.0.0, 1 ; <int>
[#uses=1]<BR> %tmp.20 = setlt int %inc, %tmp.17 ; <bool>
[#uses=1]<BR> %indvar.next = add uint %indvar, 1 ; <uint>
[#uses=1]<BR> br bool %tmp.20, label %no_exit, label
%loopexit<BR></FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>So does it mean that I should insert
all the IR code if I would like to insert a for loop in existed code.
I can do it by inserting a call funcation. Here, I need insert for loop
into the code body.</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2><BR> </FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
</FONT></DIV></BODY></HTML>