diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 15 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 2 |
3 files changed, 3 insertions, 21 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 74ece385581..b0d99a8e830 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -343,15 +343,7 @@ static void HandleInlinedEHPad(InvokeInst *II, BasicBlock *FirstNewBlock, continue; Instruction *Replacement = nullptr; - if (auto *TPI = dyn_cast<TerminatePadInst>(I)) { - if (TPI->unwindsToCaller()) { - SmallVector<Value *, 3> TerminatePadArgs; - for (Value *ArgOperand : TPI->arg_operands()) - TerminatePadArgs.push_back(ArgOperand); - Replacement = TerminatePadInst::Create(TPI->getParentPad(), UnwindDest, - TerminatePadArgs, TPI); - } - } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) { + if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) { if (CatchSwitch->unwindsToCaller()) { auto *NewCatchSwitch = CatchSwitchInst::Create( CatchSwitch->getParentPad(), UnwindDest, @@ -1441,10 +1433,7 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, if (!I->isEHPad()) continue; - if (auto *TPI = dyn_cast<TerminatePadInst>(I)) { - if (isa<ConstantTokenNone>(TPI->getParentPad())) - TPI->setParentPad(CallSiteEHPad); - } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) { + if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) { if (isa<ConstantTokenNone>(CatchSwitch->getParentPad())) CatchSwitch->setParentPad(CallSiteEHPad); } else { diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index cb17b603ae5..24f88179c90 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1338,13 +1338,6 @@ void llvm::removeUnwindEdge(BasicBlock *BB) { if (auto *CRI = dyn_cast<CleanupReturnInst>(TI)) { NewTI = CleanupReturnInst::Create(CRI->getCleanupPad(), nullptr, CRI); UnwindDest = CRI->getUnwindDest(); - } else if (auto *TPI = dyn_cast<TerminatePadInst>(TI)) { - SmallVector<Value *, 3> TerminatePadArgs; - for (Value *Operand : TPI->arg_operands()) - TerminatePadArgs.push_back(Operand); - NewTI = TerminatePadInst::Create(TPI->getParentPad(), nullptr, - TerminatePadArgs, TPI); - UnwindDest = TPI->getUnwindDest(); } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(TI)) { auto *NewCatchSwitch = CatchSwitchInst::Create( CatchSwitch->getParentPad(), nullptr, CatchSwitch->getNumHandlers(), diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 78088e72009..74b7c0602b3 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -3498,7 +3498,7 @@ bool SimplifyCFGOpt::SimplifyUnreachable(UnreachableInst *UI) { } } else if ((isa<InvokeInst>(TI) && cast<InvokeInst>(TI)->getUnwindDest() == BB) || - isa<TerminatePadInst>(TI) || isa<CatchSwitchInst>(TI)) { + isa<CatchSwitchInst>(TI)) { removeUnwindEdge(TI->getParent()); Changed = true; } else if (isa<CleanupReturnInst>(TI)) { |