This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Enable subreg liveness
ClosedPublic

Authored by dmgreen on Aug 6 2021, 6:25 AM.

Details

Summary

This enables subreg liveness in the arm backend when MVE is present, which allows the register allocator to detect when subregister are alive/dead, compared to only acting on full registers. This can helps produce better code on MVE with the way MQPR registers are made up of SPR registers, but is especially helpful for MQQPR and MQQQQPR registers, where there are very few "registers" available and being able to split them up into subregs can help produce much better code.

For MQQPR and MQQQQPR we currently spill them using VLDMDIA with d-subregs for each part. This doesn't pass verifier checks as the constituent parts can sometimes be undefined at point of use. So this patch also adds MQQPRLoad and MQQPRStore pseudo instructions that can take the entire register and be lowered later in the pipeline. They still end up as VLDMIA/VSTMIA instructions, but hold the original larger register. This has the added benefit that we can more easily return the correct value from isStoreToStackSlot, allowing the regallocator to potentially produce better code.

Diff Detail

Event Timeline

dmgreen created this revision.Aug 6 2021, 6:25 AM
dmgreen requested review of this revision.Aug 6 2021, 6:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2021, 6:25 AM
samtebbs accepted this revision.Aug 9 2021, 5:40 AM

Nice work

This revision is now accepted and ready to land.Aug 9 2021, 5:40 AM
This revision was landed with ongoing or failed builds.Aug 17 2021, 6:10 AM
This revision was automatically updated to reflect the committed changes.