From 6052eac2a8c9895cc0f398b1690d15237cd5aa6d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 16 Jan 2023 23:57:44 -0800 Subject: [PATCH] [ARM] Properly fix -Wsign-compare after D141791 --- llvm/lib/Target/ARM/ARMISelLowering.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 7821b63..5d45a8e 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -7526,10 +7526,10 @@ static bool isTruncMask(ArrayRef 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; -- 2.7.4