diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-23 00:34:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-23 00:34:11 +0000 |
commit | fc74abfba5128544a750fce22fdf13eb0403e3ce (patch) | |
tree | 36ed972103bbbb170370e4e6688787ed5f1f9ac8 /lib/Transforms/Scalar/SCCP.cpp | |
parent | 5e6ebaf4d1d3043d3428b65ee8054c71c24af930 (diff) | |
download | external_llvm-fc74abfba5128544a750fce22fdf13eb0403e3ce.zip external_llvm-fc74abfba5128544a750fce22fdf13eb0403e3ce.tar.gz external_llvm-fc74abfba5128544a750fce22fdf13eb0403e3ce.tar.bz2 |
Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.
The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index ff88137..d52cef6 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -384,7 +384,6 @@ private: void visitTerminatorInst(TerminatorInst &TI); void visitCastInst(CastInst &I); - void visitGetResultInst(GetResultInst &GRI); void visitSelectInst(SelectInst &I); void visitBinaryOperator(Instruction &I); void visitCmpInst(CmpInst &I); @@ -669,41 +668,6 @@ void SCCPSolver::visitCastInst(CastInst &I) { VState.getConstant(), I.getType())); } -void SCCPSolver::visitGetResultInst(GetResultInst &GRI) { - Value *Aggr = GRI.getOperand(0); - - // If the operand to the getresult is an undef, the result is undef. - if (isa<UndefValue>(Aggr)) - return; - - Function *F; - if (CallInst *CI = dyn_cast<CallInst>(Aggr)) - F = CI->getCalledFunction(); - else - F = cast<InvokeInst>(Aggr)->getCalledFunction(); - - // TODO: If IPSCCP resolves the callee of this function, we could propagate a - // result back! - if (F == 0 || TrackedMultipleRetVals.empty()) { - markOverdefined(&GRI); - return; - } - - // See if we are tracking the result of the callee. - std::map<std::pair<Function*, unsigned>, LatticeVal>::iterator - It = TrackedMultipleRetVals.find(std::make_pair(F, GRI.getIndex())); - - // If not tracking this function (for example, it is a declaration) just move - // to overdefined. - if (It == TrackedMultipleRetVals.end()) { - markOverdefined(&GRI); - return; - } - - // Otherwise, the value will be merged in here as a result of CallSite - // handling. -} - void SCCPSolver::visitExtractValueInst(ExtractValueInst &EVI) { Value *Aggr = EVI.getAggregateOperand(); @@ -1267,11 +1231,6 @@ CallOverdefined: // currently handled conservatively. for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { - if (GetResultInst *GRI = dyn_cast<GetResultInst>(*UI)) { - mergeInValue(GRI, - TrackedMultipleRetVals[std::make_pair(F, GRI->getIndex())]); - continue; - } if (ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(*UI)) { if (EVI->getNumIndices() == 1) { mergeInValue(EVI, |