diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-23 21:05:58 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-23 21:05:58 +0000 |
commit | f96e1371e85a5b6be0d787f56e5882e7b63eefc7 (patch) | |
tree | db75aafa57099ddbeac35a41a9b9250a1b89fb2e /llvm/lib/Transforms/Scalar/JumpThreading.cpp | |
parent | c11802a521b48dc3626fcaac3ff73f5847acd33e (diff) | |
download | bcm5719-llvm-f96e1371e85a5b6be0d787f56e5882e7b63eefc7.tar.gz bcm5719-llvm-f96e1371e85a5b6be0d787f56e5882e7b63eefc7.zip |
Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.
llvm-svn: 51499
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 25f41d38a4e..407d081b781 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -116,9 +116,8 @@ BasicBlock *JumpThreading::FactorCommonPHIPreds(PHINode *PN, Constant *CstVal) { /// getJumpThreadDuplicationCost - Return the cost of duplicating this block to /// thread across it. static unsigned getJumpThreadDuplicationCost(const BasicBlock *BB) { - BasicBlock::const_iterator I = BB->begin(); /// Ignore PHI nodes, these will be flattened when duplication happens. - while (isa<PHINode>(*I)) ++I; + BasicBlock::const_iterator I = BB->getFirstNonPHI(); // Sum up the cost of each instruction until we get to the terminator. Don't // include the terminator because the copy won't include it. |