From 15884a222dbb3c24b0d7263dc427ace40ae463ad Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Fri, 8 Dec 2017 18:35:51 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320170 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 348ad379079..f31398c10a3 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -25356,9 +25356,9 @@ bool X86TargetLowering::isVectorShiftByScalarCheap(Type *Ty) const { 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 -- 2.11.0