[llvm] 66bfd1b - [X86] Move isInRange(ArrayRef<int>) inside assert to fix NDEBUG builds. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 12 13:51:16 PDT 2022
Author: Simon Pilgrim
Date: 2022-07-12T21:51:07+01:00
New Revision: 66bfd1ba8c3e4ca08ce91652b99ba248e6ec05ae
URL: https://github.com/llvm/llvm-project/commit/66bfd1ba8c3e4ca08ce91652b99ba248e6ec05ae
DIFF: https://github.com/llvm/llvm-project/commit/66bfd1ba8c3e4ca08ce91652b99ba248e6ec05ae.diff
LOG: [X86] Move isInRange(ArrayRef<int>) inside assert to fix NDEBUG builds. NFC.
Fix unused static function warning introduced by D129207
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6dc823f7b5e0e..12af6087cb47b 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -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.
More information about the llvm-commits
mailing list