[X86] Move isInRange(ArrayRef<int>) inside assert to fix NDEBUG builds. NFC.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 12 Jul 2022 20:51:01 +0000 (21:51 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 12 Jul 2022 20:51:07 +0000 (21:51 +0100)
Fix unused static function warning introduced by D129207

llvm/lib/Target/X86/X86ISelLowering.cpp

index 6dc823f7b5e0e5fc88d9e8169d9da353e24746db..12af6087cb47be98836074610c632310d5fde73d 100644 (file)
@@ -5993,11 +5993,6 @@ static bool isInRange(int Val, int Low, int Hi) {
   return (Val >= Low && Val < Hi);
 }
 
-/// Return true if every val in Mask falls within the specified range (L, H].
-static bool isInRange(ArrayRef<int> Mask, int Low, int Hi) {
-  return llvm::all_of(Mask, [Low, Hi](int M) { return isInRange(M, Low, Hi); });
-}
-
 /// Return true if the value of any element in Mask falls within the specified
 /// range (L, H].
 static bool isAnyInRange(ArrayRef<int> Mask, int Low, int Hi) {
@@ -11814,7 +11809,8 @@ static bool isTargetShuffleEquivalent(MVT VT, ArrayRef<int> Mask,
   int Size = Mask.size();
   if (Size != (int)ExpectedMask.size())
     return false;
-  assert(isInRange(ExpectedMask, 0, 2 * Size) &&
+  assert(llvm::all_of(ExpectedMask,
+                      [Size](int M) { return isInRange(M, 0, 2 * Size); }) &&
          "Illegal target shuffle mask");
 
   // Check for out-of-range target shuffle mask indices.