From 96ef0c1103607e973532e166dae8311f5abb139e Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 23 Oct 2016 15:09:44 +0000 Subject: [PATCH] Use APInt::isAllOnesValue instead of popcnt. NFCI. More obvious implementation and faster too. llvm-svn: 284937 --- llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp index 2949816..1111552 100644 --- a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp +++ b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp @@ -82,7 +82,7 @@ static bool extractConstantMask(const Constant *C, unsigned MaskEltSizeInBits, // Only treat the element as UNDEF if all bits are UNDEF, otherwise // treat it as zero. - if (EltUndef.countPopulation() == MaskEltSizeInBits) { + if (EltUndef.isAllOnesValue()) { UndefElts[i] = true; RawMask[i] = 0; continue; -- 2.7.4