diff options
| author | Bill Wendling <isanbard@gmail.com> | 2011-09-03 01:38:17 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2011-09-03 01:38:17 +0000 |
| commit | 7c1d6358a2f2eac2a5e73580fe63cf3c879d9273 (patch) | |
| tree | ffc5627129e2d01c22d2dc2b97849507de92263b | |
| parent | 599deef3794655b276cd2c4047c6bee2abac01bb (diff) | |
| download | bcm5719-llvm-7c1d6358a2f2eac2a5e73580fe63cf3c879d9273.tar.gz bcm5719-llvm-7c1d6358a2f2eac2a5e73580fe63cf3c879d9273.zip | |
Don't reload the values that are already there. The llvm.eh.resume uses the same
values that the resume instruction uses.
PR10850
llvm-svn: 139076
| -rw-r--r-- | llvm/lib/VMCore/AutoUpgrade.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/VMCore/AutoUpgrade.cpp b/llvm/lib/VMCore/AutoUpgrade.cpp index dc66ad7c47c..a7f5888ea5d 100644 --- a/llvm/lib/VMCore/AutoUpgrade.cpp +++ b/llvm/lib/VMCore/AutoUpgrade.cpp @@ -510,18 +510,15 @@ void llvm::UpgradeExceptionHandling(Module *M) { while (!EHResume->use_empty()) { CallInst *Resume = cast<CallInst>(EHResume->use_back()); BasicBlock *BB = Resume->getParent(); - Function *Fn = BB->getParent(); - std::pair<Value*, Value*> &ExnSel = FnToLPadSlotMap[Fn]; + IRBuilder<> Builder(Context); Builder.SetInsertPoint(BB, Resume); - Value *Exn = Builder.CreateLoad(ExnSel.first, "exn"); - Value *Sel = Builder.CreateLoad(ExnSel.second, "sel"); - Value *LPadVal = Builder.CreateInsertValue(UndefValue::get(LPadSlotTy), - Exn, 0, "lpad.val"); - LPadVal = Builder.CreateInsertValue(LPadVal, Sel, 1, "lpad.val"); + Resume->getArgOperand(0), 0, "lpad.val"); + LPadVal = Builder.CreateInsertValue(LPadVal, Resume->getArgOperand(1), + 1, "lpad.val"); Builder.CreateResume(LPadVal); // Remove all instructions after the 'resume.' |

