This is an archive of the discontinued LLVM Phabricator instance.

AArch64/GlobalISel: Stop using legal s1 values
ClosedPublic

Authored by arsenm on Apr 12 2022, 9:53 AM.

Details

Reviewers
paquette
aemerson
Summary

As far as I can tell treating s1 values as legal makes no sense. There
are no allocatable 1-bit registers. SelectionDAG legalizes the usual
set of boolean operations to 32-bits, and this should do the
same. This avoids some special case handling in the selector of s1
values, and some extra code to look through truncates.

This makes some code worse at -O0, since nothing cleans up the and 1
the artifact combiner inserts. We could probably add some
non-essential combines or teach the artifact combiner to elide
intermediates betweeen boolean uses and defs.

Diff Detail

Event Timeline

arsenm created this revision.Apr 12 2022, 9:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2022, 9:53 AM
arsenm requested review of this revision.Apr 12 2022, 9:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2022, 9:53 AM
Herald added a subscriber: wdng. · View Herald Transcript
paquette accepted this revision.Apr 12 2022, 10:06 AM

I think this is a good cleanup. Even if we get some slightly worse codegen at -O0, it simplifies the selector + legalizer. LGTM

This revision is now accepted and ready to land.Apr 12 2022, 10:06 AM
arsenm updated this revision to Diff 422286.Apr 12 2022, 10:28 AM

Remove special case copy handling for s1 in selector too