diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-03 19:44:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-03 19:44:02 +0000 |
commit | 29874e0dc6c4e55bc384611273343bb358982cc3 (patch) | |
tree | ff01073ac8df137035c562888c7cd0f61b60d29f /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | e96cc775e496260b7a42dbd6148dffb0575d1304 (diff) |
Factor some code into a new FoldSingleEntryPHINodes method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index f4faeb3deb..d6465f599c 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1101,10 +1101,7 @@ static bool FoldCondBranchOnPHI(BranchInst *BI) { // Degenerate case of a single entry PHI. if (PN->getNumIncomingValues() == 1) { - if (PN->getIncomingValue(0) != PN) - PN->replaceAllUsesWith(PN->getIncomingValue(0)); - else - PN->replaceAllUsesWith(UndefValue::get(PN->getType())); + FoldSingleEntryPHINodes(PN->getParent()); PN->eraseFromParent(); return true; } |