OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1e599c
)
MemCmpExpansion::getCompareLoadPairs - assert we find a comparison diff. NFCI.
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Sat, 18 May 2019 11:31:48 +0000
(11:31 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Sat, 18 May 2019 11:31:48 +0000
(11:31 +0000)
Fix scan-build uninitialized warning and assert the final diff isn't null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361095
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/ExpandMemCmp.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/ExpandMemCmp.cpp
b/lib/CodeGen/ExpandMemCmp.cpp
index
a3a9790
..
06c171a
100644
(file)
--- a/
lib/CodeGen/ExpandMemCmp.cpp
+++ b/
lib/CodeGen/ExpandMemCmp.cpp
@@
-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));
}