[PATCH] D111507: [X86] Enable promotion of i16 popcnt (PR52056)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 09:36:56 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:434
     setOperationPromotedToType(ISD::CTPOP, MVT::i8, MVT::i32);
+    setOperationPromotedToType(ISD::CTPOP, MVT::i16, MVT::i32);
   } else {
----------------
xbolva00 wrote:
> RKSimon wrote:
> > xbolva00 wrote:
> > > RKSimon wrote:
> > > > Please add a comment explaining why we don't use popcntw
> > > So something like for both i8/i16
> > > 
> > > "The 32-bit version is shorter to encode and the zext we emit for the promotion is likely going to be a 32-bit zero extend anyway." ?
> > Shouldn't it only refer to i16?
> > 
> > "The 32-bit version is shorter to encode than popcntw, ..."
> Yeah right :)
popcntw also has a false dependency on the dest that popcntl hasn't had since Cannon Lake.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111507/new/

https://reviews.llvm.org/D111507



More information about the llvm-commits mailing list