diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-10-22 20:29:08 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-22 20:29:08 +0000 |
commit | e0675fb8fbc78bd1e60bab0c1fac711eab96ab6e (patch) | |
tree | 83c831804e8b24fe661b43f0f9c53d89051b6965 | |
parent | f4fb5f500c63e860cb60b5fea6dcd3e69e1927cd (diff) | |
download | bcm5719-llvm-e0675fb8fbc78bd1e60bab0c1fac711eab96ab6e.tar.gz bcm5719-llvm-e0675fb8fbc78bd1e60bab0c1fac711eab96ab6e.zip |
[Sink] Don't check BB.empty()
As an invariant, BasicBlocks cannot be empty when passed to a transform.
This is not the case for MachineBasicBlocks and the Sink pass was ported
from the MachineSink pass which would explain the check's existence.
llvm-svn: 251057
-rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index 8b916347999..f6ccd999ea0 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/lib/Transforms/Scalar/Sink.cpp @@ -119,7 +119,7 @@ bool Sinking::runOnFunction(Function &F) { bool Sinking::ProcessBlock(BasicBlock &BB) { // Can't sink anything out of a block that has less than two successors. - if (BB.getTerminator()->getNumSuccessors() <= 1 || BB.empty()) return false; + if (BB.getTerminator()->getNumSuccessors() <= 1) return false; // Don't bother sinking code out of unreachable blocks. In addition to being // unprofitable, it can also lead to infinite looping, because in an |