G_BSWAP was reverted -> added to this diff.
check plan: ninja check-llvm-codegen-x86
Future work: G_SUB and G_ZEXT need some modernization.
Paths
| Differential D150677
[GlobalIsel][X86] Legalize G_CTPOP and G_CTLZ ClosedPublic Authored by tschuett on May 16 2023, 7:59 AM.
Details Summary G_BSWAP was reverted -> added to this diff. check plan: ninja check-llvm-codegen-x86 Future work: G_SUB and G_ZEXT need some modernization.
Diff Detail
Event Timeline
Comment Actions Now, he fails to legalise:
Comment Actions
Which approach? Not sure precisely what you are trying to achieve in the example. I assume you want s8 to promote both operands? The -debug log should show the legalization steps it's trying to take Comment Actions G_CTLZ is only legal for s16, s32, and s64. I was hoping that it will somehow legally widened to s16 ops. Comment Actions
Your legalize rules aren't constraining the result and source type to match though. They're expressing the constraints as though they are independently chosen This revision is now accepted and ready to land.May 16 2023, 12:18 PM Comment Actions Thanks. I am only looking for low hanging fruit and not to maximize coverage. X86 Gisel fails fast and loud. This revision was landed with ongoing or failed builds.May 16 2023, 1:14 PM Closed by commit rGef1f27d67c4d: [GlobalIsel][X86] Legalize G_CTPOP and G_CTLZ (authored by tschuett). · Explain Why This revision was automatically updated to reflect the committed changes. tschuett added a reverting change: rG3ae4265b48c5: Revert "[GlobalIsel][X86] Legalize G_CTPOP and G_CTLZ".May 16 2023, 1:34 PM
Revision Contents
Diff 522755 llvm/lib/Target/X86/X86LegalizerInfo.h
llvm/lib/Target/X86/X86LegalizerInfo.cpp
llvm/test/CodeGen/X86/GlobalISel/legalize-bswap.mir
llvm/test/CodeGen/X86/GlobalISel/legalize-constant.mir
llvm/test/CodeGen/X86/GlobalISel/legalize-ctpop.mir
llvm/test/CodeGen/X86/GlobalISel/legalize-leading-zeros.mir
|
These both have buggy type lists, and I'm surprised nothing is blowing up. These have 2 type parameters, the result may be different from the source