[LLVMdev] A question about FoldBranchtoCommonDest() in pass -simplifycfg

Sheng Zhou zhousheng at autoesl.com
Sun Aug 17 19:00:54 PDT 2008


Is there anybody familiar with the code in

The function FoldBranchtoCommonDest() (line 1422) has the comment as
"/// FoldBranchToCommonDest - If this basic block is ONLY a setcc and a
/// and if a predecessor branches to us and one of our successors, fold the
/// setcc into the predecessor and use logical operations to pick the right
/// destination."

My question is why that function requires the basic block should only
contain a setcc and a branch in it. Is there any special reason?

Thanks in advance.

More information about the llvm-dev mailing list