Sheng Zhou
2008-Aug-18 02:00 UTC
[LLVMdev] A question about FoldBranchtoCommonDest() in pass -simplifycfg
Hi, Is there anybody familiar with the code in llvm/lib/Transforms/Utils/SimplifyCFG.cpp? The function FoldBranchtoCommonDest() (line 1422) has the comment as following: "/// FoldBranchToCommonDest - If this basic block is ONLY a setcc and a branch, /// 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. Sheng.