[llvm] r320170 - [x86] use hasAVX2() rather than hasInt256(); NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 10:35:51 PST 2017


Author: spatel
Date: Fri Dec  8 10:35:51 2017
New Revision: 320170

URL: http://llvm.org/viewvc/llvm-project?rev=320170&view=rev
Log:
[x86] use hasAVX2() rather than hasInt256(); NFC

These are aliases, but the thing we're checking here is that the target has
vpsllv*, not that the data type is 256-bit. Those instructions exist for
128-bit vectors too...but sadly, not for all element sizes.

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

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=320170&r1=320169&r2=320170&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Dec  8 10:35:51 2017
@@ -25356,9 +25356,9 @@ bool X86TargetLowering::isVectorShiftByS
   if (Bits == 8)
     return false;
 
-  // On AVX2 there are new vpsllv[dq] instructions (and other shifts), that make
-  // variable shifts just as cheap as scalar ones.
-  if (Subtarget.hasInt256() && (Bits == 32 || Bits == 64))
+  // AVX2 has vpsllv[dq] instructions (and other shifts) that make variable
+  // shifts just as cheap as scalar ones.
+  if (Subtarget.hasAVX2() && (Bits == 32 || Bits == 64))
     return false;
 
   // Otherwise, it's significantly cheaper to shift by a scalar amount than by a




More information about the llvm-commits mailing list