aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-07-12 17:43:20 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-07-12 17:43:20 +0000
commitf90244488d1e1ac608a9272ecb1d5950902234c6 (patch)
tree7781c4dead2ccd8130e9f49450e331b840d89f06 /lib
parent6194a7dbc63d3d2eb6e7eaf610e3a2c1630b9fa6 (diff)
downloadexternal_llvm-f90244488d1e1ac608a9272ecb1d5950902234c6.zip
external_llvm-f90244488d1e1ac608a9272ecb1d5950902234c6.tar.gz
external_llvm-f90244488d1e1ac608a9272ecb1d5950902234c6.tar.bz2
Fix types in PromoteNode handling of CTPOP and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75418 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 5cd3182..315f043 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2983,10 +2983,10 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
// Zero extend the argument.
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Node->getOperand(0));
// 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 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),
ISD::SETEQ);
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp2,
@@ -2997,7 +2997,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
DAG.getConstant(NVT.getSizeInBits() -
OVT.getSizeInBits(), NVT));
}
- Results.push_back(Tmp1);
+ Results.push_back(DAG.getNode(ISD::TRUNCATE, dl, OVT, Tmp1));
break;
case ISD::BSWAP: {
unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();