mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 17:02:03 +00:00
MemCmpExpansion::getCompareLoadPairs - assert we find a comparison diff. NFCI.
Fix scan-build uninitialized warning and assert the final diff isn't null. llvm-svn: 361095
This commit is contained in:
parent
985042d225
commit
493b26d1e6
@ -323,7 +323,7 @@ Value *MemCmpExpansion::getCompareLoadPairs(unsigned BlockIndex,
|
||||
assert(LoadIndex < getNumLoads() &&
|
||||
"getCompareLoadPairs() called with no remaining loads");
|
||||
std::vector<Value *> XorList, OrList;
|
||||
Value *Diff;
|
||||
Value *Diff = nullptr;
|
||||
|
||||
const unsigned NumLoads =
|
||||
std::min(getNumLoads() - LoadIndex, NumLoadsPerBlockForZeroCmp);
|
||||
@ -400,6 +400,8 @@ Value *MemCmpExpansion::getCompareLoadPairs(unsigned BlockIndex,
|
||||
while (OrList.size() != 1) {
|
||||
OrList = pairWiseOr(OrList);
|
||||
}
|
||||
|
||||
assert(Diff && "Failed to find comparison diff");
|
||||
Cmp = Builder.CreateICmpNE(OrList[0], ConstantInt::get(Diff->getType(), 0));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user