[llvm-commits] [llvm] r50180 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/Generic/getresult-undef.ll
Dan Gohman
gohman at apple.com
Wed Apr 23 13:21:29 PDT 2008
Author: djg
Date: Wed Apr 23 15:21:29 2008
New Revision: 50180
URL: http://llvm.org/viewvc/llvm-project?rev=50180&view=rev
Log:
Add support to codegen for getresult instructions with undef operands.
Added:
llvm/trunk/test/CodeGen/Generic/getresult-undef.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=50180&r1=50179&r2=50180&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Apr 23 15:21:29 2008
@@ -3311,8 +3311,13 @@
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()));
+ }
}
Added: llvm/trunk/test/CodeGen/Generic/getresult-undef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/getresult-undef.ll?rev=50180&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/getresult-undef.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/getresult-undef.ll Wed Apr 23 15:21:29 2008
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc
+
+define double @foo() {
+ %t = getresult {double, double} undef, 1
+ ret double %t
+}
More information about the llvm-commits
mailing list