[llvm] 78739ff - [llvm][HashRecognize] Fix compiler warning on Arm 32-bit (#161821)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 3 07:58:16 PDT 2025
Author: David Spickett
Date: 2025-10-03T15:58:11+01:00
New Revision: 78739ff84a5986623684235e1f29e55b754a1594
URL: https://github.com/llvm/llvm-project/commit/78739ff84a5986623684235e1f29e55b754a1594
DIFF: https://github.com/llvm/llvm-project/commit/78739ff84a5986623684235e1f29e55b754a1594.diff
LOG: [llvm][HashRecognize] Fix compiler warning on Arm 32-bit (#161821)
```
/home/david.spickett/llvm-project/llvm/lib/Analysis/HashRecognize.cpp:100:54: warning: comparison of integers of different signs:
'typename iterator_traits<ilist_iterator_w_bits<node_options<Instruction, true, false, void, true, BasicBlock>, false, false>>::difference_type' (aka 'int') and 'size_type' (aka 'unsigned int') [-Wsign-compare]
100 | return std::distance(Latch->begin(), Latch->end()) != Visited.size();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
```
By using Latch->size() instead.
Added:
Modified:
llvm/lib/Analysis/HashRecognize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/HashRecognize.cpp b/llvm/lib/Analysis/HashRecognize.cpp
index 5d7ee1fe8eb12..4529123508a7c 100644
--- a/llvm/lib/Analysis/HashRecognize.cpp
+++ b/llvm/lib/Analysis/HashRecognize.cpp
@@ -97,7 +97,7 @@ static bool containsUnreachable(const Loop &L,
}
}
}
- return std::distance(Latch->begin(), Latch->end()) != Visited.size();
+ return Latch->size() != Visited.size();
}
/// A structure that can hold either a Simple Recurrence or a Conditional
More information about the llvm-commits
mailing list