[LLVMdev] How basic block layout is determined during scheduling?
triple.yang at gmail.com
Thu Sep 19 06:21:56 PDT 2013
Thank you very much, Tim.
I comment out "let isBarrier = 1" in the definition of the conditional
branch instruction and run again, it does work.
2013/9/18 Tim Northover <t.p.northover at gmail.com>
> Hi Yang,
> > bnz R2, LBB0_34
> > I do not have any clue what happens when compiling with -O2.
> > Can someone make a suggestion?
> Is the "bnz" instruction marked "isBarrier" in your TableGen files? If
> so, that would mean LLVM considers fallthrough impossible and decides
> it can move LBB0_33 around at will. It's still very odd that it thinks
> it can put it directly before LBB0_34 though.
> It would be interesting to see the blocks before and after the "Basic
> block placement" pass. Running llc with -print-after-all and/or -debug
> might well shed some light on what's happening.
> Other possible bugs are in implementations of AnalyzeBranch,
> InsertBranch or RemoveBranch. They're target callbacks LLVM uses to do
> its more invasive block movement. The place to start debugging is
> lib/CodeGen/MachineBlockPlacement.cpp. Something in there is probably
> getting confused.
杨勇勇 (Yang Yong-Yong)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev