[PATCH] D150790: [GlobalIsel][X86] fix legalization of G_CTLZ and G_CTPOP

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 02:42:00 PDT 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86LegalizerInfo.cpp:305
+      .clampScalar(1, s16, s64);
+  }
+
----------------
tschuett wrote:
> RKSimon wrote:
> > RKSimon wrote:
> > > We need to split this - with just s64 legality here  and s16/s32 in setLegalizerInfo32bit above
> > > 
> > > And just widen sub 32 cases to s32
> > You should be able to just use legalIf() to support this properly
> I will try this in a followup diff. This diff is only about correctness.
OK - in which case, lets just use the same pattern as was done for {G_SHL, G_LSHR, G_ASHR} etc. - setLegalizerInfo32bit adds a second copy behind a !Subtarget.is64Bit() check


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150790



More information about the llvm-commits mailing list