diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index c9b334fc22..7e7a2f4119 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -3311,8 +3311,13 @@ void SelectionDAGLowering::visitCall(CallInst &I) { void SelectionDAGLowering::visitGetResult(GetResultInst &I) { - SDOperand Call = getValue(I.getOperand(0)); - setValue(&I, SDOperand(Call.Val, I.getIndex())); + if (UndefValue *UV = dyn_cast<UndefValue>(I.getOperand(0))) { + SDOperand Undef = DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())); + setValue(&I, Undef); + } else { + SDOperand Call = getValue(I.getOperand(0)); + setValue(&I, SDOperand(Call.Val, I.getIndex())); + } } |