From 7be2b85e1e3f39a7fcad87f045bf50e6898391a3 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 20 Feb 2015 06:28:38 +0000 Subject: [PATCH] Fix -Wunused-variable warning in non-asserts build, and optimize a little bit while I'm here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229970 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 90718e936af..ab02f14413c 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -8243,14 +8243,14 @@ static SDValue lowerV8I16VectorShuffle(SDValue Op, SDValue V1, SDValue V2, auto isV1 = [](int M) { return M >= 0 && M < 8; }; auto isV2 = [](int M) { return M >= 8; }; - int NumV1Inputs = std::count_if(Mask.begin(), Mask.end(), isV1); int NumV2Inputs = std::count_if(Mask.begin(), Mask.end(), isV2); if (NumV2Inputs == 0) return lowerV8I16SingleInputVectorShuffle(DL, V1, Mask, Subtarget, DAG); - assert(NumV1Inputs > 0 && "All single-input shuffles should be canonicalized " - "to be V1-input shuffles."); + assert(std::any_of(Mask.begin(), Mask.end(), isV1) && + "All single-input shuffles should be canonicalized to be V1-input " + "shuffles."); // Try to use shift instructions. if (SDValue Shift =