[llvm-commits] [llvm] r99335 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Dan Gohman gohman at apple.com
Tue Mar 23 15:15:32 PDT 2010


Author: djg
Date: Tue Mar 23 17:15:31 2010
New Revision: 99335

URL: http://llvm.org/viewvc/llvm-project?rev=99335&view=rev
Log:
Remove getTypeToExpandTo, since it isn't adding much value
beyond just calling getTypeToTransformTo.

Modified:
    llvm/trunk/include/llvm/Target/TargetLowering.h
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=99335&r1=99334&r2=99335&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Tue Mar 23 17:15:31 2010
@@ -268,27 +268,6 @@
     return MVT(MVT::Other); // Not reached
   }
 
-  /// getTypeToExpandTo - For types supported by the target, this is an
-  /// identity function.  For types that must be expanded (i.e. integer types
-  /// that are larger than the largest integer register or illegal floating
-  /// point types), this returns the largest legal type it will be expanded to.
-  EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const {
-    assert(!VT.isVector());
-    while (true) {
-      switch (getTypeAction(Context, VT)) {
-      case Legal:
-        return VT;
-      case Expand:
-        VT = getTypeToTransformTo(Context, VT);
-        break;
-      default:
-        assert(false && "Type is not legal nor is it to be expanded!");
-        return VT;
-      }
-    }
-    return VT;
-  }
-
   /// getVectorTypeBreakdown - Vector types are broken down into some number of
   /// legal first class types.  For example, EVT::v8f32 maps to 2 EVT::v4f32
   /// with Altivec or SSE1, or 8 promoted EVT::f64 values with the X86 FP stack.

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=99335&r1=99334&r2=99335&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Tue Mar 23 17:15:31 2010
@@ -1021,7 +1021,7 @@
       Hi = InL;
     } else if (Amt == 1 &&
                TLI.isOperationLegalOrCustom(ISD::ADDC,
-                                            TLI.getTypeToExpandTo(*DAG.getContext(), NVT))) {
+                                            TLI.getTypeToTransformTo(*DAG.getContext(), NVT))) {
       // Emit this X << 1 as X+X.
       SDVTList VTList = DAG.getVTList(NVT, MVT::Flag);
       SDValue LoOps[2] = { InL, InL };
@@ -1263,7 +1263,8 @@
   bool hasCarry =
     TLI.isOperationLegalOrCustom(N->getOpcode() == ISD::ADD ?
                                    ISD::ADDC : ISD::SUBC,
-                                 TLI.getTypeToExpandTo(*DAG.getContext(), NVT));
+                                 TLI.getTypeToTransformTo(*DAG.getContext(),
+                                                          NVT));
 
   if (hasCarry) {
     SDVTList VTList = DAG.getVTList(NVT, MVT::Flag);





More information about the llvm-commits mailing list