From d49711996f94cc73908d03d51938ffaaa40c3da9 Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Thu, 22 Jun 2017 23:27:16 +0000 Subject: Restrict the definition of loop preheader to avoid EH blocks Differential Revision: https://reviews.llvm.org/D34487 llvm-svn: 306070 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 590acc0..81597af 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -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(); -- cgit v1.1