[X86] Move the BITALG setOperationAction code into the hasBWI section to match what...
authorCraig Topper <craig.topper@intel.com>
Wed, 22 Nov 2017 20:05:54 +0000 (20:05 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 22 Nov 2017 20:05:54 +0000 (20:05 +0000)
llvm-svn: 318870

llvm/lib/Target/X86/X86ISelLowering.cpp

index 80519e5..8e96588 100644 (file)
@@ -1522,6 +1522,12 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     for (auto ExtType : {ISD::ZEXTLOAD, ISD::SEXTLOAD}) {
       setLoadExtAction(ExtType, MVT::v32i16, MVT::v32i8, Legal);
     }
+
+    if (Subtarget.hasBITALG()) {
+      for (auto VT : { MVT::v64i8, MVT::v32i16, MVT::v32i8,
+                       MVT::v16i16, MVT::v16i8, MVT::v8i16 })
+        setOperationAction(ISD::CTPOP, VT, Legal);
+    }
   }
 
   if (!Subtarget.useSoftFloat() && Subtarget.hasVLX()) {
@@ -1556,11 +1562,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     }
   }
 
-  if (Subtarget.hasBITALG())
-    for (auto VT : { MVT::v64i8, MVT::v32i16, MVT::v32i8,
-                     MVT::v16i16, MVT::v16i8, MVT::v8i16 })
-      setOperationAction(ISD::CTPOP, VT, Legal);
-
   // We want to custom lower some of our intrinsics.
   setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
   setOperationAction(ISD::INTRINSIC_W_CHAIN, MVT::Other, Custom);