From: David Majnemer Date: Thu, 22 Oct 2015 20:29:08 +0000 (+0000) Subject: [Sink] Don't check BB.empty() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e6a5192692bb99878f8902b9f75644a13d57a633;p=oota-llvm.git [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251057 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/Sink.cpp b/lib/Transforms/Scalar/Sink.cpp index 8b916347999..f6ccd999ea0 100644 --- a/lib/Transforms/Scalar/Sink.cpp +++ b/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