X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FSelectionDAG%2FLegalizeIntegerTypes.cpp;h=d4be998be5ed32d4d5d0db868549680059da085a;hb=ee4c619b3b28a42078fc8033e5dccd42fc6edd42;hp=6cbd50df5a516a585b3f297aee0a66c60cb75b5b;hpb=29a2822f287275a0d4df49f98104409d8f97c5df;p=oota-llvm.git diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index 6cbd50df5a5..d4be998be5e 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -572,7 +572,7 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) { if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType()) == TargetLowering::Custom) - Res = TLI.LowerOperation(SDValue(N, OpNo), DAG); + Res = TLI.LowerOperation(SDValue(N, 0), DAG); if (Res.getNode() == 0) { switch (N->getOpcode()) { @@ -811,10 +811,16 @@ SDValue DAGTypeLegalizer::PromoteIntOp_SELECT(SDNode *N, unsigned OpNo) { SDValue Cond = GetPromotedInteger(N->getOperand(0)); // Promote all the way up to SVT, the canonical SetCC type. - MVT SVT = TLI.getSetCCResultType(Cond); + // FIXME: Not clear what value to pass to getSetCCResultType. + // [This only matters for CellSPU since all other targets + // ignore the argument.] We used to pass Cond, resulting in + // SVT = MVT::i8, but CellSPU has no select patterns for i8, + // causing an abort later. Passing the result type works + // around the problem. + MVT SVT = TLI.getSetCCResultType(N->getOperand(1)); assert(isTypeLegal(SVT) && "Illegal SetCC type!"); assert(Cond.getValueSizeInBits() <= SVT.getSizeInBits() && - "Integer type overpromoted?"); + "Unexpected SetCC type!"); // Make sure the extra bits conform to getSetCCResultContents. There are // two sets of extra bits: those in Cond, which come from type promotion, @@ -1850,7 +1856,7 @@ bool DAGTypeLegalizer::ExpandIntegerOperand(SDNode *N, unsigned OpNo) { if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType()) == TargetLowering::Custom) - Res = TLI.LowerOperation(SDValue(N, OpNo), DAG); + Res = TLI.LowerOperation(SDValue(N, 0), DAG); if (Res.getNode() == 0) { switch (N->getOpcode()) {