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 | 03dc093a2e63d20984c8fd67809fa762f1e31f1a (patch) | |
tree | f2e3c3061e429237efcea1d0193b145b6b1b0b18 /lib/CodeGen | |
parent | ae099d54428f4113f8a71c53314975fb8a8e8bbc (diff) |
Fix a FIXME: use an apint in CTTZ legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index 6c8f546be8..f633159a3d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/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); } |