mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Avoid an extra hash lookup when inserting a value into the widen map.
llvm-svn: 166395
This commit is contained in:
parent
a477da32fc
commit
d04e66ae01
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user