aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-04-20 21:48:34 +0000
committerCameron Zwarich <zwarich@apple.com>2011-04-20 21:48:34 +0000
commitc5c43b958cf2f251c836f94d4499adb6296f0611 (patch)
treeb98695db55ddd16aebde9bc094f132c614d954eb
parent5fc1282c1822d692ed1681cdc4c315950c6eb1d8 (diff)
downloadexternal_llvm-c5c43b958cf2f251c836f94d4499adb6296f0611.zip
external_llvm-c5c43b958cf2f251c836f94d4499adb6296f0611.tar.gz
external_llvm-c5c43b958cf2f251c836f94d4499adb6296f0611.tar.bz2
The bitcast case here is actually handled uniformly earlier in the function, so
delete it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129877 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 984f5c8..82bb645 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -914,18 +914,13 @@ ConvertScalar_InsertValue(Value *SV, Value *Old,
return Builder.CreateBitCast(Insert, AllocaType, "tmp");
}
- uint64_t EltSize = TD.getTypeAllocSizeInBits(VTy->getElementType());
-
// Must be an element insertion.
+ assert(SV->getType() == VTy->getElementType());
+ uint64_t EltSize = TD.getTypeAllocSizeInBits(VTy->getElementType());
unsigned Elt = Offset/EltSize;
-
- if (SV->getType() != VTy->getElementType())
- SV = Builder.CreateBitCast(SV, VTy->getElementType(), "tmp");
-
- SV = Builder.CreateInsertElement(Old, SV,
+ return Builder.CreateInsertElement(Old, SV,
ConstantInt::get(Type::getInt32Ty(SV->getContext()), Elt),
"tmp");
- return SV;
}
// If SV is a first-class aggregate value, insert each value recursively.