diff options
| author | Duncan Sands <baldrick@free.fr> | 2008-07-10 15:30:54 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2008-07-10 15:30:54 +0000 |
| commit | 303524be58e3b5c159d7ba0641ef5d08e150580c (patch) | |
| tree | e4cf3271d4d63f4087ace72e4edeb33230d63a91 /llvm/lib/CodeGen | |
| parent | e78352a1251119f91549d90d7ccf43848ac4f2d8 (diff) | |
| download | bcm5719-llvm-303524be58e3b5c159d7ba0641ef5d08e150580c.tar.gz bcm5719-llvm-303524be58e3b5c159d7ba0641ef5d08e150580c.zip | |
Fix a FIXME: use an apint in CTTZ legalization.
llvm-svn: 53406
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index 6c8f546be85..f633159a3db 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -363,9 +363,9 @@ SDOperand DAGTypeLegalizer::PromoteIntRes_CTTZ(SDNode *N) { // The count is the same in the promoted type except if the original // value was zero. This can be handled by setting the bit just off // the top of the original type. - Op = DAG.getNode(ISD::OR, NVT, Op, - // FIXME: Do this using an APINT constant. - DAG.getConstant(1UL << OVT.getSizeInBits(), NVT)); + APInt TopBit(NVT.getSizeInBits(), 0); + TopBit.set(OVT.getSizeInBits()); + Op = DAG.getNode(ISD::OR, NVT, Op, DAG.getConstant(TopBit, NVT)); return DAG.getNode(ISD::CTTZ, NVT, Op); } |

