[SLPVectorizer] Use getAPInt() for comparison. NFCI.

Technically integers can assert on getZExtValue() if beyond i64 range, and a fuzzer usually find this.....
This commit is contained in:
Simon Pilgrim 2019-10-30 16:15:56 +00:00
parent 0c9af5a142
commit d809bfbcad

View File

@ -2449,7 +2449,7 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
dyn_cast<SCEVConstant>(SE->getMinusSCEV(ScevN, Scev0));
uint64_t Size = DL->getTypeAllocSize(ScalarTy);
// Check that the sorted loads are consecutive.
if (Diff && Diff->getAPInt().getZExtValue() == (VL.size() - 1) * Size) {
if (Diff && Diff->getAPInt() == (VL.size() - 1) * Size) {
if (CurrentOrder.empty()) {
// Original loads are consecutive and does not require reordering.
++NumOpsWantToKeepOriginalOrder;