Fix the result type of SELECT nodes lowered from Select instructions with

aggregate return values. This fixes PR5754.

llvm-svn: 91145
This commit is contained in:
Dan Gohman 2009-12-11 19:50:50 +00:00
parent fc51282cbe
commit 6d306bb32b
2 changed files with 16 additions and 1 deletions

View File

@ -2108,7 +2108,7 @@ void SelectionDAGBuilder::visitSelect(User &I) {
for (unsigned i = 0; i != NumValues; ++i)
Values[i] = DAG.getNode(ISD::SELECT, getCurDebugLoc(),
TrueVal.getValueType(), Cond,
TrueVal.getNode()->getValueType(i), Cond,
SDValue(TrueVal.getNode(), TrueVal.getResNo() + i),
SDValue(FalseVal.getNode(), FalseVal.getResNo() + i));

View File

@ -0,0 +1,15 @@
; RUN: llc < %s -march=x86-64 | FileCheck %s
; PR5754
; CHECK: cmovne %rdi, %rsi
; CHECK: movl (%rsi), %eax
%0 = type { i64, i32 }
define i32 @foo(%0* %p, %0* %q, i1 %r) nounwind {
%t0 = load %0* %p
%t1 = load %0* %q
%t4 = select i1 %r, %0 %t0, %0 %t1
%t5 = extractvalue %0 %t4, 1
ret i32 %t5
}