Refactor the getTypeLegalizationCost interface. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167422 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 0918f95..6b5466d 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -17530,8 +17530,7 @@
 X86VectorTargetTransformInfo::getArithmeticInstrCost(unsigned Opcode,
                                                      Type *Ty) const {
   // Legalize the type.
-  std::pair<unsigned, MVT> LT =
-  getTypeLegalizationCost(Ty->getContext(), TLI->getValueType(Ty));
+  std::pair<unsigned, MVT> LT = getTypeLegalizationCost(Ty);
 
   int ISD = InstructionOpcodeToISD(Opcode);
   assert(ISD && "Invalid opcode");
@@ -17569,8 +17568,7 @@
 
   if (Index != -1U) {
     // Legalize the type.
-    std::pair<unsigned, MVT> LT =
-    getTypeLegalizationCost(Val->getContext(), TLI->getValueType(Val));
+    std::pair<unsigned, MVT> LT = getTypeLegalizationCost(Val);
 
     // This type is legalized to a scalar type.
     if (!LT.second.isVector())
@@ -17592,8 +17590,7 @@
                                                           Type *ValTy,
                                                           Type *CondTy) const {
   // Legalize the type.
-  std::pair<unsigned, MVT> LT =
-  getTypeLegalizationCost(ValTy->getContext(), TLI->getValueType(ValTy));
+  std::pair<unsigned, MVT> LT = getTypeLegalizationCost(ValTy);
 
   MVT MTy = LT.second;