[PATCH] D151878: [GlobalIsel][X86] Update legalization of G_ADD/G_SUB

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 04:29:01 PDT 2023


RKSimon created this revision.
RKSimon added reviewers: tschuett, arsenm, foad, pengfei, craig.topper.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
RKSimon requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This is a RFC on replacing the legacy legalizers for G_ADD/G_SUB with an approach that should work for the full mixture of scalar/vector types we need to support for most opcodes.

Using a 'ActionAddSub' variable matches the approach that other targets already do to add feature specific conditions, what I'm not so happy about is the mess of min/max vector elements clamps - I'm not certain if the legalizer API has a better way we can do this?

If we can decide on a suitable pattern we can reuse it for the other op types, but G_ADD/G_SUB are the only ones that have decent legalizer test coverage at this stage.

I've also refactored the G_CTPOP/G_LZCNT entries to match for reference (I'll commit these separately).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151878

Files:
  llvm/lib/Target/X86/X86LegalizerInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151878.527358.patch
Type: text/x-patch
Size: 7377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230601/9b71e547/attachment.bin>


More information about the llvm-commits mailing list