mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-18 01:17:46 +00:00
[LoadStoreVectorizer] vectorizeStoreChain - ensure we find a store type.
Properly initialize store type to null then ensure we find a real store type in the chain. Fixes scan-build null dereference warning and makes the code clearer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ca52ef5db
commit
0fc49e75a4
@ -926,7 +926,7 @@ bool Vectorizer::vectorizeStoreChain(
|
||||
StoreInst *S0 = cast<StoreInst>(Chain[0]);
|
||||
|
||||
// If the vector has an int element, default to int for the whole store.
|
||||
Type *StoreTy;
|
||||
Type *StoreTy = nullptr;
|
||||
for (Instruction *I : Chain) {
|
||||
StoreTy = cast<StoreInst>(I)->getValueOperand()->getType();
|
||||
if (StoreTy->isIntOrIntVectorTy())
|
||||
@ -938,6 +938,7 @@ bool Vectorizer::vectorizeStoreChain(
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(StoreTy && "Failed to find store type");
|
||||
|
||||
unsigned Sz = DL.getTypeSizeInBits(StoreTy);
|
||||
unsigned AS = S0->getPointerAddressSpace();
|
||||
|
Loading…
Reference in New Issue
Block a user