llvm.org GIT mirror llvm / 0fc49e7
[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 Simon Pilgrim 1 year, 5 months ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
925925 StoreInst *S0 = cast(Chain[0]);
926926
927927 // If the vector has an int element, default to int for the whole store.
928 Type *StoreTy;
928 Type *StoreTy = nullptr;
929929 for (Instruction *I : Chain) {
930930 StoreTy = cast(I)->getValueOperand()->getType();
931931 if (StoreTy->isIntOrIntVectorTy())
937937 break;
938938 }
939939 }
940 assert(StoreTy && "Failed to find store type");
940941
941942 unsigned Sz = DL.getTypeSizeInBits(StoreTy);
942943 unsigned AS = S0->getPointerAddressSpace();