<DIV>Thanks a lot for replying.</DIV>
<DIV> </DIV>
<DIV>I have another query.</DIV>
<DIV> </DIV>
<DIV>If branching to the entry block is not legal in llvm how should I be able to create a new entry block for any existing list?</DIV>
<DIV> </DIV>
<DIV>I created a new block and inserted it into the present basic block list , but I get this error:</DIV>
<DIV> </DIV>
<DIV>opt: BasicBlock.cpp:83: virtual llvm::BasicBlock::~BasicBlock(): Assertion `getParent() == 0 && "BasicBlock still linked into the program!"' failed.<BR></DIV>
<DIV>The program completes its task and i get this in the end.</DIV>
<DIV>I am unable to resolve this.</DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV>Tanu<BR><BR><B><I>John Criswell <criswell@cs.uiuc.edu></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Tanu Sharma wrote:<BR>> Hello,<BR>> <BR>> In an attempt to randomise the basic blocks in a function, is it <BR>> possible that I can randomise the entry block as well? And maybe insert <BR>> some instructions in the pass to call entry block while running the <BR>> program ?<BR>> <BR>> Is it feasible?<BR>> <BR>> What does entry block consist of ?<BR><BR>The entry block, by definition, is the first basic block (BB) to be <BR>executed by a function. As I understand it, it has the additional <BR>restriction that it cannot be dominated by other basic blocks (i.e. no <BR>other BBs in the function can branch to it).<BR><BR>If your entry BB performs useful computations and you want to move it, <BR>you could create a new entry BB that does nothing but branch to the old <BR>entry BB. The old entry BB (now just a regular BB) can then be moved.<BR><BR>I'm as!
 suming
 thus far that you're randomizing the basic block order at <BR>the LLVM level (i.e. take LLVM function, randomize order of BBs, and <BR>then codegen each BB in order). Another approach, as I see it, would be <BR>to change the code generator so that it codegens the BBs in a random <BR>order, instead of codegen'ing them in order.<BR><BR>The first approach, I think, is a lot easier.<BR><BR>Regards,<BR><BR>-- John T.<BR><BR>> <BR>> Thanks<BR>> <BR>> Tanu<BR>> <BR>> <BR>> <BR>> ------------------------------------------------------------------------<BR>> Do you Yahoo!?<BR>> Yahoo! Search presents - Jib Jab's 'Second Term' <BR>> <HTTP: evt="30648/*http://movies.yahoo.com/movies/feature/jibjabinaugural.html" us.rd.yahoo.com><BR>> <BR>> <BR>> <BR>> ------------------------------------------------------------------------<BR>> <BR>> _______________________________________________<BR>> LLVM Developers mailing list<BR>> LLVMdev@cs!
 .uiuc.edu
 http://llvm.cs.uiuc.edu<BR>> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev<BR><BR>_______________________________________________<BR>LLVM Developers mailing list<BR>LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu<BR>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev<BR></BLOCKQUOTE><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com