This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Legalize 32-bit + narrow G_SMULO + G_UMULO
ClosedPublic

Authored by paquette on Aug 17 2021, 2:11 PM.

Details

Summary

SDAG lowers 32-bit and 64-bit G_SMULO + G_UMULO. We were missing the 32-bit case.

For other sizes, make the 0th type a power of 2 and clamp it to either 32 bits or 64 bits.

Right now, this will allow us to handle narrow types (e.g. s4, s24, etc.). The LegalizerHelper doesn't support narrowing G_SMULO or G_UMULO right now. I think we want clamping behaviour either way, so we might as well include it now to be explicit.

Diff Detail

Event Timeline

paquette created this revision.Aug 17 2021, 2:11 PM
paquette requested review of this revision.Aug 17 2021, 2:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 2:11 PM
aemerson added inline comments.Aug 17 2021, 5:09 PM
llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir
245–265

How about we move this to arm64-fallback.ll and keep the abort=1 in this file.

paquette updated this revision to Diff 367356.Aug 18 2021, 4:34 PM

Move test to arm64-fallback.ll + keep the abort.

aemerson accepted this revision.Aug 20 2021, 2:32 PM
This revision is now accepted and ready to land.Aug 20 2021, 2:32 PM