[llvm] c141d15 - [VectorCombine] Remove redundant checks (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 19 13:05:57 PST 2022


Author: Florian Hahn
Date: 2022-02-19T21:05:32Z
New Revision: c141d158e5d330c751966ed9814161eadcae086b

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

LOG: [VectorCombine] Remove redundant checks (NFC).

The removed conditions are already checked by the if above.

Fixes #53761.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 620d388199e0f..e938ca6803bfd 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -1019,12 +1019,8 @@ bool VectorCombine::scalarizeLoadExtract(Instruction &I) {
           return false;
         NumInstChecked++;
       }
-    }
-
-    if (!LastCheckedInst)
-      LastCheckedInst = UI;
-    else if (LastCheckedInst->comesBefore(UI))
       LastCheckedInst = UI;
+    }
 
     auto ScalarIdx = canScalarizeAccess(FixedVT, UI->getOperand(1), &I, AC, DT);
     if (!ScalarIdx.isSafe()) {


        


More information about the llvm-commits mailing list