[Mlir-commits] [mlir] 558ee58 - [mlir] Fix -Wunused-but-set-variable in -DLLVM_ENABLE_ASSERTIONS=off build. NFC

Fangrui Song llvmlistbot at llvm.org
Sun Jun 20 11:55:07 PDT 2021


Author: Fangrui Song
Date: 2021-06-20T11:55:00-07:00
New Revision: 558ee5843f9fca0a3349f9ead666d2281b6a1915

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

LOG: [mlir] Fix -Wunused-but-set-variable in -DLLVM_ENABLE_ASSERTIONS=off build. NFC

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/VectorTransforms.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
index 8aa4153e94815..baded89d9074b 100644
--- a/mlir/lib/Dialect/Vector/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
@@ -539,11 +539,8 @@ generateTransferOpSlices(Type shapedElementType, VectorType vectorType,
   //   'vector<2x1x2x4xf32>'. The memref rank is 3, and the effective
   //   vector rank is 4 - 2 = 2, and so 'indexOffset' = 3 - 2 = 1.
   //
-  unsigned vectorRank = vectorType.getRank();
-  if (auto sourceVectorElementType = shapedElementType.dyn_cast<VectorType>()) {
-    assert(vectorRank >= sourceVectorElementType.getRank());
-    vectorRank -= sourceVectorElementType.getRank();
-  }
+  if (auto sourceVectorElementType = shapedElementType.dyn_cast<VectorType>())
+    assert(vectorType.getRank() >= sourceVectorElementType.getRank());
   auto isBroadcast = [](AffineExpr expr) {
     if (auto constExpr = expr.dyn_cast<AffineConstantExpr>())
       return constExpr.getValue() == 0;


        


More information about the Mlir-commits mailing list