[LLVMdev] Question regarding basic-block placement optimization

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Oct 18 17:47:14 PDT 2011


On Oct 18, 2011, at 5:22 PM, Chandler Carruth wrote:

> Treat glued-together blocks as super-blocks, and everything should be as breezy as IR.
> 
> But that's just the thing -- a primary goal of this pass would be to *change* the fall-through pattern.

That's not a problem. I wasn't talking about normal fall-through blocks. You simply call MBB->updateTerminator() for those.

> Also, it's still not clear to me how to analyze switches in CodeGen, but that's likely my lack of having read the appropriate interfaces thoroughly.

Switches aren't real, so they don't exist in CodeGen.

Parts of switches can be lowered to jump tables and indirect branches.

An indirect branch will cause AnalyzeBranch() to fail, but canFallThrough() will still return false, and it is safe to move the successors around. This also works for computed goto.

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111018/e0dbf9b4/attachment.html>


More information about the llvm-dev mailing list