Restrict the definition of loop preheader to avoid EH blocks

Differential Revision: https://reviews.llvm.org/D34487

llvm-svn: 306070
This commit is contained in:
Andrew Kaylor
2017-06-22 23:27:16 +00:00
parent 08b20356c3
commit d49711996f
6 changed files with 73 additions and 2 deletions

View File

@@ -228,6 +228,12 @@ LLVM_DUMP_METHOD void MachineBasicBlock::dump() const {
}
#endif
bool MachineBasicBlock::isLegalToHoistInto() const {
if (isReturnBlock() || hasEHPadSuccessor())
return false;
return true;
}
StringRef MachineBasicBlock::getName() const {
if (const BasicBlock *LBB = getBasicBlock())
return LBB->getName();