[Vectorize] Fix "unused variable" warnings
authorKazu Hirata <kazu@google.com>
Sat, 11 Sep 2021 19:06:42 +0000 (12:06 -0700)
committerKazu Hirata <kazu@google.com>
Sat, 11 Sep 2021 19:06:43 +0000 (12:06 -0700)
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

index 2808cef..1a511ef 100644 (file)
@@ -5329,9 +5329,7 @@ bool LoopVectorizationCostModel::interleavedAccessCanBeWidened(
 bool LoopVectorizationCostModel::memoryInstructionCanBeWidened(
     Instruction *I, ElementCount VF) {
   // Get and ensure we have a valid memory instruction.
-  LoadInst *LI = dyn_cast<LoadInst>(I);
-  StoreInst *SI = dyn_cast<StoreInst>(I);
-  assert((LI || SI) && "Invalid memory instruction");
+  assert((isa<LoadInst, StoreInst>(I)) && "Invalid memory instruction");
 
   auto *Ptr = getLoadStorePointerOperand(I);
   auto *ScalarTy = getLoadStoreType(I);