[llvm] b85152f - [SLP][NFC]Use `isa_and_nonnull` and fix comment, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 06:50:15 PST 2021


Author: Alexey Bataev
Date: 2021-11-15T06:49:33-08:00
New Revision: b85152f8b1c63a55fe629a14225c4e035903dd35

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

LOG: [SLP][NFC]Use `isa_and_nonnull` and fix comment, NFC.

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 a077b2513915..63ceda6d89a8 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5287,7 +5287,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
 
     // If found user is an insertelement, do not calculate extract cost but try
     // to detect it as a final shuffled/identity match.
-    if (EU.User && isa<InsertElementInst>(EU.User)) {
+    if (isa_and_nonnull<InsertElementInst>(EU.User)) {
       if (auto *FTy = dyn_cast<FixedVectorType>(EU.User->getType())) {
         Optional<int> InsertIdx = getInsertIndex(EU.User, 0);
         if (!InsertIdx || *InsertIdx == UndefMaskElem)
@@ -5299,8 +5299,8 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
             return false;
           auto *IE1 = cast<InsertElementInst>(VU);
           auto *IE2 = cast<InsertElementInst>(V);
-          // Go though of insertelement instructions trying to find either VU as
-          // the original vector for IE2 or V as the original vector for IE1.
+          // Go through of insertelement instructions trying to find either VU
+          // as the original vector for IE2 or V as the original vector for IE1.
           do {
             if (IE1 == VU || IE2 == V)
               return true;


        


More information about the llvm-commits mailing list