Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

NumElts is alreadyof type int.

Identified with readability-redundant-casting.

NumElts is alreadyof type int.

Identified with readability-redundant-casting.
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Nov 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 15, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

Changes

NumElts is alreadyof type int.

Identified with readability-redundant-casting.


Full diff: https://github.com/llvm/llvm-project/pull/168184.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/VectorUtils.cpp (+1-1)
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 977ed59e09243..530fa9518f40e 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -494,7 +494,7 @@ bool llvm::isMaskedSlidePair(ArrayRef<int> Mask, int NumElts,
   for (auto [i, M] : enumerate(Mask)) {
     if (M < 0)
       continue;
-    int Src = M >= (int)NumElts;
+    int Src = M >= NumElts;
     int Diff = (int)i - (M % NumElts);
     bool Match = false;
     for (int j = 0; j < 2; j++) {

@kazutakahirata kazutakahirata merged commit 268ea1a into llvm:main Nov 15, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251114_clang_tidy_readability-redundant-casting branch November 15, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants