[llvm-commits] [llvm] r48194 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
Dan Gohman
gohman at apple.com
Mon Mar 10 16:38:17 PDT 2008
Author: djg
Date: Mon Mar 10 18:38:17 2008
New Revision: 48194
URL: http://llvm.org/viewvc/llvm-project?rev=48194&view=rev
Log:
APInt-ify this.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=48194&r1=48193&r2=48194&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Mon Mar 10 18:38:17 2008
@@ -106,9 +106,10 @@
void DAGTypeLegalizer::ExpandResult_Constant(SDNode *N,
SDOperand &Lo, SDOperand &Hi) {
MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- uint64_t Cst = cast<ConstantSDNode>(N)->getValue();
- Lo = DAG.getConstant(Cst, NVT);
- Hi = DAG.getConstant(Cst >> MVT::getSizeInBits(NVT), NVT);
+ unsigned NBitWidth = MVT::getSizeInBits(NVT);
+ const APInt &Cst = cast<ConstantSDNode>(N)->getAPIntValue();
+ Lo = DAG.getConstant(APInt(Cst).trunc(NBitWidth), NVT);
+ Hi = DAG.getConstant(Cst.lshr(NBitWidth).trunc(NBitWidth), NVT);
}
void DAGTypeLegalizer::ExpandResult_BUILD_PAIR(SDNode *N,
More information about the llvm-commits
mailing list