Fix types in PromoteNode handling of CTPOP and friends.
llvm-svn: 75418
This commit is contained in:
parent
db953aacc7
commit
6b9f63cafa
|
@ -2983,10 +2983,10 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
|
||||||
// Zero extend the argument.
|
// Zero extend the argument.
|
||||||
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Node->getOperand(0));
|
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Node->getOperand(0));
|
||||||
// Perform the larger operation.
|
// Perform the larger operation.
|
||||||
Tmp1 = DAG.getNode(Node->getOpcode(), dl, Node->getValueType(0), Tmp1);
|
Tmp1 = DAG.getNode(Node->getOpcode(), dl, NVT, Tmp1);
|
||||||
if (Node->getOpcode() == ISD::CTTZ) {
|
if (Node->getOpcode() == ISD::CTTZ) {
|
||||||
//if Tmp1 == sizeinbits(NVT) then Tmp1 = sizeinbits(Old VT)
|
//if Tmp1 == sizeinbits(NVT) then Tmp1 = sizeinbits(Old VT)
|
||||||
Tmp2 = DAG.getSetCC(dl, TLI.getSetCCResultType(Tmp1.getValueType()),
|
Tmp2 = DAG.getSetCC(dl, TLI.getSetCCResultType(NVT),
|
||||||
Tmp1, DAG.getConstant(NVT.getSizeInBits(), NVT),
|
Tmp1, DAG.getConstant(NVT.getSizeInBits(), NVT),
|
||||||
ISD::SETEQ);
|
ISD::SETEQ);
|
||||||
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp2,
|
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp2,
|
||||||
|
@ -2997,7 +2997,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
|
||||||
DAG.getConstant(NVT.getSizeInBits() -
|
DAG.getConstant(NVT.getSizeInBits() -
|
||||||
OVT.getSizeInBits(), NVT));
|
OVT.getSizeInBits(), NVT));
|
||||||
}
|
}
|
||||||
Results.push_back(Tmp1);
|
Results.push_back(DAG.getNode(ISD::TRUNCATE, dl, OVT, Tmp1));
|
||||||
break;
|
break;
|
||||||
case ISD::BSWAP: {
|
case ISD::BSWAP: {
|
||||||
unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
|
unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
|
||||||
|
|
Loading…
Reference in New Issue