diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-09-29 17:44:20 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-09-29 17:44:20 +0000 |
| commit | a554c9470b9bb75078ad1f332b7b9139a3c93acb (patch) | |
| tree | 113da9a39bed016fd9ac26a14265f211640a35dd /llvm/lib | |
| parent | 02d3ba3db8325b73da8e4501b43d960c79066448 (diff) | |
| download | bcm5719-llvm-a554c9470b9bb75078ad1f332b7b9139a3c93acb.tar.gz bcm5719-llvm-a554c9470b9bb75078ad1f332b7b9139a3c93acb.zip | |
Insert stores after phi nodes in the normal dest. This fixes
LowerInvoke/2005-08-03-InvokeWithPHI.ll
llvm-svn: 23525
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LowerInvoke.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp index d74633b82b8..2b0e16c17ba 100644 --- a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp @@ -259,8 +259,11 @@ void LowerInvoke::rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo, // Insert a store of the invoke num before the invoke and store zero into the // location afterward. new StoreInst(InvokeNoC, InvokeNum, true, II); // volatile - new StoreInst(Constant::getNullValue(Type::UIntTy), InvokeNum, false, - II->getNormalDest()->begin()); // nonvolatile. + + BasicBlock::iterator NI = II->getNormalDest()->begin(); + while (isa<PHINode>(NI)) ++NI; + // nonvolatile. + new StoreInst(Constant::getNullValue(Type::UIntTy), InvokeNum, false, NI); // Add a switch case to our unwind block. CatchSwitch->addCase(InvokeNoC, II->getUnwindDest()); |

