Avoid an extra hash lookup when inserting a value into the widen map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166395 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2012-10-21 16:26:35 +00:00
parent ffe5008fd3
commit 5bb5a75b1e

View File

@ -398,13 +398,13 @@ bool LoopVectorizationLegality::isConsecutiveGep(Value *Ptr) {
Value *SingleBlockLoopVectorizer::getVectorValue(Value *V) {
assert(!V->getType()->isVectorTy() && "Can't widen a vector");
// If we saved a vectorized copy of V, use it.
ValueMap::iterator it = WidenMap.find(V);
if (it != WidenMap.end())
return it->second;
Value *&MapEntry = WidenMap[V];
if (MapEntry)
return MapEntry;
// Broadcast V and save the value for future uses.
Value *B = getBroadcastInstrs(V);
WidenMap[V] = B;
MapEntry = B;
return B;
}