<div dir="ltr">Thank you very much, Tim.<div>I comment out "let <span style="font-family:arial,sans-serif;font-size:13px">isBarrier = 1</span>" in the definition of the conditional branch instruction and run again, it does work.</div>
<div><br></div><div>Best regards.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/18 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Yang,<br>
<br>
>     bnz  R2, LBB0_34<br>
<div class="im">><br>
> I do not have any clue what happens when compiling with -O2.<br>
> Can someone make a suggestion?<br>
<br>
</div>Is the "bnz" instruction marked "isBarrier" in your TableGen files? If<br>
so, that would mean LLVM considers fallthrough impossible and decides<br>
it can move LBB0_33 around at will. It's still very odd that it thinks<br>
it can put it directly before LBB0_34 though.<br>
<br>
It would be interesting to see the blocks before and after the "Basic<br>
block placement" pass. Running llc with -print-after-all and/or -debug<br>
might well shed some light on what's happening.<br>
<br>
Other possible bugs are in implementations of AnalyzeBranch,<br>
InsertBranch or RemoveBranch. They're target callbacks LLVM uses to do<br>
its more invasive block movement.  The place to start debugging is<br>
lib/CodeGen/MachineBlockPlacement.cpp. Something in there is probably<br>
getting confused.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>杨勇勇 (Yang Yong-Yong)
</div>