[llvm-commits] [llvm] r53406 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
Duncan Sands
baldrick at free.fr
Thu Jul 10 08:30:54 PDT 2008
Author: baldrick
Date: Thu Jul 10 10:30:54 2008
New Revision: 53406
URL: http://llvm.org/viewvc/llvm-project?rev=53406&view=rev
Log:
Fix a FIXME: use an apint in CTTZ legalization.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53406&r1=53405&r2=53406&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Thu Jul 10 10:30:54 2008
@@ -363,9 +363,9 @@
// 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);
}
More information about the llvm-commits
mailing list