[llvm-commits] [llvm] r73451 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp

Dan Gohman gohman at apple.com
Mon Jun 15 17:20:26 PDT 2009


Author: djg
Date: Mon Jun 15 19:20:26 2009
New Revision: 73451

URL: http://llvm.org/viewvc/llvm-project?rev=73451&view=rev
Log:
Use Type::getScalarType.

Modified:
    llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=73451&r1=73450&r2=73451&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon Jun 15 19:20:26 2009
@@ -820,10 +820,8 @@
           StoreVal = Constant::getNullValue(EltTy);  // 0.0, null, 0, <0,0>
         } else {
           // If EltTy is a vector type, get the element type.
-          const Type *ValTy = EltTy;
-          if (const VectorType *VTy = dyn_cast<VectorType>(ValTy))
-            ValTy = VTy->getElementType();
-          
+          const Type *ValTy = EltTy->getScalarType();
+
           // Construct an integer with the right value.
           unsigned EltSize = TD->getTypeSizeInBits(ValTy);
           APInt OneVal(EltSize, CI->getZExtValue());





More information about the llvm-commits mailing list