llvm.org GIT mirror llvm / e11adfd
Merge from mainline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_24@58032 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
2 changed file(s) with 46 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
904904 SmallVector NewValues;
905905 NewValues.push_back(getControlRoot());
906906 for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
907 SDValue RetOp = getValue(I.getOperand(i));
908
909907 SmallVector ValueVTs;
910908 ComputeValueVTs(TLI, I.getOperand(i)->getType(), ValueVTs);
911 for (unsigned j = 0, f = ValueVTs.size(); j != f; ++j) {
909 unsigned NumValues = ValueVTs.size();
910 if (NumValues == 0) continue;
911
912 SDValue RetOp = getValue(I.getOperand(i));
913 for (unsigned j = 0, f = NumValues; j != f; ++j) {
912914 MVT VT = ValueVTs[j];
913915
914916 // FIXME: C calling convention requires the return type to be promoted to
21942196 }
21952197
21962198 void SelectionDAGLowering::visitSelect(User &I) {
2197 SDValue Cond = getValue(I.getOperand(0));
2198 SDValue TrueVal = getValue(I.getOperand(1));
2199 SDValue FalseVal = getValue(I.getOperand(2));
2200 setValue(&I, DAG.getNode(ISD::SELECT, TrueVal.getValueType(), Cond,
2201 TrueVal, FalseVal));
2199 SmallVector ValueVTs;
2200 ComputeValueVTs(TLI, I.getType(), ValueVTs);
2201 unsigned NumValues = ValueVTs.size();
2202 if (NumValues != 0) {
2203 SmallVector Values(NumValues);
2204 SDValue Cond = getValue(I.getOperand(0));
2205 SDValue TrueVal = getValue(I.getOperand(1));
2206 SDValue FalseVal = getValue(I.getOperand(2));
2207
2208 for (unsigned i = 0; i != NumValues; ++i)
2209 Values[i] = DAG.getNode(ISD::SELECT, TrueVal.getValueType(), Cond,
2210 SDValue(TrueVal.getNode(), TrueVal.getResNo() + i),
2211 SDValue(FalseVal.getNode(), FalseVal.getResNo() + i));
2212
2213 setValue(&I, DAG.getMergeValues(DAG.getVTList(&ValueVTs[0], NumValues),
2214 &Values[0], NumValues));
2215 }
22022216 }
22032217
22042218
0 ; RUN: llvm-as < %s | llc
1 ; PR2924
2
3 target datalayout =
4 "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
5 target triple = "i686-pc-linux-gnu"
6
7 define x86_stdcallcc { i32, i8* } @_D3std6string7toupperFAaZAa({ i32, i8* } %s) {
8 entry_std.string.toupper:
9 %tmp58 = load i32* null
10 %tmp59 = icmp eq i32 %tmp58, 0
11 %r.val = load { i32, i8* }* null, align 8
12 %condtmp.0 = select i1 %tmp59, { i32, i8* } undef, { i32, i8* } %r.val
13
14 ret { i32, i8* } %condtmp.0
15 }
16 define { } @empty({ } %s) {
17 entry_std.string.toupper:
18 %tmp58 = load i32* null
19 %tmp59 = icmp eq i32 %tmp58, 0
20 %r.val = load { }* null, align 8
21 %condtmp.0 = select i1 %tmp59, { } undef, { } %r.val
22 ret { } %condtmp.0
23 }