diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-18 22:25:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-18 22:25:39 +0000 |
commit | 4b105912657c0472dc4f6f7244ce20bf7cf9a7dc (patch) | |
tree | 96962fdc2912c65cc1bd6bd1944125979defff1f /lib/CodeGen/BranchFolding.cpp | |
parent | f10a56a86f8ae32d0493c7de770493d55519b073 (diff) |
Don't transform in another bad case: if the block is empty, it should be
simplified before we do this xform so that our cost model is accurate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index c69930da81..8ded3cdc64 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -729,7 +729,8 @@ void BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) { // // In this case, we could actually be moving the return block *into* a // loop! - if (DoTransform && !MBB->succ_empty() && !CanFallThrough(PriorTBB)) + if (DoTransform && !MBB->succ_empty() && + (!CanFallThrough(PriorTBB) || PriorTBB->empty())) DoTransform = false; |