From 29474e9327b30f3f79a5ce3d4264cc23e1e6dcdb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 23 Jul 2008 00:34:11 +0000 Subject: 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 --- lib/Transforms/Scalar/SCCP.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'lib/Transforms/Scalar/SCCP.cpp') 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(Aggr)) - return; - - Function *F; - if (CallInst *CI = dyn_cast(Aggr)) - F = CI->getCalledFunction(); - else - F = cast(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, 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(*UI)) { - mergeInValue(GRI, - TrackedMultipleRetVals[std::make_pair(F, GRI->getIndex())]); - continue; - } if (ExtractValueInst *EVI = dyn_cast(*UI)) { if (EVI->getNumIndices() == 1) { mergeInValue(EVI, -- cgit v1.1