From: Craig Topper Date: Wed, 22 Nov 2017 20:05:54 +0000 (+0000) Subject: [X86] Move the BITALG setOperationAction code into the hasBWI section to match what... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d93d311a7dd32d72148cad8def339dc45dc3955c;p=llvm [X86] Move the BITALG setOperationAction code into the hasBWI section to match what is done for VPOPCNTDQ in the AVX512F block. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318870 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 80519e5aa52..8e9658853dd 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -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);