diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-16 00:20:26 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-16 00:20:26 +0000 |
commit | 44118f0e25c25fedda1ccdd6a72f072c0b5c96e7 (patch) | |
tree | 3d58ef3a5163d6afc40231f5519f36cb4e2bff8e | |
parent | 502106a713f0e58700065161b2017bb57a6846df (diff) |
Use Type::getScalarType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73451 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/ScalarReplAggregates.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 7143c7be48..d89790c292 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -820,10 +820,8 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *BCInst, 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()); |