[llvm] 6052eac - [ARM] Properly fix -Wsign-compare after D141791
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 16 23:57:51 PST 2023
Author: Fangrui Song
Date: 2023-01-16T23:57:44-08:00
New Revision: 6052eac2a8c9895cc0f398b1690d15237cd5aa6d
URL: https://github.com/llvm/llvm-project/commit/6052eac2a8c9895cc0f398b1690d15237cd5aa6d
DIFF: https://github.com/llvm/llvm-project/commit/6052eac2a8c9895cc0f398b1690d15237cd5aa6d.diff
LOG: [ARM] Properly fix -Wsign-compare after D141791
Added:
Modified:
llvm/lib/Target/ARM/ARMISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 7821b632c3eba..5d45a8e344415 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -7526,10 +7526,10 @@ static bool isTruncMask(ArrayRef<int> M, EVT VT, bool Top, bool SingleSource) {
// Top && !SingleSource: <1, 3, 5, 7, 9, 11, 13, 15>
int Ofs = Top ? 1 : 0;
int Upper = SingleSource ? 0 : NumElts;
- for (unsigned i = 0, e = NumElts / 2; i != e; ++i) {
- if (M[i] >= 0 && M[i] != (int)((i * 2) + Ofs))
+ for (int i = 0, e = NumElts / 2; i != e; ++i) {
+ if (M[i] >= 0 && M[i] != (i * 2) + Ofs)
return false;
- if (M[i + e] >= 0 && M[i + e] != (int)((i * 2) + Ofs + Upper))
+ if (M[i + e] >= 0 && M[i + e] != (i * 2) + Ofs + Upper)
return false;
}
return true;
More information about the llvm-commits
mailing list