diff options
author | Dan Gohman <gohman@apple.com> | 2012-03-13 18:01:37 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2012-03-13 18:01:37 +0000 |
commit | eab06fa3c9928345615cb261a9d70e86b262fd46 (patch) | |
tree | 76a7c718c4de96f1696b777456f8c51d859f99cb /llvm/lib/Transforms/IPO | |
parent | ece209afbcd204b436442cb3bacc42f09d7894bd (diff) | |
download | bcm5719-llvm-eab06fa3c9928345615cb261a9d70e86b262fd46.tar.gz bcm5719-llvm-eab06fa3c9928345615cb261a9d70e86b262fd46.zip |
Teach globalopt how to evaluate an invoke with a non-void return type.
llvm-svn: 152634
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index cd0dcbfe729..a32e5509545 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2561,11 +2561,6 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst, return false; delete ValueStack.pop_back_val(); InstResult = RetVal; - - if (InvokeInst *II = dyn_cast<InvokeInst>(CurInst)) { - NextBB = II->getNormalDest(); - return true; - } } } else if (isa<TerminatorInst>(CurInst)) { if (BranchInst *BI = dyn_cast<BranchInst>(CurInst)) { @@ -2610,6 +2605,12 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst, setVal(CurInst, InstResult); } + // If we just processed an invoke, we finished evaluating the block. + if (InvokeInst *II = dyn_cast<InvokeInst>(CurInst)) { + NextBB = II->getNormalDest(); + return true; + } + // Advance program counter. ++CurInst; } |