Switch to using Simplified ConstantFP::get API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49977 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 0e27c00..3a4dc23 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -4368,14 +4368,13 @@
   MVT::ValueType EltVT = VT;
   if (MVT::isVector(VT))
     EltVT = MVT::getVectorElementType(VT);
-  const Type *OpNTy =  MVT::getTypeForValueType(EltVT);
   std::vector<Constant*> CV;
   if (EltVT == MVT::f64) {
-    Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(64, ~(1ULL << 63))));
+    Constant *C = ConstantFP::get(APFloat(APInt(64, ~(1ULL << 63))));
     CV.push_back(C);
     CV.push_back(C);
   } else {
-    Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(32, ~(1U << 31))));
+    Constant *C = ConstantFP::get(APFloat(APInt(32, ~(1U << 31))));
     CV.push_back(C);
     CV.push_back(C);
     CV.push_back(C);
@@ -4397,14 +4396,13 @@
     EltVT = MVT::getVectorElementType(VT);
     EltNum = MVT::getVectorNumElements(VT);
   }
-  const Type *OpNTy =  MVT::getTypeForValueType(EltVT);
   std::vector<Constant*> CV;
   if (EltVT == MVT::f64) {
-    Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(64, 1ULL << 63)));
+    Constant *C = ConstantFP::get(APFloat(APInt(64, 1ULL << 63)));
     CV.push_back(C);
     CV.push_back(C);
   } else {
-    Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(32, 1U << 31)));
+    Constant *C = ConstantFP::get(APFloat(APInt(32, 1U << 31)));
     CV.push_back(C);
     CV.push_back(C);
     CV.push_back(C);
@@ -4430,19 +4428,16 @@
   SDOperand Op1 = Op.getOperand(1);
   MVT::ValueType VT = Op.getValueType();
   MVT::ValueType SrcVT = Op1.getValueType();
-  const Type *SrcTy =  MVT::getTypeForValueType(SrcVT);
 
   // If second operand is smaller, extend it first.
   if (MVT::getSizeInBits(SrcVT) < MVT::getSizeInBits(VT)) {
     Op1 = DAG.getNode(ISD::FP_EXTEND, VT, Op1);
     SrcVT = VT;
-    SrcTy = MVT::getTypeForValueType(SrcVT);
   }
   // And if it is bigger, shrink it first.
   if (MVT::getSizeInBits(SrcVT) > MVT::getSizeInBits(VT)) {
     Op1 = DAG.getNode(ISD::FP_ROUND, VT, Op1, DAG.getIntPtrConstant(1));
     SrcVT = VT;
-    SrcTy = MVT::getTypeForValueType(SrcVT);
   }
 
   // At this point the operands and the result should have the same
@@ -4451,13 +4446,13 @@
   // First get the sign bit of second operand.
   std::vector<Constant*> CV;
   if (SrcVT == MVT::f64) {
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, 1ULL << 63))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(64, 1ULL << 63))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(64, 0))));
   } else {
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 1U << 31))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 1U << 31))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
   }
   Constant *C = ConstantVector::get(CV);
   SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
@@ -4480,13 +4475,13 @@
   // Clear first operand sign bit.
   CV.clear();
   if (VT == MVT::f64) {
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, ~(1ULL << 63)))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(64, ~(1ULL << 63)))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(64, 0))));
   } else {
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, ~(1U << 31)))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0))));
-    CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, ~(1U << 31)))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
+    CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
   }
   C = ConstantVector::get(CV);
   CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);