Add support to codegen for getresult instructions with undef operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2008-04-23 20:21:29 +00:00
parent 6829157f49
commit 3dc34f682d
2 changed files with 13 additions and 2 deletions

View File

@ -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()));
}
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc
define double @foo() {
%t = getresult {double, double} undef, 1
ret double %t
}