diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-03-27 20:28:29 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-03-27 20:28:29 +0000 | 
| commit | d5f94c9574c73e8b9c450f95f9db5b85d8461a29 (patch) | |
| tree | fa0a47d41bca05960a53c3f5da2e795f82519ebe /llvm/lib | |
| parent | fa53b276d050401ad5c9313e03fe23e612343eb6 (diff) | |
| download | bcm5719-llvm-d5f94c9574c73e8b9c450f95f9db5b85d8461a29.tar.gz bcm5719-llvm-d5f94c9574c73e8b9c450f95f9db5b85d8461a29.zip | |
Fix legalization of intrinsics with chain and result values
llvm-svn: 27181
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 15 | 
1 files changed, 13 insertions, 2 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 81139dcde17..b0a48eef6d7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -564,8 +564,19 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {          TargetLowering::Custom) {        Tmp3 = TLI.LowerOperation(Result, DAG);        if (Tmp3.Val) Result = Tmp3; -    }       -    break; +    } + +    if (Result.Val->getNumValues() == 1) break; + +    // Must have return value and chain result. +    assert(Result.Val->getNumValues() == 2 && +           "Cannot return more than two values!"); + +    // Since loads produce two values, make sure to remember that we  +    // legalized both of them. +    AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0)); +    AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1)); +    return Result.getValue(Op.ResNo);    }        case ISD::LOCATION: | 

