Use DAG.getIntPtrConstant rather than DAG.getConstant
authorDuncan Sands <baldrick@free.fr>
Mon, 20 Oct 2008 16:14:43 +0000 (16:14 +0000)
committerDuncan Sands <baldrick@free.fr>
Mon, 20 Oct 2008 16:14:43 +0000 (16:14 +0000)
with TLI.getPointerTy for a small simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57837 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

index 466eedb0db69e0e7901a826d32899cb610b3e847..b0583cfa75ea676a324429cd7730bc818c3e7eed 100644 (file)
@@ -767,10 +767,8 @@ void DAGTypeLegalizer::ExpandFloatRes_XINT_TO_FP(SDNode *N, SDValue &Lo,
                                      MVT::ppcf128));
   Lo = DAG.getNode(ISD::SELECT_CC, VT, Src, DAG.getConstant(0, SrcVT), Lo, Hi,
                    DAG.getCondCode(ISD::SETLT));
-  Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Lo,
-                   DAG.getConstant(1, TLI.getPointerTy()));
-  Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Lo,
-                   DAG.getConstant(0, TLI.getPointerTy()));
+  Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Lo, DAG.getIntPtrConstant(1));
+  Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Lo, DAG.getIntPtrConstant(0));
 }
 
 
index 30e4ceaf53a73ebade3173ebb356c7ee5ff6ce42..32171a591a221d1185f00b273d052524edceb77b 100644 (file)
@@ -469,7 +469,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_VAARG(SDNode *N) {
   // of zero here!).
   unsigned Increment = VT.getSizeInBits() / 8;
   SDValue Tmp = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
-                              DAG.getConstant(Increment, TLI.getPointerTy()));
+                            DAG.getIntPtrConstant(Increment));
 
   // Store the incremented VAList to the pointer.
   Tmp = DAG.getStore(VAList.getValue(1), Tmp, Ptr, V, 0);
@@ -2073,7 +2073,7 @@ SDValue DAGTypeLegalizer::ExpandIntOp_UINT_TO_FP(SDNode *N) {
 
     // Build a 64 bit pair (0, FF) in the constant pool, with FF in the lo bits.
     SDValue FudgePtr = DAG.getConstantPool(ConstantInt::get(FF.zext(64)),
-                                             TLI.getPointerTy());
+                                           TLI.getPointerTy());
 
     // Get a pointer to FF if the sign bit was set, or to 0 otherwise.
     SDValue Zero = DAG.getIntPtrConstant(0);