[llvm] r190258 - Using popcount should check the popcount feature flag not the SSE41 feature flag.

Craig Topper craig.topper at gmail.com
Sat Sep 7 17:47:31 PDT 2013


Author: ctopper
Date: Sat Sep  7 19:47:31 2013
New Revision: 190258

URL: http://llvm.org/viewvc/llvm-project?rev=190258&view=rev
Log:
Using popcount should check the popcount feature flag not the SSE41 feature flag.

Modified:
    llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp

Modified: llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp?rev=190258&r1=190257&r2=190258&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp Sat Sep  7 19:47:31 2013
@@ -127,8 +127,8 @@ X86TTI::PopcntSupportKind X86TTI::getPop
   assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");
   // TODO: Currently the __builtin_popcount() implementation using SSE3
   //   instructions is inefficient. Once the problem is fixed, we should
-  //   call ST->hasSSE3() instead of ST->hasSSE4().
-  return ST->hasSSE41() ? PSK_FastHardware : PSK_Software;
+  //   call ST->hasSSE3() instead of ST->hasPOPCNT().
+  return ST->hasPOPCNT() ? PSK_FastHardware : PSK_Software;
 }
 
 unsigned X86TTI::getNumberOfRegisters(bool Vector) const {





More information about the llvm-commits mailing list