This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Improve legalization for odd-sized G_ICMP/G_CONSTANT
ClosedPublic

Authored by paquette on Jul 28 2021, 1:13 PM.

Details

Summary

We were handing types like s88 like

  1. clamp to the range
  2. widen to the next power of 2

This isn't desirable because it causes an odd breakdown for types like s88. If we widen to the next power of 2 (s128) first, then we get a clean breakdown when we clamp back to s64.

Diff Detail

Event Timeline

paquette created this revision.Jul 28 2021, 1:13 PM
paquette requested review of this revision.Jul 28 2021, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 1:13 PM
paquette added inline comments.Jul 28 2021, 1:14 PM
llvm/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir
69

lol

paquette updated this revision to Diff 362513.Jul 28 2021, 1:19 PM

G_ICMP uses widenScalarOrEltToNextPow2, not widenScalarToNextPow2.

aemerson accepted this revision.Jul 28 2021, 3:15 PM

LGTM.

This revision is now accepted and ready to land.Jul 28 2021, 3:15 PM
This revision was landed with ongoing or failed builds.Jul 28 2021, 3:31 PM
This revision was automatically updated to reflect the committed changes.