[llvm] d52f5ed - [SLPVectorizer] Use getAPInt() for comparison. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 09:17:50 PDT 2019


Author: Simon Pilgrim
Date: 2019-10-30T16:16:55Z
New Revision: d52f5ed01a2a46a81555ee1b655c6b682c4dbd6c

URL: https://github.com/llvm/llvm-project/commit/d52f5ed01a2a46a81555ee1b655c6b682c4dbd6c
DIFF: https://github.com/llvm/llvm-project/commit/d52f5ed01a2a46a81555ee1b655c6b682c4dbd6c.diff

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

Technically integers can assert on getZExtValue() if beyond i64 range, and a fuzzer usually find this.....

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index c78d72a8695a..bdcd5bfb9815 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -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;


        


More information about the llvm-commits mailing list