diff options
Diffstat (limited to 'llvm/lib/CodeGen/ShrinkWrap.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ShrinkWrap.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp index 85dd4f59fa13..ce43fb1fbd4b 100644 --- a/llvm/lib/CodeGen/ShrinkWrap.cpp +++ b/llvm/lib/CodeGen/ShrinkWrap.cpp @@ -494,17 +494,15 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) { "EH Funclets are not supported yet.", MBB.front().getDebugLoc(), &MBB); - if (MBB.isEHPad()) { - // Push the prologue and epilogue outside of - // the region that may throw by making sure - // that all the landing pads are at least at the - // boundary of the save and restore points. - // The problem with exceptions is that the throw - // is not properly modeled and in particular, a - // basic block can jump out from the middle. + if (MBB.isEHPad() || MBB.isInlineAsmBrIndirectTarget()) { + // Push the prologue and epilogue outside of the region that may throw (or + // jump out via inlineasm_br), by making sure that all the landing pads + // are at least at the boundary of the save and restore points. The + // problem is that a basic block can jump out from the middle in these + // cases, which we do not handle. updateSaveRestorePoints(MBB, RS.get()); if (!ArePointsInteresting()) { - LLVM_DEBUG(dbgs() << "EHPad prevents shrink-wrapping\n"); + LLVM_DEBUG(dbgs() << "EHPad/inlineasm_br prevents shrink-wrapping\n"); return false; } continue; |