[TRE] Add assertion for folding trivial return block

llvm-svn: 305637
This commit is contained in:
Xin Tong 2017-06-17 16:55:12 +00:00
parent d5b4d0b53a
commit 025780ba6e

View File

@ -677,6 +677,10 @@ static bool foldReturnAndProcessPred(BasicBlock *BB, ReturnInst *Ret,
const TargetTransformInfo *TTI) {
bool Change = false;
// Make sure this block is a trivial return block.
assert(BB->getFirstNonPHIOrDbg() == Ret &&
"Trying to fold non-trivial return block");
// If the return block contains nothing but the return and PHI's,
// there might be an opportunity to duplicate the return in its
// predecessors and perform TRE there. Look for predecessors that end